Use specific attack anims

Idontknowyou

New Member
Reaction score
33
for an ability, vertical slash, I need to use the footman's "Attack - 1" animation, but I can't figure out how to keep the ability from using both attack variations, please help.

TY in advance!
 

wellwish3r

wishes wells.
Reaction score
52
I don't know if that function exists in GUI (dont have WE right now) but
JASS:
call SetUnitAnimationByIndex(unit whichUnit,integer whichAnimation)


can play the varied attack animations. If it does not exist in GUI use a custom script and variables. For the right integer you will have to play around a bit.
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
In order to find the correct index you could add some test function for it. Simply make a trigger with an event, Player 1 (Red) types -test... for example. Then add the following lines as custom scripts:
JASS:

local integer i = 0
loop
    exitwhen i > 15
    call SetUnitAnimationByIndex(udg_UnitVar, i)
    call BJDebugMsg(I2S(i))
    call TriggerSleepAction(2.)
    set i = i + 1
endloop


You'd have to store the unit of your choise in a unit variable named UnitVar, alternatively change the argument in the SetUnitAnimationByIndex() function.
 

Septimus

New Member
Reaction score
58
In order to find the correct index you could add some test function for it. Simply make a trigger with an event, Player 1 (Red) types -test... for example. Then add the following lines as custom scripts:

This technique was a complete was of time, some model have over 25 animation.

All you need to do is to get the unit mdx files and convert it to mdl. Once you convert it to mdl, open it with notepad and you would see the bunch of animation list such as this example below.

Sequences 10 {
Anim "Stand" {
Interval { 167, 1333 },
MinimumExtent { -33.8987, -60.4378, 0.565917 },
MaximumExtent { 59.4171, 66.0918, 93.8774 },
BoundsRadius 73.7855,
}
Anim "Stand 2" {
Interval { 1500, 3500 },
Rarity 4,
MinimumExtent { -65.3835, -70.3682, 0.551609 },
MaximumExtent { 69.3659, 63.9296, 93.8774 },
BoundsRadius 72.698,
}
Anim "Death" {
Interval { 11500, 14733 },
NonLooping,
MinimumExtent { -110.441, -75.9819, -9.61305 },
MaximumExtent { 58.3427, 82.298, 117.21 },
BoundsRadius 99.2985,
}
Anim "Attack" {
Interval { 15933, 16933 },
NonLooping,
MinimumExtent { -41.1397, -72.1604, -0.238035 },
MaximumExtent { 65.4101, 54.5234, 129.403 },
BoundsRadius 74.0905,

The animation listed at the top of animation list is animation index 0, and follow by 1 and 2 and so on.
 

Idontknowyou

New Member
Reaction score
33
Alright so the animation i want is index 4..... How exactly do I make it play that?

I am doing this

Code:
Set Attacker = (Casting unit)
Custom script:   call SetUnitAnimationByIndex(udg_Attacker, 4)

But it does nothing
 

T.s.e

Wish I was old and a little sentimental
Reaction score
133
It should do something.
Post the rest of the code? (If there is any)
 

Idontknowyou

New Member
Reaction score
33
Code:
Footman Vertical
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Vertical Slash 
    Actions
        Set AttackUnit = (Casting unit)
        Sound - Play HeroShadowhunterMissileLaunch1 <gen> at 100.00% volume, attached to (Casting unit)
        Custom script:   call SetUnitAnimationByIndex(udg_AttackUnit, 4)
        Unit Group - Pick every unit in (Units within 100.00 of (Position of (Casting unit))) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        And - All (Conditions) are true
                            Conditions
                                (Picked unit) Not equal to (Casting unit)
                                (Facing of (Casting unit)) Greater than or equal to ((Angle from (Position of (Casting unit)) to (Position of (Picked unit))) - 60.00)
                                (Facing of (Casting unit)) Less than or equal to ((Angle from (Position of (Casting unit)) to (Position of (Picked unit))) + 40.00)
                    Then - Actions
                        Unit - Cause (Casting unit) to damage (Picked unit), dealing 50.00 damage of attack type Normal and damage type Normal
                        Sound - Play AxeMissile2 <gen> at 100.00% volume, attached to (Casting unit)
                    Else - Actions


The non animation portion of it is still a bit bugged ( I had it working perfectly last night but my editor crashed)
 

T.s.e

Wish I was old and a little sentimental
Reaction score
133
Shot in the dark: Change Casting unit to Triggering unit, and change Begins casting to Starts the effect.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top