HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

SetUnitAnimation...

09-02-2007, 08:24 PM#1
MaD[Lion]
when u play a unit animation by name, and play "Attack - 1" it plays randomly "Attack - 1" and "Attack - 2", but i want it to play "Attack - 1".
So lets say if i use SetUnitAnimationById, then how do i know which Index is the "Attack - 1" ? Is there a way to find this out or do i just have to try all indexes...
09-02-2007, 08:39 PM#2
HyperActive
Sure. You need to open the model (to whom the target animation belongs) as a .mdl in notepad. There you'll see something like:

Quote:
//+-----------------------------------------------------------------------------
//| IllidanEvil.mdl
//| Generated by War3 Model Editor v1.05
//| Saturday, September 01 2007 10:01:26
//| http://Magos.TheJeffFiles.com/War3ModelEditor/
//+-----------------------------------------------------------------------------
Version {
FormatVersion 800,
}
Model "IllidanEvil" {
NumGeosets 17,
NumGeosetAnims 15,
NumHelpers 67,
NumBones 191,
NumLights 1,
NumAttachments 18,
NumEvents 23,
NumParticleEmitters2 4,
BlendTime 150,
MinimumExtent { -263.204, -274.976, -83.0841 },
MaximumExtent { 214.514, 228.792, 547.544 },
}
Sequences 24 {
Anim "Stand" {
Interval { 167, 1567 },
MinimumExtent { -204.415, -202.222, -35.6347 },
MaximumExtent { 199.402, 201.595, 209.786 },
BoundsRadius 295.076,
}
Anim "Stand 2" {
Interval { 1733, 3733 },
Rarity 2,
MinimumExtent { -204.415, -202.222, -35.6347 },
MaximumExtent { 199.402, 201.595, 234.128 },
BoundsRadius 298.378,
}
Anim "Stand 3" {
Interval { 4067, 8733 },
Rarity 3,
MinimumExtent { -263.204, -202.222, -35.6347 },
MaximumExtent { 199.402, 228.792, 301.734 },
BoundsRadius 338.283,
}
Anim "Stand Ready" {
Interval { 18000, 18767 },
MinimumExtent { -204.415, -202.222, -35.6347 },
MaximumExtent { 199.402, 201.595, 209.786 },
BoundsRadius 295.076,
}
Anim "Attack" {
Interval { 19100, 20167 },
NonLooping,
MinimumExtent { -204.415, -202.222, -35.6347 },
MaximumExtent { 199.402, 203.515, 221.83 },
BoundsRadius 297.306,
}
............................

Now you start counting. The animations are under "Sequences". The first animation has index=0 (here it is "Stand"), second has index=1 (here it is "Stand 2")... just find the desired animation.

Oh, and, to convert a model between mdx and mdl, you can use Magos Model Editor.

EDIT: It looks a bit better in notepad that in this post :)
09-02-2007, 08:44 PM#3
Toadcop
Quote:
So lets say if i use SetUnitAnimationById, then how do i know which Index is the "Attack - 1"
if this animation exists in that model so... it's the "position" number of this animation (0 the first) convert for example into mdl and find it ^^ there are also some easier ways to do that. (MdlVis)