- Joined
- May 16, 2020
- Messages
- 660
Hi guys
I'm trying to make a loop that moves the hero from point A to B, while keeping him in a "walk fast" animation and not "turn around" when enemies are near. For some reasons my trigger is not working however as I want it to: The hero just stands still (even though I use setUnitX and setUnitY) and keeps turning when enemies are near. Also, the special effect on the Point[2] does not appear.
These are the triggers I have so far:
The spell is based on what you see here:
Can anyone help please?
I'm trying to make a loop that moves the hero from point A to B, while keeping him in a "walk fast" animation and not "turn around" when enemies are near. For some reasons my trigger is not working however as I want it to: The hero just stands still (even though I use setUnitX and setUnitY) and keeps turning when enemies are near. Also, the special effect on the Point[2] does not appear.
These are the triggers I have so far:
-
Skewer
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Skewer
-
-
Actions
-
Set VariableSet Skewer_Caster = (Triggering unit)
-
Set VariableSet Skewer_Caster_Loc = (Position of Skewer_Caster)
-
Set VariableSet Skewer_Target_Point = (Target point of ability being cast)
-
Set VariableSet Skewer_Angle = (Angle from Skewer_Caster_Loc to Skewer_Target_Point)
-
Set VariableSet Skewer_MaxDistance = (600.00 + (150.00 x (Real((Level of Skewer for Skewer_Caster)))))
-
Set VariableSet Skewer_Distance_Moved = 0.00
-
Set VariableSet Skewer_ActualDistance = (Distance between Skewer_Caster_Loc and Skewer_Target_Point)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Skewer_ActualDistance Less than or equal to Skewer_MaxDistance
-
-
Then - Actions
-
Set VariableSet Skewer_MaxDistance = Skewer_ActualDistance
-
-
Else - Actions
-
-
Unit - Turn collision for Skewer_Caster Off.
-
Unit - Pause Skewer_Caster
-
Custom script: call SetUnitAnimationByIndex(udg_Skewer_Caster, 4)
-
Custom script: set udg_Skewer_Damaged = CreateGroup()
-
Trigger - Turn on Skewer Loop <gen>
-
-
-
Skewer Loop
-
Events
-
Time - Every 0.03 seconds of game time
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Then - Actions
-
Set VariableSet Skewer_Point[1] = (Position of Skewer_Caster)
-
Set VariableSet Skewer_Point[2] = (Skewer_Point[1] offset by 30.00 towards Skewer_Angle degrees.)
-
Custom script: call SetUnitX( udg_Skewer_Caster, GetLocationX( udg_Skewer_Point[2] ) )
-
Custom script: call SetUnitY( udg_Skewer_Caster, GetLocationY( udg_Skewer_Point[2] ) )
-
Special Effect - Create a special effect at Skewer_Point[1] using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
-
Special Effect - Destroy (Last created special effect)
-
Animation - Play Skewer_Caster's walk fast animation
-
Unit Group - Pick every unit in Skewer_Damaged and do (Actions)
-
Loop - Actions
-
Unit - Move (Picked unit) instantly to (Skewer_Point[2] offset by 100.00 towards Skewer_Angle degrees.)
-
-
-
Set VariableSet Skewer_Distance_Moved = (Skewer_Distance_Moved + 30.00)
-
Set VariableSet Skewer_UnitGroup = (Units within 125.00 of Skewer_Point[2].)
-
Unit Group - Pick every unit in Skewer_UnitGroup and do (Actions)
-
Loop - Actions
-
Set VariableSet Skewer_TempUnit = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Skewer_TempUnit is A structure) Equal to False
-
(Skewer_TempUnit is A Hero) Equal to True
-
(Skewer_TempUnit is alive) Equal to True
-
(Skewer_TempUnit belongs to an enemy of (Owner of Skewer_Caster).) Equal to True
-
(Skewer_TempUnit is in Skewer_Damaged.) Equal to False
-
-
Then - Actions
-
Unit Group - Add (Picked unit) to Skewer_Damaged
-
Special Effect - Create a special effect attached to the origin of (Picked unit) using Objects\Spawnmodels\Undead\UndeadBlood\UndeadBloodAbomination.mdl
-
Special Effect - Destroy (Last created special effect)
-
Unit - Cause Skewer_Caster to damage (Picked unit), dealing (70.00 x (Real((Level of Skewer for Skewer_Caster)))) damage of attack type Spells and damage type Magic
-
-
Else - Actions
-
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Skewer_Distance_Moved Greater than or equal to Skewer_MaxDistance
-
-
Then - Actions
-
Destructible - Pick every destructible within 300.00 of Skewer_Point[2] and do (Destructible - Kill (Picked destructible))
-
Animation - Play Skewer_Caster's spell slam animation
-
Animation - Change Skewer_Caster's animation speed to 100.00% of its original speed
-
Unit - Turn collision for Skewer_Caster On.
-
Unit - Unpause Skewer_Caster
-
Custom script: call RemoveLocation (udg_Skewer_Point[1])
-
Custom script: call RemoveLocation (udg_Skewer_Point[2])
-
Custom script: call DestroyGroup (udg_Skewer_UnitGroup)
-
Custom script: call DestroyGroup (udg_Skewer_Damaged)
-
Custom script: call RemoveLocation (udg_Skewer_Caster_Loc)
-
Custom script: call RemoveLocation (udg_Skewer_Target_Point)
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
-
Custom script: call RemoveLocation (udg_Skewer_Point[1])
-
Custom script: call RemoveLocation (udg_Skewer_Point[2])
-
Custom script: call DestroyGroup (udg_Skewer_UnitGroup)
-
-
Else - Actions
-
Destructible - Pick every destructible within 300.00 of Skewer_Point[2] and do (Destructible - Kill (Picked destructible))
-
Animation - Play Skewer_Caster's spell slam animation
-
Unit - Turn collision for Skewer_Caster On.
-
Unit - Unpause Skewer_Caster
-
Custom script: call RemoveLocation (udg_Skewer_Point[1])
-
Custom script: call RemoveLocation (udg_Skewer_Point[2])
-
Custom script: call DestroyGroup (udg_Skewer_UnitGroup)
-
Custom script: call DestroyGroup (udg_Skewer_Damaged)
-
Custom script: call RemoveLocation (udg_Skewer_Caster_Loc)
-
Custom script: call RemoveLocation (udg_Skewer_Target_Point)
-
Trigger - Turn off (This trigger)
-
-
-
-
The spell is based on what you see here:
Can anyone help please?
Last edited: