Nexxtic Posted December 1, 2017 Is it possible to add values to arrays through a script? Like how you use name ArrayName.add(value) on java, or ArrayName.append[] on Python? 0 Quote Share this post Link to post
0 scifista42 Posted December 1, 2017 Value assignment is done by "arrayName[x] = y;", where "x" must be a non-negative number strictly lesser than the array's size. Size of an array is fixed to the value you declare the array with, and can't be changed at runtime. 0 Quote Share this post Link to post
0 Mordeth Posted December 2, 2017 As long as you declare your array a certain size, those values are initialized at start. You can add values in-game with a script as usual, up to the declared size. But you cannot resize your array. Be careful: if you have more than one script updating/reading the same array, you will run the real risk of experiencing race conditions. You cannot control which script will run first within a given tic. If the values in your array are meant to convey information about a Thing, you're much better off storing those values in that Thing's COUNTx properties instead. 0 Quote Share this post Link to post
Question
Nexxtic
Is it possible to add values to arrays through a script? Like how you use name ArrayName.add(value) on java, or ArrayName.append[] on Python?
Share this post
Link to post
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.