I'm coming from a different game engine that used a home-brew programming language based off OOP and some mild .NET influence. With that said, let me get to my problem.
The following code I used to create a custom, or, user-defined type in the language.
_Type platform
Field ent, x:Float, y:Float, z:Float, ptype
End Type_
I then had to keep each new type-instance I created in a list so I may access them via their creation handle.
_local list_platform:TList = New TList_
To create a new insert into the type I would ::
_local p:platform = new platform_
I then added it to the type list
_listaddlast p, list_platform_
To go through the list to access my type inserts i would ::
_for local a=eachin list_platform
print a.ent
print a.x
etc..etc..
next_
I've spent the last 6 hours reading over Godot's scripting fundamentals and watch quite a few videos, but I still havent found what I'm looking for. Is there a simular way in Godot to achieve the above?
I need to make custom containers and store strings, ints, float.. whatever in them all defined by the type field. then be able to access them by handle throughout my code.
Even an array[] of types would work, as long as I would be able to label them for detection.. like array[1].carcolor = red .