I want to make a turn-system, in which an object’s parameter, name, will be made a new child on an array. (This name will be adjustable, of course, to something in the user’s events, or by setting it to an object or instance’s string, but this is irrelevant, I think.) I don’t think arrays can be used for this but tell me if they can. What I would like to know is how I can involve an array somehow.
This might be more than you asked for but I wanted to add as much context as I could for you and others.
You can use variables and arrays inside functions. You can’t declare them like in scenes but they will be created as needed. You might also need to use Variable(variableName) and VariableString(variableName) in certain expressions.
You can also use an array as a parameter, copy it to a variable to be used within the function, modify it and then copy that variable back to the variable used in the parameter. That way the function uses its own variable and you can use any variable you want to as a parameter.
Scene variables for the scene
Scene events to add 3 numbers to an array. Call the function, then display the array values to a text object.
The function setup
The function parameters
The function events. This copies the parameter variable to another variable so it’s a known variable name. It then goes through the array and increases each on by one. It then adds the Value parameter to the array and finally sets the parameter variable to the one used within the function.
And just for clarity for you and others. The actions are under [other actions]
Hey, this is almost another thing, but can the string from a list of variables property have children / options added to it? I mean, there is the “+(add)” thing, but is that what that does, I mean? And can this be chosen by order, like a variable?