I learned how to create String variables, with a "variable part" in the variable name, like this: UnitID01, UnitID02, using format [%1] and a variable at the end of the code block.
Now I would like to do the same with arrays. I am trying to save some playerUIDs in a series of arrays just like this:
However when I try the same format[] trick, it creates a properly named variable but of "string" type, rather than array.
How can I do this please?
(By the way, in the subsequent lines I would like to manipulate that freshly-created array; e.g.: if X or Y pushback someValue to Array_SU28ACL. If other conditions are met perhaps remove something or add another array element etc. etc.
How am I supposed to 'address' this variable-named array since at the time of writing SQF code I don't know what the run-time ID would be - hope this makes sense).
Question
mgm
HI guys,
Need some scripting help please!
I learned how to create String variables, with a "variable part" in the variable name, like this: UnitID01, UnitID02, using format [%1] and a variable at the end of the code block.
Now I would like to do the same with arrays. I am trying to save some playerUIDs in a series of arrays just like this:
The 27 is based on a variable, let's call it "_currentID"...The next time we call the SQF script, at the top of the page it will increase the index value _currentID by one.
Therefore when it reaches the array creation code and it should then create this:
However when I try the same format[] trick, it creates a properly named variable but of "string" type, rather than array.How can I do this please?
(By the way, in the subsequent lines I would like to manipulate that freshly-created array; e.g.: if X or Y pushback someValue to Array_SU28ACL. If other conditions are met perhaps remove something or add another array element etc. etc.
How am I supposed to 'address' this variable-named array since at the time of writing SQF code I don't know what the run-time ID would be - hope this makes sense).
Link to comment
Share on other sites
13 answers to this question
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now