Dynamic Variable

Hello everyone,

i want to change a Variable based on user click on specific item with object Variable.
Like for example i have scene Variables x,y,z. and i have object a,b,c and they are grouped in objects
object a has an object variable (value) of x. b and c has y and z simultaneously.

so i want to make an action that when i click on Objects (a), i subtract the scene variable (x) corresponding to the object Variable (of a) (x) by a number.

i have reviewed the forum and all the logs are 2013 ~2015,

i used the structure value that i made all the scene variable as childs , for example, Box.x , Box.y and Box.Z

and i used this code:
change the scene Variable myStruct[Box[Objects.VariableString(Value)]] subtract 1

i know there is something wrong and i tried other solution instead of myStruct[Box[Objects.VariableString(Value)]] , i tried Box[Objects.VariableString(value)] and doesnt work either.

hope you can help me.


if you want to substract from the variable, I think thats a number. the VariableString means the value of the variable is a string, not a number. in other words you substract one from a text. this is uninterpretable.

Hi Gyuszko,

thanks for your reply, actually the variable Box.x is a number i just want to link it with the object i am clicking.

so instead of writing
change the scene variable Box.x substract a.Variable(x)

i wanted it generic to be
change the scene Variable Box.[object.VariableString(value)] substract Objects.Variable(x)

hope it clears something.


ehh…hmmm. ok. may be. I don’t know, I’m not sure I understand what you want.
It would be good if you were more specific. nobody will stole your object names, variable names and/or your ideas.

if I understand correctly, this is what you are want to achieve:
when you click to an object, substract one from a scene variable structure. like some kind of a counter. for example player has to destroly 10 red and 15 green thing. and you count all requirements in one scene variable structure. I am close to deciphering? :face_with_monocle:

its not about stealing my programming i am still learning,

here is my objects and btw it worked so i am going to set the screen shots in here for others to learn.

i tried to illustrate using my variables but its hard, i will do my best.

here i dynamically linked my child variable with the object variable i clicked so as to subtract scene variable linked also with the object i clicked to subtract the value of another object variable.

its a bit complicated but it worked !!

1 Like