I want to make a for loop in bp to assign enemy1, enemy2, enemy3… into enemy array using incremental suffix. How do I get this done using this way, in as3 it’s something like,
well i have list of float variables (EQ1, EQ2, EQ3…), after some calculation of every each float, now I want to put it into an array call EQ. this is what I want to do but i have no idea how to make it work.
I was thinking to assign all the variable (EQ1, EQ2, EQ3…) into the EQ array by using for loop, and then set array element (as you can see the pic above) corresponding to the float variable name. (e.g. EQ[0] = EQ1, EQ[1] = EQ2, EQ[2] = EQ3…), the problem is the “Set Array Elem” param only takes 1 constant value. Let’s say I take EQ1 and plug into the Item param), in the next iteration, my EQ[1] = EQ1 which is the problem right here.
What I want is to assign EQ2 into my 2nd index (EQ[1]) of array instead of keep assigning the same value. I want to change the item param dynamically as the iteration going on. So I draw the pinky square box there to see if there is some function allow me to use string to represent my variable name so I can change the suffix of 1,2,3,4… based on the index of the loop, and this function will combine string of “EQ” and “1” together and formed “EQ1”, so that EQ2 in next loop. Hope you can understand, my english is very bad =O
if the number of enemy is fixed, you don’t need to use “set_array_element” function or assigning a name for each of them. Simply use “Add” function to put the eq1, eq2, … inside the EQ array, and when ever you need their value, use “Get” function of array to get value of the element by index.