Ideally I would like to do the exact same thing in Region02 and Region03....potentially all the way up to Region10.
To make things nice and tidy it would be ideal to just keep those three if/then statements together as one method and just call it as often as I like passing through a region. In other words, instead of having the 3 if/then conditions 5 separate times, only have it once and have it trigger as such:
Hi everyone, sorry if this has already been asked before - if so please feel free to link me to a thread that has the answer.
What I need to know is, is it possible to use a region like a variable? I currently have a trigger that does the following:
if { Comparison(PlayerRace(1)=Protoss) } then {
CreateUnitsAtPoint(1, "Zealot",No Options,1,(RegionGetCenter(Region01))
}
if { Comparison(PlayerRace(1)=Terran) } then {
CreateUnitsAtPoint(2, "Marine",No Options,1,(RegionGetCenter(Region01))
}
if { Comparison(PlayerRace(1)=Zerg) } then {
CreateUnitsAtPoint(4, "Zergling",No Options,1,(RegionGetCenter(Region01))
}
_____________________________________________
Ideally I would like to do the exact same thing in Region02 and Region03....potentially all the way up to Region10.
To make things nice and tidy it would be ideal to just keep those three if/then statements together as one method and just call it as often as I like passing through a region. In other words, instead of having the 3 if/then conditions 5 separate times, only have it once and have it trigger as such:
TriggerExecute: spawnUnits(Region01)
TriggerExecute: spawnUnits(Region02)
TriggerExecute: spawnUnits(Region03)
TriggerExecute: spawnUnits(Region04)
TriggerExecute: spawnUnits(Region05)
spawnUnits(variable) {
if { Comparison(PlayerRace(1)=Protoss) } then {
CreateUnitsAtPoint(1, "Zealot",No Options,1,(RegionGetCenter(variable))
}
if { Comparison(PlayerRace(1)=Terran) } then {
CreateUnitsAtPoint(2, "Marine",No Options,1,(RegionGetCenter(variable))
}
if { Comparison(PlayerRace(1)=Zerg) } then {
CreateUnitsAtPoint(4, "Zergling",No Options,1,(RegionGetCenter(variable))
}
}
Is this at all possible? How can I do this?
I haven't used variables before so please forgive my ignorance if I need follow up explanation.
You can use a convert string to region function and then use a fixed string + number from an integer variable.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
Above works. Personally I'd make an array variable and loop through it.