So i am trying to make a random defense map. My first problem, I am trying to make my Goliath cost 2 credits instead of 1 all i can find is Any Unit Enters Region for events. So im looking for something like Any 2 Units Enter Region. I also need to know how to spawn units 1 after another like a second apart or so. Any help is greatly appreciated.
You won't cut it with only events, there is lots of other stuff in triggers too ;)
For what you want, as you said credits are units, you need something like that:
Events
Any Unit Enters Region
Conditions
(Number of units in (Units in [Region]) == 1 // use unit group - number of units in unit group, then unit group, units in region, also it may be 2 instead of one dunno if condition counts triggering unit in that case as well
Actions
Unit - create whatever you want etc.
For periodic spawns, you can either do it like this:
create global variable of type Timer (right click beetwen triggers and choose new element -> variable) lets call it TimeVariable
Put this in trigger where respawns start:
Timer - Create New Timer
Set variable - TimerVariable = (Last Created Timer)
Timer - Start TimerVariable, seconds, one shot, game time
And another trigger:
Event
Timer expires // if you can use TImerVariable here instead of timer (not sure bout it), do so and disregard condition
Condition
Elapsed/triggering timer == TimerVariable // don't know if that's required, look around for function to compare itriggering timer
Actions
Unit - create units blah blah
Unit - order them to move or whatever
Timer - Start TimerVariable, seconds, one shot, etc
That can be accomlished other ways, like:
-Change event to periodioc event, every X seconds and disregard all timer stuff. In other triggers, use Trigger - turn [spawningtriggerimtalkingabouthere] ON to start spawning, and OFF to stop it
-Use Wait X seconds, then Run(this trigger) again.
Thanks for the info i got the second method for spawning units 1 at a time to work. as for the credits i cant seem to get the condition quite right but i should be able to get it from here, thx again.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So i am trying to make a random defense map. My first problem, I am trying to make my Goliath cost 2 credits instead of 1 all i can find is Any Unit Enters Region for events. So im looking for something like Any 2 Units Enter Region. I also need to know how to spawn units 1 after another like a second apart or so. Any help is greatly appreciated.
You won't cut it with only events, there is lots of other stuff in triggers too ;)
For what you want, as you said credits are units, you need something like that:
Events
Any Unit Enters Region
Conditions
(Number of units in (Units in [Region]) == 1 // use unit group - number of units in unit group, then unit group, units in region, also it may be 2 instead of one dunno if condition counts triggering unit in that case as well
Actions
Unit - create whatever you want etc.
For periodic spawns, you can either do it like this:
create global variable of type Timer (right click beetwen triggers and choose new element -> variable) lets call it TimeVariable
Put this in trigger where respawns start:
Timer - Create New Timer
Set variable - TimerVariable = (Last Created Timer)
Timer - Start TimerVariable, seconds, one shot, game time
And another trigger:
Event
Timer expires // if you can use TImerVariable here instead of timer (not sure bout it), do so and disregard condition
Condition
Elapsed/triggering timer == TimerVariable // don't know if that's required, look around for function to compare itriggering timer
Actions
Unit - create units blah blah
Unit - order them to move or whatever
Timer - Start TimerVariable, seconds, one shot, etc
That can be accomlished other ways, like:
-Change event to periodioc event, every X seconds and disregard all timer stuff. In other triggers, use Trigger - turn [spawningtriggerimtalkingabouthere] ON to start spawning, and OFF to stop it
-Use Wait X seconds, then Run(this trigger) again.
you you be better off seting the cost in the data editor. alot less work
@uiasdnmb: Go
Thanks for the info i got the second method for spawning units 1 at a time to work. as for the credits i cant seem to get the condition quite right but i should be able to get it from here, thx again.