My question is on title, is possible?
It’s very possible (you need two variables)
You can save any value in variables. You could check things like that yourself (with the Debugger, writing a text, with a text object, etc.)
If I remember rightly, the syntax is just basically : Variable VariableName = Object.X()
I know… but i’m saying of X and Y in same variable. The value is like 100;100 (x,y) in var can i write this and read this position?
I do not want:
Variable Position1
Child X = Value
Child Y = Value
Variable Position2
Child X = Value
Child Y = Value
I want:
Variable Position1
Child Pos = X,Y Coordinates
Child InUse = 0 ( has an object in this position )
Variable Position2
Child Pos = X,Y Coordinates
Child InUse = 0 ( has an object in this position )
It’s a very over-complex way of doing it. =/
Child Pos = X,Y Coordinates
You want to store a list/array, the closest thing to this in GD are child variables, so… no… there is no way of doing it in one variable
But you can make it:
Variables
Position_1
X = x coord
Y = y coord
InUse = 0
Then you can use: Variable(Position_1.X) , Variable(Position_1.Y) and Variable(Position_1.InUse)
Ok, thanks i know about child, but if can’t be used a unique variable to store vector2 value, its ok
These are exactly for such things that child variables exists. This mimics any programming language offering objects or structure.
You can have a variable containing two sub variables x/y:
MyObject.Variable(pos.x)
MyObject.Variable(pos.y)
It can even be a sub variable of another variable:
MyObject.Variable(theTarget.pos.x)
MyObject.Variable(theTarget.pos.y)
It would be great if “theTarget” were an object, sadly you cannot store objects as variables…