MP®
Member
- Reaction score
- 11
Ok I made a trigger with a few 'If-then-else' actions.
Now if certain conditions are right, a unit is being replaced. Now I want this replaced unit to be paused, wait 1 second and then unpause again.
So I make a custom script (after replacing the unit) to make the replaced unit a local variable. But this doesn't seem to work.. Looks like you can only local units at the start of a trigger or something? Or how does that work? How can I do this?
this is the trigger, its not finished yet there are also some other things that I have to fix, but now just look only to the thing with the 'local unit r':
Now if certain conditions are right, a unit is being replaced. Now I want this replaced unit to be paused, wait 1 second and then unpause again.
So I make a custom script (after replacing the unit) to make the replaced unit a local variable. But this doesn't seem to work.. Looks like you can only local units at the start of a trigger or something? Or how does that work? How can I do this?
this is the trigger, its not finished yet there are also some other things that I have to fix, but now just look only to the thing with the 'local unit r':
Trigger:
- Click door
- Events
- Unit - A unit Is issued an order targeting an object
- Conditions
- ((Triggering unit) is A Hero) Equal to True
- ((Target unit of issued order) is paused) Not equal to True
- Or - Any (Conditions) are true
- Conditions
- (Issued order) Equal to (Order(smart))
- (Issued order) Equal to (Order(thunderbolt))
- Conditions
- Or - Any (Conditions) are true
- Conditions
- (Unit-type of (Target unit of issued order)) Equal to Doors (Open)
- (Unit-type of (Target unit of issued order)) Equal to Doors (Closed)
- Conditions
- Actions
- Custom script: local unit u = GetOrderTargetUnit()
- Set Temp_Point = (Position of (Triggering unit))
- Set Temp_Point2 = (Position of (Target unit of issued order))
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Distance between Temp_Point and Temp_Point2) Less than or equal to 250.00
- Then - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Player number of (Owner of (Triggering unit))) Less than 6
- Then - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Target unit of issued order) has buff Unlocked ) Equal to True
- Then - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of (Target unit of issued order)) Equal to Doors (Closed)
- Then - Actions
- Unit - Replace (Target unit of issued order) with a Doors (Open) using The old unit's relative life and mana
- Unit - Pause (Last replaced unit)
- Custom script: local unit r = GetLastReplacedUnitBJ()
- Custom script: set udg_Doors = r
- Animation - Play (Last replaced unit)'s death alternate animation
- Unit - Create 1 Activate Dummy for Neutral Extra at Temp_Point2 facing Default building facing degrees
- Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
- Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Last replaced unit)
- Wait 1.00 game-time seconds
- Unit - Unpause Doors
- Custom script: set r = null
- Else - Actions
- Unit - Pause (Target unit of issued order)
- Custom script: set udg_Doors = u
- Set Temp_Point3 = (Position of (Target unit of issued order))
- Animation - Play (Target unit of issued order)'s birth animation
- Wait 1.00 game-time seconds
- Unit - Replace Doors with a Doors (Closed) using The old unit's relative life and mana
- Unit - Create 1 Activate Dummy for Neutral Extra at Temp_Point3 facing Default building facing degrees
- Custom script: call RemoveLocation (udg_Temp_Point3)
- Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
- Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Last replaced unit)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of (Target unit of issued order)) Equal to Doors (Closed)
- Then - Actions
- Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffff0000Doors loc...
- Else - Actions
- Unit - Pause (Target unit of issued order)
- Custom script: set udg_Doors = u
- Set Temp_Point3 = (Position of (Target unit of issued order))
- Animation - Play (Target unit of issued order)'s birth animation
- Wait 1.00 game-time seconds
- Unit - Replace Doors with a Doors (Closed) using The old unit's relative life and mana
- Unit - Create 1 Activate Dummy for Neutral Extra at Temp_Point3 facing Default building facing degrees
- Custom script: call RemoveLocation (udg_Temp_Point3)
- Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
- Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Last replaced unit)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of (Target unit of issued order)) Equal to Doors (Closed)
- Then - Actions
- Unit - Replace (Target unit of issued order) with a Doors (Open) using The old unit's relative life and mana
- Unit - Pause (Last replaced unit)
- Custom script: local unit r = GetLastReplacedUnitBJ()
- Custom script: set udg_Doors = r
- Animation - Play (Last replaced unit)'s death alternate animation
- Unit - Create 1 Activate Dummy for Neutral Extra at Temp_Point2 facing Default building facing degrees
- Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
- Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Last replaced unit)
- Wait 1.00 game-time seconds
- Unit - Unpause Doors
- Custom script: set r = null
- Else - Actions
- Unit - Pause (Target unit of issued order)
- Custom script: set udg_Doors = u
- Animation - Play (Target unit of issued order)'s birth animation
- Wait 1.00 game-time seconds
- Unit - Replace Doors with a Doors (Closed) using The old unit's relative life and mana
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- If - Conditions
- Custom script: call RemoveLocation (udg_Temp_Point)
- Custom script: call RemoveLocation (udg_Temp_Point2)
- Custom script: set u = null
- Events