- Joined
- Sep 25, 2013
- Messages
- 717
Hi there, I have been told that using such references as casting unit, attacking unit, dying unit, etc in triggers is slow. Some people have said use triggering unit instead, but they also said you can't use it in all cases. I want to know in what cases is triggering unit good to use. Here are a few example triggers from my map.
Also, some other people have said to make a variable for the reference such as picked unit and then use that variable in those instances instead of individually selecting picked unit for every action.
If i fix these things, how much would this reduce map lag?
Also, some other people have said to make a variable for the reference such as picked unit and then use that variable in those instances instead of individually selecting picked unit for every action.
If i fix these things, how much would this reduce map lag?
-
Siege Tower Unload
-
Events
-
Unit - A unit Is loaded into a transport
-
-
Conditions
-
(Unit-type of (Transporting unit)) Equal to Siege Tower (All)(Immobile)
-
-
Actions
-
Set tempPoint = (Position of (Transporting unit))
-
Unit - Order (Transporting unit) to Unload All At (tempPoint offset by 500.00 towards (Facing of (Transporting unit)) degrees)
-
Animation - Play (Transporting unit)'s morph animation
-
Custom script: call RemoveLocation(udg_tempPoint)
-
-
-
Ent of Fangorn Writhing Roots
-
Events
-
Unit - A unit Is attacked
-
-
Conditions
-
(Unit-type of (Attacked unit)) Equal to Ent of Fangorn |c00FFFF00(Elite)|r (Elves)
-
-
Actions
-
Set EntanglingRoots = (Random integer number between 1 and 10)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
And - All (Conditions) are true
-
Conditions
-
EntanglingRoots Equal to 1
-
(Distance between (Position of (Attacked unit)) and (Position of (Attacking unit))) Less than or equal to 350.00
-
((Attacking unit) belongs to an enemy of (Owner of (Attacked unit))) Equal to True
-
((Attacking unit) is A structure) Equal to False
-
((Attacking unit) is Mechanical) Equal to False
-
((Attacking unit) is A Hero) Equal to False
-
-
-
-
Then - Actions
-
Special Effect - Create a special effect attached to the origin of (Attacking unit) using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
-
Special Effect - Destroy (Last created special effect)
-
Special Effect - Create a special effect attached to the origin of (Attacking unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
-
Special Effect - Destroy (Last created special effect)
-
Set tempPoint = (Position of (Attacking unit))
-
Unit - Create 1 Elite Effect Unit for (Owner of (Attacked unit)) at tempPoint facing Default building facing degrees
-
Custom script: call RemoveLocation (udg_tempPoint)
-
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
-
Unit - Order (Last created unit) to Night Elf Keeper Of The Grove - Entangling Roots (Attacking unit)
-
-
Else - Actions
-
-
-