HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Bladestorm Animation Question

06-03-2006, 07:03 AM#1
MysticGeneral
I have a custom spell that doesn't do any damage. Instead, I trigger in the damage.

Now, what I want to do is when the unit uses the spell, it'll play the "Attack Walk Spin" animation. However, when the unit moves, the Bladestorm effect goes away. Is there anyway to keep it going? I know you can make it look like it's on with timers, but that would require me to make a seperate trigger/function. I hate making too many triggers.

EDIT: Ah crap, I did it anyways. So late at night to get a quick response. Oh well.
06-03-2006, 09:10 AM#2
vile
Set the unit animation using this:
Collapse JASS:
call SetUnitAnimationByIndex(unit, indexnumber)

You have to search for the indexnumber, convert the hero's model to MDL and search its animations, start counting from 0 and go on to 1, 2, 3, until you find the attack walk spin animation. As an alternative you can just use a trigger to play each animation seperately from 0 and so on to find the proper index number.

SetUnitAnimationByIndex loops the animation until you issue the unit a certain order or change its animation.
06-03-2006, 10:48 AM#3
blu_da_noob
I'm fairly sure Index animation is overwridden by normal unit animations (ie. when attacking or walking). I assume mystic found what he was looking for, possibly:

Collapse JASS:
call AddUnitAnimationProperties(unit,"Attack Walk Spin",true)
06-03-2006, 01:07 PM#4
The)TideHunter(
Quote:
Originally Posted by vile
You have to search for the indexnumber, convert the hero's model to MDL and search its animations, start counting from 0 and go on to 1, 2, 3, until you find the attack walk spin animation.

You dont have to look into the model or convert it.

Just use the function and set it to 0, test it see how it goes, see if its the right animation, if not try 1, etc.

Alot easier in my opionon
06-03-2006, 04:52 PM#5
vile
I also suggested that option:

Quote:
As an alternative you can just use a trigger to play each animation seperately from 0 and so on to find the proper index number.

If you would have bothered to read the rest of my post.
06-03-2006, 05:09 PM#6
MysticGeneral
Collapse JASS:
call SetUnitAnimationByIndex(unit, indexnumber)

Is what I always use. The attack walk spin animation is stopped when moving.

I just used a timer to play the animation every .01 seconds. Pretty much fixed it.

Quote:
As an alternative you can just use a trigger to play each animation seperately from 0 and so on to find the proper index number.

Is what I do. I do all animations from 0-25 in a loop every 2 seconds when trying to get an animation index.
06-03-2006, 05:25 PM#7
blu_da_noob
Playing the animation every 0.01 seconds is a horrible solution. Use the animation properties thing I posted above, I use it for triggered Bladestorms.
06-03-2006, 05:31 PM#8
The)TideHunter(
Quote:
Originally Posted by vile
I also suggested that option:



If you would have bothered to read the rest of my post.


Actually, i read over this intire thread, i read over your post twice.
I misread your post.
06-03-2006, 05:40 PM#9
MysticGeneral
Quote:
Playing the animation every 0.01 seconds is a horrible solution. Use the animation properties thing I posted above, I use it for triggered Bladestorms.

It's not really a horrible solution. It works without any problems, so it doesn't really matter to me.
06-04-2006, 06:48 AM#10
blu_da_noob
So you choose a grossly inefficient solution over a simple (and way more elegant, with less code, cleanup etc required) solution?
06-04-2006, 07:06 AM#11
vile
That's interesting blue, i never saw that one yet.
06-04-2006, 07:08 AM#12
MysticGeneral
Quote:
So you choose a grossly inefficient solution over a simple (and way more elegant, with less code, cleanup etc required) solution?

Yes because if I put yours, I'd have to edit my entire function. Which is not necessary anymore.

Why edit something when it's sufficient? Just seems like more work to me.
06-04-2006, 07:59 AM#13
blu_da_noob
It's good thing the whole of society isn't like you. "Omg, it works fine now, so why do a little but of extra work to make it 100 times better?"

The amount of work modifying your function to use the animation propery will require is minimal, and the benefit to the running of your map is large. Short duration timers should be avoided when possible.