Is there a way to setup an array with multiple values? If I do {1,2,3,4,5,6} in the Custom Script will that work? Or do I have to make a trigger that sets all of the values when the map starts?
Edit: Also, is it possible to make an array of regions then use them to spawn units at the locations?
Is there a way to setup an array with multiple values?
No
Quote:
If I do {1,2,3,4,5,6} in the Custom Script will that work?
No. (although Galaxy++ might support it, not sure)
Quote:
Or do I have to make a trigger that sets all of the values when the map starts?
Yes. But you can use a loop to set initial values without setting each individual array element.
Quote:
Also, is it possible to make an array of regions then use them to spawn units at the locations?
Sure. However, in Gui, you will need to set all array elements individually. In Galaxy, the regions all get a unique id, based on their placement order on the map. So, if you place all your regions one after the other, they get consecutive ids and you can use a loop again.
Quick question though, how exactly do I use the "Region" array? If I do "Set Variable" action the variable doesn't show up, and if there is a spot where a region location is supposed to be it doesn't show up in the variables either.
I have it setup as SpawnLocations (Type = Region), Array 0 - 5
Not sure, what your problem is. If I place a region on the map and create a region array variable, I can use the Set Variable action and select the array and the region on the map without any problems.
Is there a way to setup an array with multiple values? If I do {1,2,3,4,5,6} in the Custom Script will that work? Or do I have to make a trigger that sets all of the values when the map starts?
Edit: Also, is it possible to make an array of regions then use them to spawn units at the locations?
No
No. (although Galaxy
++
might support it, not sure)Yes. But you can use a loop to set initial values without setting each individual array element.
Sure. However, in Gui, you will need to set all array elements individually. In Galaxy, the regions all get a unique id, based on their placement order on the map. So, if you place all your regions one after the other, they get consecutive ids and you can use a loop again.
@Kueken531: Go
Alright, thanks for the info.
Quick question though, how exactly do I use the "Region" array? If I do "Set Variable" action the variable doesn't show up, and if there is a spot where a region location is supposed to be it doesn't show up in the variables either.
I have it setup as SpawnLocations (Type = Region), Array 0 - 5
Not sure, what your problem is. If I place a region on the map and create a region array variable, I can use the Set Variable action and select the array and the region on the map without any problems.
@Kueken531: Go
I had Defines Default Value checked, my bad.
So there is really no way to define the values of an array other than through Triggers? I feel like a feature like that would be so helpful to have.
@DaveSilver: Go
If you want to use Static Array types, use Records.
They are a lot more flexible and Variables can be set up within the Record creation.