- Joined
- Sep 25, 2013
- Messages
- 717
Hello! Ive made a resource system with many triggers. My map seems to lag a bit and i'm not sure where its coming from. Can you tell if there are leaks in these triggers? Any help is appreciated, thank you!
This trigger causes trade caravans to produce gold. When they get to a fortress they generate gold based off of how far they are from your market. Also, allied fortresses produce more gold.
This trigger causes workers with a mining speed upgrade to mine faster. It creates a unit with the bloodlust ability. Based on the workers buff level, it casts differing levels of bloodlust on the worker.
This trigger causes you to capture nearby pigs. It detects the number of allied units and enemy units around it. If there are more enemy units, it changes ownership to the enemy.
This trigger causes trade caravans to produce gold. When they get to a fortress they generate gold based off of how far they are from your market. Also, allied fortresses produce more gold.
-
Trade Caravan Generate Gold
-
Events
-
Time - Every 1.00 seconds of game time
-
-
Conditions
-
Actions
-
Set tempUnitGroup3 = (Units in (Playable map area) matching (((Matching unit) has buff Trade Caravan (All)) Equal to True))
-
Unit Group - Pick every unit in tempUnitGroup3 and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) has buff Trading Post (Market)(All)) Equal to True
-
((Picked unit) has an item of type Trade Goods) Equal to False
-
-
Then - Actions
-
Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Items\AIsm\AIsmTarget.mdl
-
Special Effect - Destroy (Last created special effect)
-
Hero - Create Trade Goods and give it to (Picked unit)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) has buff Trading Post (Fortress)(Owner)) Equal to True
-
((Picked unit) has buff Trading Post (Fortress)(Ally)) Equal to False
-
((Picked unit) has an item of type Trade Goods) Equal to True
-
-
Then - Actions
-
Set tempUnitGroup = (Units within 500.00 of (Position of (Picked unit)) matching (((Matching unit) has buff Fortress (All)) Equal to True))
-
Unit - Move (Picked unit) instantly to (Position of (Random unit from tempUnitGroup))
-
Set tempUnitGroup2 = (Units in (Playable map area) matching (((Owner of (Matching unit)) Equal to (Owner of (Picked unit))) and (((Matching unit) has buff Market (All)) Equal to True)))
-
Set tempPoint = (Position of (Random unit from tempUnitGroup2))
-
Set tempPoint2 = (Position of (Picked unit))
-
Set tempReal = (Distance between tempPoint and tempPoint2)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
tempReal Greater than or equal to 11200.00
-
-
Then - Actions
-
Set tempInteger = 100
-
Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Items\AIsm\AIsmTarget.mdl
-
Special Effect - Destroy (Last created special effect)
-
Hero - Drop (Item carried by (Picked unit) of type Trade Goods) from (Picked unit)
-
Item - Remove (Last dropped item)
-
Unit - Order (Picked unit) to Patrol To tempPoint
-
Set tempId = (Player number of (Owner of (Picked unit)))
-
Set OHS_OilResource[tempId] = (OHS_OilResource[tempId] + tempInteger)
-
Floating Text - Create floating text that reads (+ + ((String(tempInteger)) + Gold)) at tempPoint2 with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
-
Set tempFloatingText = (Last created floating text)
-
Floating Text - Set the velocity of tempFloatingText to 64.00 towards 90.00 degrees
-
Floating Text - Change tempFloatingText: Disable permanence
-
Floating Text - Change the lifespan of tempFloatingText to 3.00 seconds
-
Floating Text - Change the fading age of tempFloatingText to 0.01 seconds
-
Custom script: call RemoveLocation (udg_tempPoint)
-
Custom script: call DestroyGroup (udg_tempUnitGroup)
-
Custom script: call RemoveLocation (udg_tempPoint2)
-
Custom script: call DestroyGroup (udg_tempUnitGroup2)
-
-
Else - Actions
-
Set tempInteger = ((Integer(tempReal)) / 500)
-
Set tempInteger = (tempInteger x tempInteger)
-
Set tempInteger = (tempInteger / 5)
-
Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Items\AIsm\AIsmTarget.mdl
-
Special Effect - Destroy (Last created special effect)
-
Hero - Drop (Item carried by (Picked unit) of type Trade Goods) from (Picked unit)
-
Item - Remove (Last dropped item)
-
Unit - Order (Picked unit) to Patrol To tempPoint
-
Set tempId = (Player number of (Owner of (Picked unit)))
-
Set OHS_OilResource[tempId] = (OHS_OilResource[tempId] + tempInteger)
-
Floating Text - Create floating text that reads (+ + ((String(tempInteger)) + Gold)) at tempPoint2 with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
-
Set tempFloatingText = (Last created floating text)
-
Floating Text - Set the velocity of tempFloatingText to 64.00 towards 90.00 degrees
-
Floating Text - Change tempFloatingText: Disable permanence
-
Floating Text - Change the lifespan of tempFloatingText to 3.00 seconds
-
Floating Text - Change the fading age of tempFloatingText to 0.01 seconds
-
Custom script: call RemoveLocation (udg_tempPoint)
-
Custom script: call DestroyGroup (udg_tempUnitGroup)
-
Custom script: call RemoveLocation (udg_tempPoint2)
-
Custom script: call DestroyGroup (udg_tempUnitGroup2)
-
-
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) has buff Trading Post (Fortress)(Ally)) Equal to True
-
((Picked unit) has an item of type Trade Goods) Equal to True
-
-
Then - Actions
-
Set tempUnitGroup = (Units within 500.00 of (Position of (Picked unit)) matching (((Matching unit) has buff Fortress (All)) Equal to True))
-
Unit - Move (Picked unit) instantly to (Position of (Random unit from tempUnitGroup))
-
Set tempUnitGroup2 = (Units in (Playable map area) matching (((Owner of (Matching unit)) Equal to (Owner of (Picked unit))) and (((Matching unit) has buff Market (All)) Equal to True)))
-
Set tempPoint = (Position of (Random unit from tempUnitGroup2))
-
Set tempPoint2 = (Position of (Picked unit))
-
Set tempReal = (Distance between tempPoint and tempPoint2)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
tempReal Greater than or equal to 11200.00
-
-
Then - Actions
-
Set tempInteger = 100
-
Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Items\AIsm\AIsmTarget.mdl
-
Special Effect - Destroy (Last created special effect)
-
Hero - Drop (Item carried by (Picked unit) of type Trade Goods) from (Picked unit)
-
Item - Remove (Last dropped item)
-
Unit - Order (Picked unit) to Patrol To tempPoint
-
Set tempId = (Player number of (Owner of (Picked unit)))
-
Set OHS_OilResource[tempId] = (OHS_OilResource[tempId] + tempInteger)
-
Floating Text - Create floating text that reads (+ + ((String(tempInteger)) + Gold)) at tempPoint2 with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
-
Set tempFloatingText = (Last created floating text)
-
Floating Text - Set the velocity of tempFloatingText to 64.00 towards 90.00 degrees
-
Floating Text - Change tempFloatingText: Disable permanence
-
Floating Text - Change the lifespan of tempFloatingText to 3.00 seconds
-
Floating Text - Change the fading age of tempFloatingText to 0.01 seconds
-
Custom script: call RemoveLocation (udg_tempPoint)
-
Custom script: call DestroyGroup (udg_tempUnitGroup)
-
Custom script: call RemoveLocation (udg_tempPoint2)
-
Custom script: call DestroyGroup (udg_tempUnitGroup2)
-
-
Else - Actions
-
Set tempInteger = ((Integer(tempReal)) / 460)
-
Set tempInteger = (tempInteger x tempInteger)
-
Set tempInteger = (tempInteger / 5)
-
Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Items\AIsm\AIsmTarget.mdl
-
Special Effect - Destroy (Last created special effect)
-
Hero - Drop (Item carried by (Picked unit) of type Trade Goods) from (Picked unit)
-
Item - Remove (Last dropped item)
-
Unit - Order (Picked unit) to Patrol To tempPoint
-
Set tempId = (Player number of (Owner of (Picked unit)))
-
Set OHS_OilResource[tempId] = (OHS_OilResource[tempId] + tempInteger)
-
Floating Text - Create floating text that reads (+ + ((String(tempInteger)) + Gold)) at tempPoint2 with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
-
Set tempFloatingText = (Last created floating text)
-
Floating Text - Set the velocity of tempFloatingText to 64.00 towards 90.00 degrees
-
Floating Text - Change tempFloatingText: Disable permanence
-
Floating Text - Change the lifespan of tempFloatingText to 3.00 seconds
-
Floating Text - Change the fading age of tempFloatingText to 0.01 seconds
-
Custom script: call RemoveLocation (udg_tempPoint)
-
Custom script: call DestroyGroup (udg_tempUnitGroup)
-
Custom script: call RemoveLocation (udg_tempPoint2)
-
Custom script: call DestroyGroup (udg_tempUnitGroup2)
-
-
-
-
Else - Actions
-
-
-
-
-
-
-
-
Custom script: call DestroyGroup (udg_tempUnitGroup3)
-
-
This trigger causes workers with a mining speed upgrade to mine faster. It creates a unit with the bloodlust ability. Based on the workers buff level, it casts differing levels of bloodlust on the worker.
-
Gold Hit
-
Events
-
Unit - A unit Is attacked
-
-
Conditions
-
((Attacking unit) has buff Worker (All)) Equal to True
-
Or - Any (Conditions) are true
-
Conditions
-
(Unit-type of (Triggering unit)) Equal to Gold Ore |cffffd700(1000 Gold)|r (Nature)
-
(Unit-type of (Triggering unit)) Equal to Gold Ore |cffffd700(2000 Gold)|r (Nature)
-
(Unit-type of (Triggering unit)) Equal to Gold Ore |cffffd700(3000 Gold)|r (Nature)
-
-
-
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of Worker (All) for (Attacking unit)) Equal to 1
-
-
Then - Actions
-
Set tempPoint = (Position of (Triggering unit))
-
Unit - Create 1 Nothing Unit for (Owner of (Attacking unit)) at tempPoint facing Default building facing degrees
-
Unit - Add Gold Miner (Nothing Unit) to (Last created unit)
-
Unit - Order (Last created unit) to Orc Shaman - Bloodlust (Attacking unit)
-
Unit - Remove (Last created unit) from the game
-
Special Effect - Create a special effect at tempPoint using UI\Feedback\GoldCredit\GoldCredit.mdl
-
Special Effect - Destroy (Last created special effect)
-
Custom script: call RemoveLocation(udg_tempPoint)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of Worker (All) for (Attacking unit)) Equal to 2
-
-
Then - Actions
-
Set tempPoint = (Position of (Triggering unit))
-
Unit - Create 1 Nothing Unit for (Owner of (Attacking unit)) at tempPoint facing Default building facing degrees
-
Unit - Add Gold Miner (Nothing Unit) to (Last created unit)
-
Unit - Set level of Gold Miner (Nothing Unit) for (Last created unit) to 2
-
Unit - Order (Last created unit) to Orc Shaman - Bloodlust (Attacking unit)
-
Unit - Remove (Last created unit) from the game
-
Special Effect - Create a special effect at tempPoint using UI\Feedback\GoldCredit\GoldCredit.mdl
-
Special Effect - Destroy (Last created special effect)
-
Custom script: call RemoveLocation(udg_tempPoint)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of Worker (All) for (Attacking unit)) Equal to 3
-
-
Then - Actions
-
Set tempPoint = (Position of (Triggering unit))
-
Unit - Create 1 Nothing Unit for (Owner of (Attacking unit)) at tempPoint facing Default building facing degrees
-
Unit - Add Gold Miner (Nothing Unit) to (Last created unit)
-
Unit - Set level of Gold Miner (Nothing Unit) for (Last created unit) to 3
-
Unit - Order (Last created unit) to Orc Shaman - Bloodlust (Attacking unit)
-
Unit - Remove (Last created unit) from the game
-
Special Effect - Create a special effect at tempPoint using UI\Feedback\GoldCredit\GoldCredit.mdl
-
Special Effect - Destroy (Last created special effect)
-
Custom script: call RemoveLocation(udg_tempPoint)
-
-
Else - Actions
-
-
-
-
-
-
-
This trigger causes you to capture nearby pigs. It detects the number of allied units and enemy units around it. If there are more enemy units, it changes ownership to the enemy.
-
Pig Capture
-
Events
-
Time - Every 1.00 seconds of game time
-
-
Conditions
-
Actions
-
Set tempUnitGroup = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Pig |cffff0000(100 Food)|r (Nature)))
-
Unit Group - Pick every unit in tempUnitGroup and do (Actions)
-
Loop - Actions
-
Set tempUnitGroup2 = (Units within 800.00 of (Position of (Picked unit)) matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) has buff Animal (All)) Equal to False) and (((Unit-type of (Matching unit))
-
Set tempUnitGroup3 = (Units within 800.00 of (Position of (Picked unit)) matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) has buff Animal (All)) Equal to False) and (((Unit-type of (Matching unit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in tempUnitGroup2) Greater than (Number of units in tempUnitGroup3)
-
-
Then - Actions
-
Unit - Change ownership of (Picked unit) to (Owner of (Random unit from tempUnitGroup2)) and Change color
-
Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Other\Charm\CharmTarget.mdl
-
Special Effect - Destroy (Last created special effect)
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in tempUnitGroup3) Greater than (Number of units in tempUnitGroup2)
-
-
Then - Actions
-
Else - Actions
-
-
-
-
Custom script: call DestroyGroup (udg_tempUnitGroup2)
-
Custom script: call DestroyGroup (udg_tempUnitGroup3)
-
-
-
Custom script: call DestroyGroup (udg_tempUnitGroup)
-
-