Ok, I have a AI spawn script that allows the user to spawn as many AI as he wants called from the radio command menu.
The problem is I assign the name of the soldier to be spawned 'soldier1' lets say.
so, once that soldier is spawned, that name is taken and a second soldier cannot be spawned, even if that variable (name) is set to nil or if the 'vehicle' (unit) is deleted using deleteVehicle command.
My solution was to come up with a counter/loop of sorts that would make the number increase on the end of the name. But, as seems obvious, you can't add strings and integers together (we don't have casting in sqs
).
Is there a good way to do something like this? Or do I need to make a very large array and just go through it assigning each new soldier a name out of there?
Here is an example of what I want:
variable = 1
#loop
~2
hisName = "hisName" + variable; //variable is an int in this case, so it won't actually add (THIS PRODUCES AN ERROR)
hint format["%1", hisName]; //Ideally, this would return hisName1 then hisName2 on the next loop, then hisName3...etc
variable = variable + 1;
goto "loop"
Thanks for any help guys,
Corrupt3d