- Joined
- Aug 19, 2007
- Messages
- 1,380
Howdy, I wanted to create a simple expansion mod for warcraft 3 maps but after x amount of time (usually after 15 or 30 minutes or such) the game crashes and I get a memory error. I think it has to do something with my triggers that mostly involve giving AI orders when they have enough resources as an easy way to let them train/upgrade to custom units & buildings. Luckily nothing too complex, but probably badly clicked together. It had been years that I created warcraft 3 maps so my own memory is a bit cloudy especially with triggers, I do remember that memory leaks need to be prevented so I used the guide on world-editor-tutorials to try to remove them.
Does anyone know what is wrong with the triggers below?:
Does anyone know what is wrong with the triggers below?:
-
ai towers
-
Events
- Time - Every 450.00 seconds of game time
- Conditions
-
Actions
- Set tempPlayerGroup = (All players matching (((Matching player) controller) Equal to Computer))
-
Player Group - Pick every player in tempPlayerGroup and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Picked player) Current gold) Greater than 300
- ((Picked player) Current lumber) Greater than 200
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Race of (Picked player)) Equal to Human
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random integer number between 1 and 10) Less than or equal to 5
-
Then - Actions
- Set tempUnitGroup = (Units owned by (Picked player) of type Guard Tower)
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Advanced Guard Tower
- Custom script: call DestroyGroup (udg_tempUnitGroup)
-
Else - Actions
- Set tempUnitGroup = (Units owned by (Picked player) of type Arcane Tower)
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Advanced Arcane Tower
- Custom script: call DestroyGroup (udg_tempUnitGroup)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Race of (Picked player)) Equal to Orc
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random integer number between 1 and 10) Less than or equal to 5
-
Then - Actions
- Set tempUnitGroup = (Units owned by (Picked player) of type Watch Tower)
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Advanced Watch Tower
- Custom script: call DestroyGroup (udg_tempUnitGroup)
-
Else - Actions
- Set tempUnitGroup = (Units owned by (Picked player) of type Orc Burrow)
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Advanced Orc Burrow
- Custom script: call DestroyGroup (udg_tempUnitGroup)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Race of (Picked player)) Equal to Undead
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random integer number between 1 and 10) Less than or equal to 5
-
Then - Actions
- Set tempUnitGroup = (Units owned by (Picked player) of type Spirit Tower)
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Advanced Spirit Tower
- Custom script: call DestroyGroup (udg_tempUnitGroup)
-
Else - Actions
- Set tempUnitGroup = (Units owned by (Picked player) of type Nerubian Tower)
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Advanced Nerubian Tower
- Custom script: call DestroyGroup (udg_tempUnitGroup)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Race of (Picked player)) Equal to Night Elf
-
Then - Actions
- Set tempUnitGroup = (Units owned by (Picked player) of type Ancient Protector)
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Advanced Ancient Protector
- Custom script: call DestroyGroup (udg_tempUnitGroup)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Custom script: call DestroyForce( udg_tempPlayerGroup)
-
Events
-
ai heroes
-
Events
- Time - Every 461.00 seconds of game time
- Conditions
-
Actions
- Set tempPlayerGroup = (All players matching (((Matching player) controller) Equal to Computer))
-
Player Group - Pick every player in tempPlayerGroup and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Picked player) Current gold) Greater than 500
- ((Picked player) Current lumber) Greater than 250
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Race of (Picked player)) Equal to Human
-
Then - Actions
- Set tempUnitGroup = (Units owned by (Picked player) of type Altar of Kings)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random integer number between 1 and 10) Less than or equal to 5
-
Then - Actions
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Lord Garithos
-
Else - Actions
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Sylvanas Windrunner
-
If - Conditions
- Custom script: call DestroyGroup (udg_tempUnitGroup)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Race of (Picked player)) Equal to Orc
-
Then - Actions
- Set tempUnitGroup = (Units owned by (Picked player) of type Altar of Storms)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random integer number between 1 and 10) Less than or equal to 5
-
Then - Actions
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Gul'dan
-
Else - Actions
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Thrall
-
If - Conditions
- Custom script: call DestroyGroup (udg_tempUnitGroup)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Race of (Picked player)) Equal to Undead
-
Then - Actions
- Set tempUnitGroup = (Units owned by (Picked player) of type Altar of Darkness)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random integer number between 1 and 10) Less than or equal to 5
-
Then - Actions
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Balnazzar
-
Else - Actions
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Kil'jaeden
-
If - Conditions
- Custom script: call DestroyGroup (udg_tempUnitGroup)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Race of (Picked player)) Equal to Night Elf
-
Then - Actions
- Set tempUnitGroup = (Units owned by (Picked player) of type Altar of Elders)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random integer number between 1 and 10) Less than or equal to 5
-
Then - Actions
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Malfurion
-
Else - Actions
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Ghost
-
If - Conditions
- Custom script: call DestroyGroup (udg_tempUnitGroup)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Custom script: call DestroyForce( udg_tempPlayerGroup)
-
Events
-
ai units
-
Events
- Time - Every 217.00 seconds of game time
- Conditions
-
Actions
- Set tempPlayerGroup = (All players matching (((Matching player) controller) Equal to Computer))
-
Player Group - Pick every player in tempPlayerGroup and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Picked player) Current gold) Greater than 260
- ((Picked player) Current lumber) Greater than 130
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Race of (Picked player)) Equal to Human
-
Then - Actions
- Set tempUnitGroup = (Units owned by (Picked player) of type Barracks)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random integer number between 1 and 10) Less than or equal to 5
-
Then - Actions
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Longbow Archer
-
Else - Actions
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Captain
-
If - Conditions
- Custom script: call DestroyGroup (udg_tempUnitGroup)
- Set tempUnitGroup = (Units owned by (Picked player) of type Workshop)
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Magical Battleship
- Custom script: call DestroyGroup (udg_tempUnitGroup)
- Set tempUnitGroup = (Units owned by (Picked player) of type Arcane Sanctum)
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Hydromancer
- Custom script: call DestroyGroup (udg_tempUnitGroup)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Race of (Picked player)) Equal to Orc
-
Then - Actions
- Set tempUnitGroup = (Units owned by (Picked player) of type Barracks)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random integer number between 1 and 10) Less than or equal to 5
-
Then - Actions
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Forest Troll Trapper
-
Else - Actions
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Forest Troll Warlord
-
If - Conditions
- Custom script: call DestroyGroup (udg_tempUnitGroup)
- Set tempUnitGroup = (Units owned by (Picked player) of type Beastiary)
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Orc Beastmaster
- Custom script: call DestroyGroup (udg_tempUnitGroup)
- Set tempUnitGroup = (Units owned by (Picked player) of type Spirit Lodge)
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Raging Warlock
- Custom script: call DestroyGroup (udg_tempUnitGroup)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Race of (Picked player)) Equal to Undead
-
Then - Actions
- Set tempUnitGroup = (Units owned by (Picked player) of type Crypt)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random integer number between 1 and 10) Less than or equal to 5
-
Then - Actions
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Zombie
-
Else - Actions
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Skeletal Orc Enforcer
-
If - Conditions
- Custom script: call DestroyGroup (udg_tempUnitGroup)
- Set tempUnitGroup = (Units owned by (Picked player) of type Sacrificial Pit)
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Sludge Monstrosity
- Custom script: call DestroyGroup (udg_tempUnitGroup)
- Set tempUnitGroup = (Units owned by (Picked player) of type Temple of the Damned)
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Wraith W
- Custom script: call DestroyGroup (udg_tempUnitGroup)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Race of (Picked player)) Equal to Night Elf
-
Then - Actions
- Set tempUnitGroup = (Units owned by (Picked player) of type Ancient of War)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random integer number between 1 and 10) Less than or equal to 5
-
Then - Actions
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Sentry
-
Else - Actions
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Moonwood Archer
-
If - Conditions
- Custom script: call DestroyGroup (udg_tempUnitGroup)
- Set tempUnitGroup = (Units owned by (Picked player) of type Ancient of Wind)
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Wildkin
- Custom script: call DestroyGroup (udg_tempUnitGroup)
- Set tempUnitGroup = (Units owned by (Picked player) of type Chimaera Roost)
- Unit - Order (Random unit from tempUnitGroup) to train/upgrade to a Hydra
- Custom script: call DestroyGroup (udg_tempUnitGroup)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Custom script: call DestroyForce( udg_tempPlayerGroup)
-
Events
-
ai upgrades
-
Events
- Time - Every 999.00 seconds of game time
- Conditions
-
Actions
- Set tempPlayerGroup = (All players matching (((Matching player) controller) Equal to Computer))
-
Player Group - Pick every player in tempPlayerGroup and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Picked player) Current gold) Greater than 500
- ((Picked player) Current lumber) Greater than 300
-
Then - Actions
- Set tempUnitGroup = (Units owned by (Picked player) matching (((Unit-type of (Matching unit)) Equal to Castle) or (((Unit-type of (Matching unit)) Equal to Fortress) or (((Unit-type of (Matching unit)) Equal to Black Citadel) or ((Unit-type of (Matching unit)) Equal to Tree of E
- Unit - Order (Random unit from tempUnitGroup) to research Stockades
- Custom script: call DestroyGroup (udg_tempUnitGroup)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Custom script: call DestroyForce( udg_tempPlayerGroup)
-
Events
-
Shop fix
-
Events
- Unit - A unit Finishes an upgrade
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
- (Unit-type of (Triggering unit)) Equal to Artifact Vault
- (Unit-type of (Triggering unit)) Equal to Artivact Lounge
- (Unit-type of (Triggering unit)) Equal to Tomb of Artifacts
- (Unit-type of (Triggering unit)) Equal to Artifact Wonders
-
Conditions
-
Or - Any (Conditions) are true
-
Actions
- Game - Display to (All players) the text: arcane vault upgrad...
- Set TempPoint = (Position of (Triggering unit))
- Unit - Remove (Triggering unit) from the game
- Unit - Create 1 (Unit-type of (Triggering unit)) for (Owner of (Triggering unit)) at TempPoint facing Default building facing degrees
- Custom script: call RemoveLocation (udg_TempPoint)
-
Events
Last edited: