• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Spell] Keep animation while moving AND don't change direction

Status
Not open for further replies.
Level 12
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:

  • 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:
Level 12
Joined
May 16, 2020
Messages
660
Thanks - added a pause function. However... after unpausing the caster the unit is kinda bugged. It is unpaused, but is stuck in the same place and uses the last animation over and over again. It is also no longer able to cast any abilities. I had this problem several times actually, so interested what causes this.
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
You can't use walk animation via SetUnitAnimation and it's pointless to play a looping animation per periodic.
SetUnitAnimationByIndex is reliable for that though. I've also noticed your unpausing the caster which isn't paused in the first place.
Keep in mind that you also have to reset the unit's animation (which is stand) when finished.

I don't understand why you're having an empty condition in your main if-else block inside the skewer loop by the way.
 
Level 12
Joined
May 16, 2020
Messages
660
You can't use walk animation via SetUnitAnimation and it's pointless to play a looping animation per periodic.
SetUnitAnimationByIndex is reliable for that though. I've also noticed your unpausing the caster which isn't paused in the first place.
Keep in mind that you also have to reset the unit's animation (which is stand) when finished.

I don't understand why you're having an empty condition in your main if-else block inside the skewer loop by the way.

Oh man, didn't notice at all that the condition was empty (and not needed). Now the trigger is a lot shorter, and part of it works! But still some bugs:

1) After the spell ends, the unit is stuck in an animation loop. I can't move it nor order it to use abilities. When I remove (un-)pause this doesn't happen, so it's tied to the pause
2) The effect Special Effect - Create a special effect at Skewer_Point[1] using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl isn't working for some reason... BUT, it seems like this is related to reforged graphics! In classic graphics at least this gets fixed

  • 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, 3)
      • 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
      • 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)
      • 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
          • 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
 
Last edited:
Level 20
Joined
Aug 13, 2013
Messages
1,696
1) After the spell ends, the unit is stuck in an animation loop. I can't move it nor order it to use abilities. When I remove (un-)pause this doesn't happen, so it's tied to the pause
After it ends, you're playing another animation to the caster which overwrites the animation
you've just created using SetUnitAnimationByIndex and gets stucked because of the unpause function.
To properly finish it, you might unpause the caster first then execute the animation right after it.
 
Level 12
Joined
May 16, 2020
Messages
660
After it ends, you're playing another animation to the caster which overwrites the animation
you've just created using SetUnitAnimationByIndex and gets stucked because of the unpause function.
To properly finish it, you might unpause the caster first then execute the animation right after it.

I seriously don't know what's wrong. I built it now like another ability with a very similar structure. The other ability doesn't leave the hero "stuck", while the current one does.

WORKS:

  • Time Walk
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Time Walk
    • Actions
      • Set VariableSet TimeWalk_Caster = (Casting unit)
      • Set VariableSet TimeWalk_CasterLoc = (Position of TimeWalk_Caster)
      • Set VariableSet TimeWalk_TargetPoint = (Target point of ability being cast)
      • Set VariableSet TimeWalk_Angle = (Angle from TimeWalk_CasterLoc to TimeWalk_TargetPoint)
      • Set VariableSet TimeWalk_MaxDistance = (Distance between TimeWalk_CasterLoc and TimeWalk_TargetPoint)
      • Set VariableSet TimeWalk_DistanceTraveled = 0.00
      • Unit - Turn collision for TimeWalk_Caster Off.
      • Unit - Make TimeWalk_Caster Invulnerable
      • Unit - Pause TimeWalk_Caster
      • Animation - Change TimeWalk_Caster's vertex coloring to (0.00%, 0.00%, 0.00%) with 25.00% transparency
      • Unit - Create 1 Faceless Void (Time Walk Trail) for (Owner of TimeWalk_Caster) at TimeWalk_CasterLoc facing TimeWalk_Angle degrees
      • Set VariableSet TimeWalk_CasterTrailUnits[1] = (Last created unit)
      • Animation - Change TimeWalk_CasterTrailUnits[1]'s vertex coloring to (0.00%, 0.00%, 0.00%) with 35.00% transparency
      • Unit - Create 1 Faceless Void (Time Walk Trail) for (Owner of TimeWalk_Caster) at TimeWalk_CasterLoc facing TimeWalk_Angle degrees
      • Set VariableSet TimeWalk_CasterTrailUnits[2] = (Last created unit)
      • Animation - Change TimeWalk_CasterTrailUnits[2]'s vertex coloring to (0.00%, 0.00%, 0.00%) with 45.00% transparency
      • Unit - Create 1 Faceless Void (Time Walk Trail) for (Owner of TimeWalk_Caster) at TimeWalk_CasterLoc facing TimeWalk_Angle degrees
      • Set VariableSet TimeWalk_CasterTrailUnits[3] = (Last created unit)
      • Animation - Change TimeWalk_CasterTrailUnits[3]'s vertex coloring to (0.00%, 0.00%, 0.00%) with 55.00% transparency
      • Custom script: set udg_TimeWalk_Damaged = CreateGroup()
      • Trigger - Turn on Time Walk Loop <gen>
      • Custom script: call RemoveLocation (udg_TimeWalk_CasterLoc)
      • Custom script: call RemoveLocation (udg_TimeWalk_TargetPoint)

  • Time Walk 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
          • TimeWalk_DistanceTraveled Less than TimeWalk_MaxDistance
        • Then - Actions
          • Set VariableSet TimeWalk_UnitPoint[0] = (Position of TimeWalk_Caster)
          • Set VariableSet TimeWalk_UnitPoint[1] = (Position of TimeWalk_CasterTrailUnits[1])
          • Set VariableSet TimeWalk_UnitPoint[2] = (Position of TimeWalk_CasterTrailUnits[2])
          • Set VariableSet TimeWalk_UnitPoint[3] = (Position of TimeWalk_CasterTrailUnits[3])
          • Set VariableSet TimeWalk_TravelPoint[0] = (TimeWalk_UnitPoint[0] offset by 75.00 towards TimeWalk_Angle degrees.)
          • Set VariableSet TimeWalk_TravelPoint[1] = (TimeWalk_UnitPoint[1] offset by 70.00 towards TimeWalk_Angle degrees.)
          • Set VariableSet TimeWalk_TravelPoint[2] = (TimeWalk_UnitPoint[2] offset by 65.00 towards TimeWalk_Angle degrees.)
          • Set VariableSet TimeWalk_TravelPoint[3] = (TimeWalk_UnitPoint[3] offset by 60.00 towards TimeWalk_Angle degrees.)
          • Unit - Move TimeWalk_Caster instantly to TimeWalk_TravelPoint[0]
          • Unit - Move TimeWalk_CasterTrailUnits[1] instantly to TimeWalk_TravelPoint[1]
          • Unit - Move TimeWalk_CasterTrailUnits[2] instantly to TimeWalk_TravelPoint[2]
          • Unit - Move TimeWalk_CasterTrailUnits[3] instantly to TimeWalk_TravelPoint[3]
          • Set VariableSet TimeWalk_DistanceTraveled = (TimeWalk_DistanceTraveled + 75.00)
          • Set VariableSet TimeWalk_UnitGroup = (Units within 100.00 of TimeWalk_TravelPoint[0].)
          • Unit Group - Pick every unit in TimeWalk_UnitGroup and do (Actions)
            • Loop - Actions
              • Set VariableSet TimeWalk_TempUnit = (Picked unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (TimeWalk_TempUnit is A structure) Equal to False
                  • (TimeWalk_TempUnit is alive) Equal to True
                  • (TimeWalk_TempUnit belongs to an enemy of (Owner of TimeWalk_Caster).) Equal to True
                  • (TimeWalk_TempUnit is in TimeWalk_Damaged.) Equal to False
                • Then - Actions
                  • Unit Group - Add (Picked unit) to TimeWalk_Damaged
                  • Unit - Cause TimeWalk_Caster to damage (Picked unit), dealing (50.00 + (25.00 x (Real((Level of Time Walk for TimeWalk_Caster))))) damage of attack type Magic and damage type Normal
                  • Special Effect - Create a special effect attached to the chest of (Picked unit) using war3mapImported\Void Rift Purple.mdx
                  • Special Effect - Destroy (Last created special effect)
                • Else - Actions
        • Else - Actions
          • Set VariableSet TimeWalk_UnitPoint[0] = (Position of TimeWalk_Caster)
          • Unit - Create 1 Dummy (With 0 attack) for (Owner of TimeWalk_Caster) at TimeWalk_UnitPoint[0] facing Default building facing degrees
          • Unit - Add Time Walk (Slow) to (Last created unit)
          • Unit - Set level of Time Walk (Slow) for (Last created unit) to (Level of Time Walk for TimeWalk_Caster)
          • Unit - Order (Last created unit) to Human Mountain King - Thunder Clap.
          • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
          • Unit - Turn collision for TimeWalk_Caster On.
          • Unit - Make TimeWalk_Caster Vulnerable
          • Unit - Unpause TimeWalk_Caster
          • Animation - Change TimeWalk_Caster's vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
          • Unit - Remove TimeWalk_CasterTrailUnits[1] from the game
          • Unit - Remove TimeWalk_CasterTrailUnits[2] from the game
          • Unit - Remove TimeWalk_CasterTrailUnits[3] from the game
          • Custom script: call DestroyGroup(udg_TimeWalk_Damaged)
          • Trigger - Turn off (This trigger)
      • Custom script: call RemoveLocation(udg_TimeWalk_UnitPoint[0])
      • Custom script: call RemoveLocation(udg_TimeWalk_UnitPoint[1])
      • Custom script: call RemoveLocation(udg_TimeWalk_UnitPoint[2])
      • Custom script: call RemoveLocation(udg_TimeWalk_UnitPoint[3])
      • Custom script: call RemoveLocation(udg_TimeWalk_TravelPoint[0])
      • Custom script: call RemoveLocation(udg_TimeWalk_TravelPoint[1])
      • Custom script: call RemoveLocation(udg_TimeWalk_TravelPoint[2])
      • Custom script: call RemoveLocation(udg_TimeWalk_TravelPoint[3])
      • Custom script: call DestroyGroup (udg_TimeWalk_UnitGroup)


DOES NOT WORK:

  • 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 - Make Skewer_Caster Invulnerable
      • Unit - Pause Skewer_Caster
      • Animation - Change Skewer_Caster's animation speed to 200.00% of its original speed
      • Special Effect - Create a special effect attached to the chest of Skewer_Caster using war3mapImported\Valiant Charge Holy.mdx
      • Set VariableSet Skewer_Effect = (Last created special effect)
      • Custom script: call SetUnitAnimationByIndex(udg_Skewer_Caster, 3)
      • Custom script: set udg_Skewer_Damaged = CreateGroup()
      • Trigger - Turn on Skewer Loop <gen>
      • Custom script: call RemoveLocation (udg_Skewer_Caster_Loc)
      • Custom script: call RemoveLocation (udg_Skewer_Target_Point)


  • 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
          • Skewer_Distance_Moved Less than Skewer_MaxDistance
        • Then - Actions
          • Set VariableSet Skewer_Point[1] = (Position of Skewer_Caster)
          • Set VariableSet Skewer_Point[2] = (Skewer_Point[1] offset by 45.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\Spells\Other\Stampede\StampedeMissileDeath.mdl
          • Special Effect - Destroy (Last created special effect)
          • 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 + 45.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
        • Else - Actions
          • Destructible - Pick every destructible within 300.00 of Skewer_Point[2] and do (Destructible - Kill (Picked destructible))
          • Unit - Turn collision for Skewer_Caster On.
          • Unit - Make Skewer_Caster Vulnerable
          • Unit - Unpause Skewer_Caster
          • Animation - Change Skewer_Caster's animation speed to 100.00% of its original speed
          • Special Effect - Destroy Skewer_Effect
          • Animation - Play Skewer_Caster's slam animation
          • Custom script: call DestroyGroup (udg_Skewer_Damaged)
          • Trigger - Turn off (This trigger)
      • Custom script: call RemoveLocation (udg_Skewer_Point[1])
      • Custom script: call RemoveLocation (udg_Skewer_Point[2])
      • Custom script: call DestroyGroup (udg_Skewer_UnitGroup)


Edit: Added /spoiler to the other trigger sections to keep this page small.
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
Can you remove all the animation functions you're using on the skewer script?
And be specific on what "stuck" behavior? Is the command card blacked out after it finishes? Or something?
Also, are they based off the same ability? If this is a channel ability make sure the 'Visible' flag is ticked.

Other than that, I see no reason why time walk doesn't stuck the hero while skewer does as they're just scripted the same.
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
The script works while there's something that re-orders the caster to cast the ability repeatedly on the same target location.
Can you at least put a short cooldown on the ability. That behavior is strange. Make sure there's no trigger that conflicts with it.
 
Level 12
Joined
May 16, 2020
Messages
660
So.. I rewrote it from scratch and the problem was this:

  • Custom script: call SetUnitX( udg_Skewer_Caster, GetLocationX( udg_Skewer_Point[2] ) )
  • Custom script: call SetUnitY( udg_Skewer_Caster, GetLocationY( udg_Skewer_Point[2] ) )
If I change this to the normal Unit - Move Skewer_Caster instantly to Skewer_Point[2] everything works... go figure :S
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
That doesn't makes sense to be honest.

It contradicts to the logic that SetUnitX/Y doesn't interrupt unit's actions while SetUnitPosition does. (which is 'Move - Instantly' function in GUI)

I've been using SetUnitX/Y native without this kind of problem throughout the years so I'm thinking that it has something to do with the ability setup or just a glitch made by unknown.

It's less suspicious to be a problem seriously.

I highly suggest you to go further some tests, it might be something else.
As it's also important to know what causes the problem than what fixes the
problem, believing that SetUnitX/Y causes the problem is doubting because
It's never been a problem before. And I don't want you to believe that either.

EDIT:

However, if that fixes the problem then glad you resolved it.
 
Last edited:
Level 20
Joined
Aug 13, 2013
Messages
1,696
I would try another spell that uses SetUnitX/Y function if I were you.
Why not try out some dash or sprint spells in the resource section?

This would perfected your claim that it's the only reason.

Reproduce this kind of bug in their own demo maps, not yours so
that we can isolate the problem that is something within your map.

If this persists even with them, then the problem lies on your end
or resulted by the patch recently IF someone can claim this problem too.
It would forfeit the use of that function in that case until developers fix.

For me, your case shouldn't be closed yet. But your call.
 
Status
Not open for further replies.
Top