Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
When i transform a variable into an array the number is locked to 1. this doesn t usually happen how do i fix this. Yes i know there s an answer to this question somewhere i searched for it i didn t find it.
The 'size' of an array is set to 1 and cannot be increased.
This doesn't matter. All indices of an array up to 16383 are able to be written to and read from despite the array size value.
Array sizing only affects how many indices of the the array are given the default value on map init (#'s 0 through (SIZE-1) are initialized).
Erroneously using a large size for non-primitive variable types may be considered a memory leak if those indices are never used or are overwritten before being properly cleaned.
Some types of variables cannot have default values assigned to them when they are made into arrays.
Or you are confused that you can't assign different default values to different indices, which you can never do because that's not what "default value" means.
Mostly these are handle types.
You should also be aware that after converting a variable into an array, it will be necessary to go back through every trigger that uses that old non-array version and manually change every single instance of the variable to properly use some array index. GUI will not do this for you, and it will appear to be correct until you attempt to launch the map at which point it will crash when such at trigger is executed in-game or cause some sort of compiler error on-save.
Its best to change variable size within the variable editor. Doing it in the trigger editor will disable all uses of the variables within triggers and also doesnt work intuitively since one has to reselect the variable type after changing size, and even after doing that, selecting another variable directly after will mess that one up too.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.