[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: logo_dark.png (51 KB, 1888x666)
51 KB PNG
Why doesn't GDScript have any pointer syntax? Why the hell do I have to just guess which types were arbitrarily chosen to be passed as pointers by default instead of just, y'know, being able to choose that myself by including or not including a fucking asterix?
>Oh you want to copy an array? Fuck you. You get a pointer to the array instead, unless you dig into the docs, oh no not those docs the other docs you long-fingered control freak. No we won't indicate in the editor that you actually created a pointer instead of a new array, we'll just leave you to figure it out yourself from all the glitches and crashes since you think you're so smart.
>Oh you want to point to an integer? Go to Hell.
Why just assume that I'm going to always want to copy the value of this type or point to this other type? "Oh no, the monkeys who never evolved past tree shrews can't understand abstraction, let's do the thinking for them so they don't overwork their atrophied brains" Seriously what the fuck is this? Just give me, ME! the option to choose, on my own, because I'm capable of making my own decisions, which variables to set as their own variables and which variables to set as pointers. Quit making shit harder to use by dumbing it down.
>>
You talk a lot of shit for someone getting tripped up over such a minor issue
>>
>pointer to an int
ISHYGDDT
>>
>>109426054
it's pretty intuitive once you realize that these languages operate on sane behavior. you can always assume that passing an array into a function will always pass a pointer because why the heck would you pass it as a value?
>>
>>109426452
I sure hope you're not including Python in "these languages" because it definitely does not operate on sane behavior.
>>
>>109426461
what did you encounter that was not sane?
>>
>>109426465
GDScript
>>
looks like you missed some baby steps.
in most scripting languages, primitive types are passed by value and all the others are passed by reference.
>>
>using the game engine for babies
>complaining it treats you like a baby
lol
>>
>>109426054
just git gud, OP. also have you actually measured if you need to optimize a piece of code?
if you tinker tranny around like this you'll never finish a game.
>>
>>109426054
i use phaser 4 for 2d. godot niggas begone
>>
Yeah it's pretty fucking retarded.
>>
>>109426054
This is a skill issue on your part unfortunately.
Primitives don't need an identity, data structures do. It's that simple.
>>
>>109426054
How about not using GDScript and using C#?
>>
>>109426054
Just use an object, objects are passed as reference.
>>
>>109430295
Isn't Godot, C and C++ compatible ?
>>
>>109426054
because you are using a fake toy language and a fake toy engine?
>>
>>109432289
you sound like someone who hasn't heard of scratch or clickteam.
>>
>>109426054
Just use .duplicate()
Python has very similar syntax
Also read this
https://forum.godotengine.org/t/reference-pointers-in-gdscript/44519/2
Coding is about solving problems not getting caught up on minor details



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.