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
  • Blackveiled Blackveiled:
    I wouldn't know, I'm in Joliet, Illinois right now working. I left Houston area about 2 weeks ago lol
  • Blackveiled Blackveiled:
    Not permanently of course, just a temporary job.
    +1
  • jonas jonas:
    Glad you're ok @tom_mai78101
  • jonas jonas:
    @Blackveiled you know another word for permanent? temporary
    +1
  • Varine Varine:
    Briefly, he'll only be there for the interim. Like a stopgap of sorts, he'll be back home in short time
  • O Old Mountain Shadow:
    Hurray! Tom has reappeared!
  • The Helper The Helper:
    Happy Thursday!
  • Blackveiled Blackveiled:
    Yep. Just another fun night at work.
  • Varine Varine:
    Broke the nozzle on my 3d printer and I don't have another heater block. So... I guess I'm fucked on that this weekend
  • The Helper The Helper:
    that sucks i bet they are expensive
  • Varine Varine:
    Not really
  • Varine Varine:
    The entire hot end is like 20 dollars, I just can't get anymore until next week
  • Varine Varine:
    I ordered like five blocks for 15 dollars. They're just little aluminum blocks with holes drilled into them
  • Varine Varine:
    They are pretty much disposable. I have shitty nozzles though, and I don't think these were designed for how hot I've run them
  • Varine Varine:
    I tried to extract it but the thing is pretty stuck. Idk what else I can use this for
  • Varine Varine:
    I'll throw it into my scrap stuff box, I'm sure can be used for something
  • Varine Varine:
    I have spare parts for like, everything BUT that block lol. Oh well, I'll print this shit next week I guess. Hopefully it fits
  • Varine Varine:
    I see that, despite your insistence to the contrary, we are becoming a recipe website
  • Varine Varine:
    Which is unique I guess.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site

      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