Aller au contenu

Photo

Need help making an animation script!


  • Veuillez vous connecter pour répondre
11 réponses à ce sujet

#1
Colton

Colton
  • Members
  • 58 messages

Hello! I'm familiar wit animations, bu for some reason "attack01-03" arn't working in this format -  

 

#include "ginc_wp"
void main()
{
int iCurrentWP = GetCurrentWaypoint();
PlayCustomAnimation(OBJECT_SELF, "Attack03", 1);
}

 

 

 

 

 

But animations others work when the animation is changed like -

 

#include "ginc_wp"
void main()
{
int iCurrentWP = GetCurrentWaypoint();
PlayCustomAnimation(OBJECT_SELF, "forge01", 1);
}

 

 

Please help me find a script that makes an npc swing a sword (specificly at a dummy)

 



#2
Dann-J

Dann-J
  • Members
  • 3 161 messages

Try putting an asterisk in front of the string ("*attack03").

 

There are separate animations for each weapon type, each with a different prefix. That function is smart enough to know what weapon type the creature in question is holding (or not holding, for unarmed combat), and it automatically replaces the asterisk with the correct prefix.


  • rjshae, andysks et Colton aiment ceci

#3
Colton

Colton
  • Members
  • 58 messages

Try putting an asterisk in front of the string ("*attack03").

 

There are separate animations for each weapon type, each with a different prefix. That function is smart enough to know what weapon type the creature in question is holding (or not holding, for unarmed combat), and it automatically replaces the asterisk with the correct prefix.

That worked tanks! But now the NPC doesn't wield the weapon when using the animaiton, for instance I have the longbow equiped onto the npc, and the looping draw and fire animation plays... but he wields nothing, any ideas?



#4
4760

4760
  • Members
  • 1 207 messages

Maybe because there are only two combat animations for bows?



#5
andysks

andysks
  • Members
  • 1 650 messages
It could be a proficiency error. Check if he can even equip a longbow.
I found that if I equip plate mail or anything like that on non proficient NPCs, it will show in the toolset but not in game. Can't recall what the preview will show though.
  • Colton aime ceci

#6
Colton

Colton
  • Members
  • 58 messages

Yeah he can wield it, jsut doesnt show up with either bow animation- bow_1attack01   bow_1attack02



#7
Colton

Colton
  • Members
  • 58 messages

EDIT what i mean is I set the NPC class to Ranger and set to level 30, added a longbow. The animation played but no bow showed. The aniamtion ius really fast, is there any way to slow it down?

 

#include "ginc_wp"
void main()
{
int iCurrentWP = GetCurrentWaypoint();
PlayCustomAnimation(OBJECT_SELF, "bow_1attack01", 1);
}



#8
Dann-J

Dann-J
  • Members
  • 3 161 messages

I've never encountered disappearing weapons before (that weren't due to a lack of proficiency feats) - not unless I specifically use the SetWeaponVisibility() function.

 

Usually I have to deliberately make weapons invisible while playing an ambient animation, to prevent them looking like they're self-harming (like cutting their own throat while yawning).



#9
kevL

kevL
  • Members
  • 4 061 messages

The aniamtion ius really fast, is there any way to slow it down?


PlayCustomAnimation() can take a 'float fSpeed' parameter after the nLooping argument. Values between 0.f and 1.f should slow things down.

apparently they can even play backward w/ fSpeed < 0.f


check out the function's description in ScriptAssist,

#10
rjshae

rjshae
  • Members
  • 4 491 messages

apparently they can even play backward w/ fSpeed < 0.f

 

Now that could be entertaining in its own right...



#11
Dann-J

Dann-J
  • Members
  • 3 161 messages

Now that could be entertaining in its own right...

 

Playing animations backwards can prove useful, such as if you want to jump forward using the 'jump back' animation.



#12
kamal_

kamal_
  • Members
  • 5 250 messages

Playing animations backwards can prove useful, such as if you want to jump forward using the 'jump back' animation.

That's what I did for my jumping system.