za0 3 Posted October 25, 2021 I have 10 units. Their variable names are: s1, s2, s3, s4, s5, s6, s7, s8, s9, s10. I want to make all of them be in just one name. How do I set this variable? Share this post Link to post Share on other sites
Harzach 2505 Posted October 25, 2021 (edited) Place them in an array: za0_units = [s1,s2,s3,s4,s5,s6,s7,s8,s9,s10]; or group them in the editor and name the group. Edited October 26, 2021 by Harzach fixed array elements 1 Share this post Link to post Share on other sites
ZaellixA 383 Posted October 26, 2021 14 hours ago, Harzach said: Place them in an array: za0_units = ["s1","s2","s3","s4","s5","s6","s7","s8","s9","s10"]; or group them in the editor and name the group. Please correct me if I am wrong but I believe that quotation marks can be omitted. I mean that you can actually create an array to hold the actual objects and not their names as strings. Of course, what is "best" depends on the intended behavior. 1 Share this post Link to post Share on other sites
beno_83au 1362 Posted October 26, 2021 5 minutes ago, ZaellixA said: Please correct me if I am wrong but I believe that quotation marks can be omitted. Yes, I'd guess that Harzach just had a brain fart moment 🙂 But obviously, without the quotes each index refers to the unit itself. 2 Share this post Link to post Share on other sites
Harzach 2505 Posted October 26, 2021 Yes indeed, thanks for the catch @ZaellixA! 1 Share this post Link to post Share on other sites