I’d like to be able to get value of variable constructed from string.
Let’s say I have variables Name1,Name2,Name3, etc. Obviously pattern is Name+somenumber.
I’d like to be able to get it by using VariableStringFromName(“Name”+VariableString(nameID)), so if nameID=1, I’d get value of Name1, if =2, then Name2, etc.
This would make easy to create things like message systems, etc.
And no, I can’t use Array extension as I’m making HTML5 game for which it isn’t available and even if I’d make for native, I care about linux compatibility.
I will try to compile the extension as soon as possible on Linux and to add js support but it will take some time.
However, the source code of the extension (if you can compile it) is available here : https://github.com/victorlevasseur/GD-Array-Extension
The next version of Game Develop will support structures ( Variables containing other variables ).
You will be able to change/compare the value of the child of a structure like this:
Do =5 to the value of MyVariable.FirstChild.SubChild
Moreover, a specific syntax will be available ( Using brackets, similar to the way it’s done in Javascript ), allowing to use a string expression to access to a child:
Do =5 to the value of MyVariable["FirstChild"].SubChild
And in particular this can be used to use an array-like variable: