PDA

View Full Version : Warcraft III basic trigger gone hay-wire!


Tenshi no aisudora
01-01-2011, 06:47 AM
I am building a map, and it is almost finished. I can release it as soon as this error is fixed. For some reason this trigger isn't setting the integer higher. I had a trigger for doing this before but it was highly unstable, and leaky. I built this new one for the newest version. I am hoping to have this released today/tomorrow.

Spawn
Events
Conditions
(Number of units in Zombies) Equal to 0
Actions
Set Zombie_Spawn[0] = (Center of Spawn TL <gen>)
Set Zombie_Spawn[1] = (Center of Spawn BL <gen>)
Set Zombie_Spawn[2] = (Center of Spawn BR <gen>)
Set Zombie_Spawn[3] = (Center of Spawn TR <gen>)
Game - Display to (All players) the text: (Wave + (String(Wave_Display)))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Zombie_Check Equal to 0
Then - Actions
Set Zombie_Check = 1
Unit - Create 10 Zombie for Neutral Hostile at Zombie_Spawn[0] facing Default building facing degrees
Unit Group - Add (Last created unit) to Zombies
Unit - Create 10 Zombie for Neutral Hostile at Zombie_Spawn[1] facing Default building facing degrees
Unit Group - Add (Last created unit) to Zombies
Unit - Create 10 Zombie for Neutral Hostile at Zombie_Spawn[2] facing Default building facing degrees
Unit Group - Add (Last created unit) to Zombies
Unit - Create 10 Zombie for Neutral Hostile at Zombie_Spawn[3] facing Default building facing degrees
Unit Group - Add (Last created unit) to Zombies
Custom script: call RemoveLocation(udg_Zombie_Spawn[0])
Custom script: call RemoveLocation(udg_Zombie_Spawn[1])
Custom script: call RemoveLocation(udg_Zombie_Spawn[2])
Custom script: call RemoveLocation(udg_Zombie_Spawn[3])
Trigger - Turn off (This trigger)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Zombie_Check Equal to 1
Then - Actions
Set Zombie_Check = 2
Unit - Create 10 Blood Zombie for Neutral Hostile at Zombie_Spawn[0] facing Default building facing degrees
Unit Group - Add (Last created unit) to Zombies
Unit - Create 10 Blood Zombie for Neutral Hostile at Zombie_Spawn[1] facing Default building facing degrees
Unit Group - Add (Last created unit) to Zombies
Unit - Create 10 Blood Zombie for Neutral Hostile at Zombie_Spawn[2] facing Default building facing degrees
Unit Group - Add (Last created unit) to Zombies
Unit - Create 10 Blood Zombie for Neutral Hostile at Zombie_Spawn[3] facing Default building facing degrees
Unit Group - Add (Last created unit) to Zombies
Custom script: call RemoveLocation(udg_Zombie_Spawn[0])
Custom script: call RemoveLocation(udg_Zombie_Spawn[1])
Custom script: call RemoveLocation(udg_Zombie_Spawn[2])
Custom script: call RemoveLocation(udg_Zombie_Spawn[3])
Trigger - Turn off (This trigger)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Zombie_Check Equal to 2
Then - Actions
Set Zombie_Check = 3
Unit - Create 5 Zombie Beetle for Neutral Hostile at Zombie_Spawn[0] facing Default building facing degrees
Unit Group - Add (Last created unit) to Zombies
Unit - Create 5 Zombie Beetle for Neutral Hostile at Zombie_Spawn[1] facing Default building facing degrees
Unit Group - Add (Last created unit) to Zombies
Unit - Create 5 Zombie Beetle for Neutral Hostile at Zombie_Spawn[2] facing Default building facing degrees
Unit Group - Add (Last created unit) to Zombies
Unit - Create 5 Zombie Beetle for Neutral Hostile at Zombie_Spawn[3] facing Default building facing degrees
Unit Group - Add (Last created unit) to Zombies
Custom script: call RemoveLocation(udg_Zombie_Spawn[0])
Custom script: call RemoveLocation(udg_Zombie_Spawn[1])
Custom script: call RemoveLocation(udg_Zombie_Spawn[2])
Custom script: call RemoveLocation(udg_Zombie_Spawn[3])
Trigger - Turn off (This trigger)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Zombie_Check Equal to 3
Then - Actions
Set Zombie_Check = 4
Unit - Create 5 Fat Zombie for Neutral Hostile at Zombie_Spawn[0] facing Default building facing degrees
Unit Group - Add (Last created unit) to Zombies
Unit - Create 5 Fat Zombie for Neutral Hostile at Zombie_Spawn[1] facing Default building facing degrees
Unit Group - Add (Last created unit) to Zombies
Unit - Create 5 Fat Zombie for Neutral Hostile at Zombie_Spawn[2] facing Default building facing degrees
Unit Group - Add (Last created unit) to Zombies
Unit - Create 5 Fat Zombie for Neutral Hostile at Zombie_Spawn[3] facing Default building facing degrees
Unit Group - Add (Last created unit) to Zombies
Custom script: call RemoveLocation(udg_Zombie_Spawn[0])
Custom script: call RemoveLocation(udg_Zombie_Spawn[1])
Custom script: call RemoveLocation(udg_Zombie_Spawn[2])
Custom script: call RemoveLocation(udg_Zombie_Spawn[3])
Trigger - Turn off (This trigger)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Zombie_Check Equal to 4
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Wave_Check Not equal to 10
Then - Actions
Set Zombie_Check = 0
Set Wave_Check = (Wave_Check + 1)
Set Wave_Check2 = (Wave_Check2 + 1)
Set Wave_Display = (Wave_Display + 1)
Else - Actions
Unit - Create 1 Zombie Furbulog for Neutral Hostile at Zombie_Spawn[0] facing Default building facing degrees
Unit Group - Add (Last created unit) to Zombies
Unit - Create 1 Zombie Giant Spider for Neutral Hostile at Zombie_Spawn[1] facing Default building facing degrees
Unit Group - Add (Last created unit) to Zombies
Unit - Create 1 Zombie Giant Spider for Neutral Hostile at Zombie_Spawn[2] facing Default building facing degrees
Unit Group - Add (Last created unit) to Zombies
Unit - Create 1 Zombie Lizard Mutation for Neutral Hostile at Zombie_Spawn[3] facing Default building facing degrees
Unit Group - Add (Last created unit) to Zombies
Custom script: call RemoveLocation(udg_Zombie_Spawn[0])
Custom script: call RemoveLocation(udg_Zombie_Spawn[1])
Custom script: call RemoveLocation(udg_Zombie_Spawn[2])
Custom script: call RemoveLocation(udg_Zombie_Spawn[3])
Trigger - Turn off (This trigger)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Wave_Check Equal to 10
Then - Actions
Set Zombie_Check = 0
Set Wave_Check = 0
Set Wave_Display = (Wave_Display + 1)
Set Wave_Check2 = (Wave_Check2 + 1)
Unit - Create 1 Nuclear Zombie for Neutral Hostile at Zombie_Spawn[0] facing Default building facing degrees
Unit Group - Add (Last created unit) to Zombies
Unit - Create 1 Nuclear Zombie for Neutral Hostile at Zombie_Spawn[2] facing Default building facing degrees
Unit Group - Add (Last created unit) to Zombies
Custom script: call RemoveLocation(udg_Zombie_Spawn[0])
Custom script: call RemoveLocation(udg_Zombie_Spawn[1])
Custom script: call RemoveLocation(udg_Zombie_Spawn[2])
Custom script: call RemoveLocation(udg_Zombie_Spawn[3])
Trigger - Turn off (This trigger)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Wave_Check2 Equal to 100
Then - Actions
Set Zombie_Check = 0
Set Wave_Check = 0
Set Wave_Check2 = 0
Set Wave_Display = (Wave_Display + 1)
Unit - Create 1 Nuclear Zombie for Neutral Hostile at Zombie_Spawn[2] facing Default building facing degrees
Unit Group - Add (Last created unit) to Zombies
Custom script: call RemoveLocation(udg_Zombie_Spawn[0])
Custom script: call RemoveLocation(udg_Zombie_Spawn[1])
Custom script: call RemoveLocation(udg_Zombie_Spawn[2])
Custom script: call RemoveLocation(udg_Zombie_Spawn[3])
Trigger - Turn off (This trigger)
Else - Actions
Spawn Start
Events
Time - Elapsed game time is 5.00 seconds
Conditions
Actions
Trigger - Run Spawn <gen> (ignoring conditions)
Spawn Restart
Events
Unit - A unit Dies
Conditions
(Owner of (Dying unit)) Equal to Neutral Hostile
Actions
Unit Group - Remove (Dying unit) from Zombies
Trigger - Run Spawn <gen> (checking conditions)


Please tell me what is wrong with this script D:. I think I might be leaving out info. If you need it just say.

Adiktuz
01-01-2011, 07:10 AM
Use trigger tags and hidden tags please, its hard to read currently...

GIANT_CRAB
01-01-2011, 07:34 AM
Move to trigger and scripts plz. thnkx bro

Edit: make it shorter by moving the call Remove to the bottom, that should shorten a lot.

Tenshi no aisudora
01-01-2011, 07:51 AM
If I move that to the bottom it will not run because the trigger shuts off before it gets to the bottom if it runs any of the zombie spawns. If the turn off is removed then it gets rid of the problem of the zombies staying at one level... but every kind of zombie is spawned at once.

BreathingAcid
01-01-2011, 08:35 AM
Try:


Set Zombie_Check = (Zombie_Check + 1)

Tenshi no aisudora
01-01-2011, 08:50 AM
Okay nevermind it is solved. Thanks for you help Crab!