im making a map which is essentialy protoss blowing up a dominion science station , sadly i am encountering some problems with triggers these may be blindingly obvius but im a total noob with triggers!
1) i am attempting to have is so that when player2(ai) has no units left a gate behind him explodes and is removed! all of his base is in a object group'player2base'
my script is
//open door
Events
Game - Map initialization
Local Variables
barracks alive = Barracks [41.50, 109.50] <Unit>
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
-1 <= (Number of Living units in player2SCV's) <= 1
-1 <= (Number of Living units in player2 base) <= 1
-1 <= (Player 2 Supplies Limit) <= 1
Then
Unit - Kill Valhalla Base Door [37.00, 117.00]
AI - Suicide all player 2 units
//
sadly it dosnt work:(
my second problem is that i have a expansion point and when the player kills all the ocupiers a cuttscene plays and builldings warp in ( i have puildings preplaced but invisible and in a unit group)( also its a objective but i cant find the right action the script is
//
minifilm+actions
Events
Game - Map initialization
Local Variables
enemyunits in expansion(1) = expansiondefenceder <Unit Group>
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
0 <= (Number of Living units in expansiondefenceder ) <= 1
Then
Cinematics - Turn cinematic mode On for (All players) over 15.0 seconds
Unit Group - Pick each unit in player1base and do (Actions)
Actions
Unit - Show (Picked unit)
Animation - Play Build animation for (Actor for Pylon [62.00, 38.00]) as Default, using No Options options and 15.0 blend time
Story - Set mission objective Objective progress to 0
------- GAAAAAAAAHH why wont it let me select the expansion objective >:(//
finally as said above how do you do objectives??
thankyou for reading ill upload the map when its finished
Second: well i would suggest that you put in a Wait for Conditions every 2.5 seconds loop before your actions and also remove that If Then Else, cause it would simplify it. So it would look like this:
Events
Game - Map initialization
Actions
Wait for (Conditions) checking every 2.5 seconds of Game Time
- Number of Living units in Player2base = 0
Unit - Kill Valhalla Base Door [37.00, 117.00]
AI - Suicide all player 2 units
As for second trigger, do the following:
Events
Game - Map initialization
Local Variables
Enemy units in expansion(1) = expansiondefenceder <Unit Group>
Actions
Wait for (Conditions) checking every 2.5 seconds of Game Time
- (Number of Living units in expansiondefenceder) = 0
Cinematic - Turn cinematic mode On for (All players) over 15.0 seconds
Unit Group - Pick each unit in player1base and do (Actions)
Actions
Unit - Show (Picked unit)
Animation - Play Build animation for (Actor for Pylon [62.00, 38.00]) as Default, using No Options options and 15.0 blend time
Story - Set mission objective Objective progress to 0
create the computer units with a seperate trigger and add those units to a unit group
In another trigger using event "any unit dies" check to see if the dying unit belongs to the computer's "unit group variable" if it belongs to this unit group, remove this unit from the unit group. Then check to see how many units are left in the unit group If the number of units in the computer "unit group" variable = 0 then do stuff.
Dont put too much code in the map initialization trigger. Or I should say dont use the event for standard triggers the "map initialization" should only have one instance. and its more or less in there for the map to start the game.
In response to chaos berserker's post..... Using waits really isnt the optimal way to go about this... you can easily do a "wait " till number of units in "unit group" = 0 but they arnt nessacary.
hi
im making a map which is essentialy protoss blowing up a dominion science station , sadly i am encountering some problems with triggers these may be blindingly obvius but im a total noob with triggers!
1) i am attempting to have is so that when player2(ai) has no units left a gate behind him explodes and is removed! all of his base is in a object group'player2base'
my script is
//open door
Events
Game - Map initialization
Local Variables
barracks alive = Barracks [41.50, 109.50] <Unit>
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
-1 <= (Number of Living units in player2SCV's) <= 1
-1 <= (Number of Living units in player2 base) <= 1
-1 <= (Player 2 Supplies Limit) <= 1
Then
Unit - Kill Valhalla Base Door [37.00, 117.00]
AI - Suicide all player 2 units
//
sadly it dosnt work:(
my second problem is that i have a expansion point and when the player kills all the ocupiers a cuttscene plays and builldings warp in ( i have puildings preplaced but invisible and in a unit group)( also its a objective but i cant find the right action the script is
//
minifilm+actions
Events
Game - Map initialization
Local Variables
enemyunits in expansion(1) = expansiondefenceder <Unit Group>
Conditions
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
0 <= (Number of Living units in expansiondefenceder ) <= 1
Then
Cinematics - Turn cinematic mode On for (All players) over 15.0 seconds
Unit Group - Pick each unit in player1base and do (Actions)
Actions
Unit - Show (Picked unit)
Animation - Play Build animation for (Actor for Pylon [62.00, 38.00]) as Default, using No Options options and 15.0 blend time
Story - Set mission objective Objective progress to 0
------- GAAAAAAAAHH why wont it let me select the expansion objective >:(//
finally as said above how do you do objectives??
thankyou for reading ill upload the map when its finished
-fuzz
First: Hi there Fuzz ^^
Second: well i would suggest that you put in a Wait for Conditions every 2.5 seconds loop before your actions and also remove that If Then Else, cause it would simplify it. So it would look like this:
Events
Game - Map initialization
Actions
Wait for (Conditions) checking every 2.5 seconds of Game Time
- Number of Living units in Player2base = 0
Unit - Kill Valhalla Base Door [37.00, 117.00]
AI - Suicide all player 2 units
As for second trigger, do the following:
Events
Game - Map initialization
Enemy units in expansion(1) = expansiondefenceder <Unit Group>
Actions
Wait for (Conditions) checking every 2.5 seconds of Game Time
- (Number of Living units in expansiondefenceder) = 0
Cinematic - Turn cinematic mode On for (All players) over 15.0 seconds
Unit Group - Pick each unit in player1base and do (Actions)
Actions
Unit - Show (Picked unit)
Animation - Play Build animation for (Actor for Pylon [62.00, 38.00]) as Default, using No Options options and 15.0 blend time
Story - Set mission objective Objective progress to 0
Some hints
In response to chaos berserker's post..... Using waits really isnt the optimal way to go about this... you can easily do a "wait " till number of units in "unit group" = 0 but they arnt nessacary.