• 🏆 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] Animation wont play Help pls

Status
Not open for further replies.
Level 8
Joined
Nov 9, 2011
Messages
326
so here is the code and it should play the slam animation from the blademaster but it just slides on the ground.

  • Frost Leap Variables
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set FL_Ability = Frost Leap
      • Set FL_AttackPowerPercentage = 0.45
      • Set FL_Counter_Max = 15.00
      • Set FL_Damage[1] = 60.00
      • Set FL_Damage[3] = 90.00
      • Set FL_Damage[3] = 120.00
      • Set FL_Damage[4] = 180.00
      • Set FL_Damage[5] = 210.00
      • Set FL_Damage[6] = 240.00
      • Set FL_Tick = 0.05
      • Set FL_MoveSpeed = 30.00
      • Set FL_AoE = 400.00
      • Set FL_Animation = slam
      • Trigger - Add to Frost Leap Loop <gen> the event (Time - Every (Real(FL_Tick)) seconds of game time)


  • Frost Leap
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to FL_Ability
    • Actions
      • Set FL_Index = (FL_Index + 1)
      • Set FL_Caster[FL_Index] = (Triggering unit)
      • Set FL_Counter[FL_Index] = 0.00
      • Set FL_Level[FL_Index] = (Level of FL_Ability for FL_Caster[FL_Index])
      • Set tempPoint = (Position of FL_Caster[FL_Index])
      • Set tempPoint2 = (Target point of ability being cast)
      • Set FL_Player[FL_Index] = (Triggering player)
      • Set FL_Angle[FL_Index] = (Angle from tempPoint to tempPoint2)
      • Custom script: call RemoveLocation (udg_tempPoint)
      • Custom script: call RemoveLocation (udg_tempPoint2)
      • Unit - Add Storm Crow Form to FL_Caster[FL_Index]
      • Unit - Remove Storm Crow Form from FL_Caster[FL_Index]
      • Unit - Turn collision for FL_Caster[FL_Index] Off
      • Animation - Play FL_Caster[FL_Index]'s FL_Animation animation
      • Unit - Pause FL_Caster[FL_Index]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • FL_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on Frost Leap Loop <gen>
        • Else - Actions


  • Frost Leap Loop
    • Events
    • Conditions
    • Actions
      • For each (Integer tempInt) from 1 to FL_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • FL_Counter[tempInt] Less than FL_Counter_Max
            • Then - Actions
              • Set tempPoint = (Position of FL_Caster[tempInt])
              • Set tempPoint2 = (tempPoint offset by FL_MoveSpeed towards FL_Angle[tempInt] degrees)
              • Set FL_Counter[tempInt] = (FL_Counter[tempInt] + 1.00)
              • Unit - Move FL_Caster[tempInt] instantly to tempPoint2, facing FL_Angle[tempInt] degrees
              • Custom script: call RemoveLocation (udg_tempPoint)
              • Custom script: call RemoveLocation (udg_tempPoint2)
            • Else - Actions
              • Unit - Unpause FL_Caster[tempInt]
              • Unit - Turn collision for FL_Caster[tempInt] On
              • Set tempPoint = (Position of FL_Caster[tempInt])
              • Set tempGroup = (Units within FL_AoE of tempPoint)
              • Custom script: call RemoveLocation (udg_tempPoint)
              • Unit Group - Pick every unit in tempGroup and do (Actions)
                • Loop - Actions
                  • Set tempUnit = (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (tempUnit is alive) Equal to True
                      • (tempUnit belongs to an enemy of (Owner of FL_Caster[tempInt])) Equal to True
                      • (tempUnit is A structure) Equal to False
                      • (tempUnit is Mechanical) Equal to False
                      • (tempUnit is Magic Immune) Equal to False
                    • Then - Actions
                      • Unit - Cause FL_Caster[tempInt] to damage tempUnit, dealing (FL_Damage[FL_Level[tempInt]] + (Player_AttackPower[(Player number of FL_Player[tempInt])] x FL_AttackPowerPercentage)) damage of attack type Hero and damage type Normal
                      • Set tempUnit = No unit
                    • Else - Actions
                      • Set tempUnit = No unit
              • Custom script: call DestroyGroup (udg_tempGroup)
              • Set FL_Caster[tempInt] = FL_Caster[FL_Index]
              • Set FL_Counter[tempInt] = FL_Counter[FL_Index]
              • Set FL_Level[tempInt] = FL_Level[FL_Index]
              • Set FL_Player[tempInt] = FL_Player[FL_Index]
              • Set FL_Caster[FL_Index] = No unit
              • Set FL_Index = (FL_Index - 1)
              • Set tempInt = (tempInt - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • FL_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions


Oh and dont mind the coding im sure its not good i am just rly bothered by the fact that animation wont play.
 
It is because you are using "Unit - Move instantly to Point". That function does three things:
(1) Checks if the destination is pathable. If it isn't pathable, it'll choose a nearby pathable point.
(2) Orders the unit to "Stop" (this interrupts animations)
(3) Moves the unit to the target location.

The (2) part is what messes up your animation. The fix is to use JASS with SetUnitX and SetUnitY. The drawback with those two functions is that they don't check pathing. So you'll need to use a system to check for pathing (otherwise your unit might run through walls, destructables, water, etc.) Here is one: Check Walkability.

The other issue is that the unit will be able to have orders while he is being moved, and that can bug some things out. You may want to consider pausing him (that has its own issues, but at least it will allow the animation) or stunning him for the duration of the movement.
 
Level 8
Joined
Nov 9, 2011
Messages
326
It is because you are using "Unit - Move instantly to Point". That function does three things:
(1) Checks if the destination is pathable. If it isn't pathable, it'll choose a nearby pathable point.
(2) Orders the unit to "Stop" (this interrupts animations)
(3) Moves the unit to the target location.

The (2) part is what messes up your animation. The fix is to use JASS with SetUnitX and SetUnitY. The drawback with those two functions is that they don't check pathing. So you'll need to use a system to check for pathing (otherwise your unit might run through walls, destructables, water, etc.) Here is one: Check Walkability.

The other issue is that the unit will be able to have orders while he is being moved, and that can bug some things out. You may want to consider pausing him (that has its own issues, but at least it will allow the animation) or stunning him for the duration of the movement.
wow that explanation ty man but im noob with setunitx,y ill try my best
Have you tried not using triggers and just put attack slam or slam in the Art - Animation Names in the ability located at Object Editor?
Did not work
 
Status
Not open for further replies.
Top