• 🏆 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] spell animation

Status
Not open for further replies.
Level 19
Joined
Apr 21, 2013
Messages
1,194
I have a triggered spell and while the unit casts this spell I want him to play a specific animation.

  • Oblitorate Execution
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Obliterate
    • Actions
      • Set Oblitorate1Index = (Oblitorate1Index + 1)
      • Set Oblitorate1Target[Oblitorate1Index] = (Target unit of ability being cast)
      • Set Oblitorate1_counter[Oblitorate1Index] = 0
      • Unit - Cause (Triggering unit) to damage Oblitorate1Target[Oblitorate1Index], dealing 144.00 damage of attack type Pierce and damage type Normal
      • Custom script: call SetUnitAnimationByIndex( GetTriggerUnit(), 30)
      • Special Effect - Create a special effect attached to the chest of Oblitorate1Target[Oblitorate1Index] using Objects\Spawnmodels\Orc\Orcblood\BattrollBlood.mdl
      • Special Effect - Destroy (Last created special effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Oblitorate1Index Equal to 1
        • Then - Actions
          • Trigger - Turn on Oblitorate Bleed Loop <gen>
        • Else - Actions
so normally the custom script should call the animation but during game the unit tries to start the animation but he suddenly stops in a few miliseconds.

Is there any solutions you guys know?
 
Level 19
Joined
Apr 21, 2013
Messages
1,194
It's because the unit start to play another animation you'd have to disable other action during the abilty to play the animation full.Also try to tweak the cast point and cast backswing in unit editor.And you could simply use the animation tag in ability editor.

if i change the backswing and point to 0 will the unit play the animation so fast?

I dont know the backswing and cast point actually :(
 
Backswing and cast point is used for when in the unit's animation damage is dealt or when a ability's effect will take place.

Primarily cast point.
It is tweaked for every unit so damage/spell effect will trigger when fx. a Footman's sword would hit the target.

Though it is not necessary to tweak here since you want a specific animation to be played thus you call it.

For further issues with backswing/cast point you can click on a model so it appears in the little preview window on the left.
Watch the Attack/Spell animation and calculate the cast point from there.
 
Level 19
Joined
Apr 21, 2013
Messages
1,194
this is a bit more complicated than the first spell but its the same way so far.

  • PA Execution
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to PA_AbilitID
    • Actions
      • Set PA_Index = (PA_Index + 1)
      • Set PA_Caster[PA_Index] = (Triggering unit)
      • Wait 0.00 seconds
      • Custom script: call SetUnitAnimationByIndex(udg_PA_Caster[udg_PA_Index], 123)
      • Set PA_TempLoc1 = (Position of PA_Caster[PA_Index])
      • Set PA_TempLoc2 = (Target point of ability being cast)
      • Set PA_Angle[PA_Index] = (Angle from PA_TempLoc1 to PA_TempLoc2)
      • Unit - Create 1 PA_Dummy for (Owner of PA_Caster[PA_Index]) at PA_TempLoc1 facing PA_Angle[PA_Index] degrees
      • Set PA_Dummy[PA_Index] = (Last created unit)
      • Set PA_Distance[PA_Index] = 0.00
      • Custom script: set udg_PA_DamageGroup[udg_PA_Index] = CreateGroup()
      • Custom script: call RemoveLocation(udg_PA_TempLoc1)
      • Custom script: call RemoveLocation(udg_PA_TempLoc2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PA_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on PA Loop <gen>
        • Else - Actions
 
That's because things such as target point is lost after the wait (a lot of things are).
Will it screw up your trigger if you move the animation call + the wait to the bottom of the trigger?

Edit:
When I say lost I mean it's lost unless you save those things in variable before the wait. Then they can be called again after the wait as normally.
 
Status
Not open for further replies.
Top