Aller au contenu

Photo

Looping hammering animation


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

#1
Jereniva

Jereniva
  • Members
  • 124 messages

I was looking at having the PC equip a hammer and when using a forge do the looping animation ANIMATION_LOOPING_FORGE01, but I also wanted to have them have a "hammer" in their right hand.

I noticed there are "Base Item" types that seem like they're meant to for things you hold during certain animations, like Stein, Spoon, Rake, Shovel, and so on.

I saw Smithyhammer and figured this was what I wanted, and I made one and forced PC to equip it, but received an error (in game chat window, not script compile)

"You are too small to equip this item" which was weird.

 

If I want to have a visual hammer appear in PC's right hand and loop them through pounding on a table during their crafting "conversation", am I going about this the right way?

 

here's fragment of what I put in the On Used of the smithing table. Animation part works, but no hammer in right hand.

 

One other thing, even though I set duration for 30 seconds, he stops doing the animation after one loop through it. Am I doing the assign incorrectly?

void main()

{
object oPC = GetLastUsedBy();
object oHammer; 
if (GetIsPC(oPC) == TRUE)
 {
 	oHammer = CreateItemOnObject("axh_smithhammer",oPC,1);
	AssignCommand(oPC, ActionEquipItem(oHammer,INVENTORY_SLOT_RIGHTHAND));
 	AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_FORGE01,1.0,30.0));	
 } 	
}


#2
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 592 messages
Uncle FB did some excellent work with animating NPC's. You should download his NPC Control.

Even if you do not use it, looking at his scripts should teach you a lot about it.

I'll warn you that animating NPC's is a timesink and can derail a modding project. It is both additive and addictive, so once you start it is very hard to stop.

Regards
  • Jereniva aime ceci

#3
Tchos

Tchos
  • Members
  • 5 054 messages

I have two hammering NPCs in my module that you can use as a basis for yours if you like.  One is in the smithy, and he walks around the place and goes about various smithing business including hammering with a hammer in his hand.  The other is in the Halloween expansion, where the gravedigger hammers away at a coffin he's building.


  • Jereniva aime ceci

#4
Jereniva

Jereniva
  • Members
  • 124 messages

Thank you very much, I'll have a look!



#5
Jereniva

Jereniva
  • Members
  • 124 messages

I have two hammering NPCs in my module that you can use as a basis for yours if you like.  One is in the smithy, and he walks around the place and goes about various smithing business including hammering with a hammer in his hand.  The other is in the Halloween expansion, where the gravedigger hammers away at a coffin he's building.

Thank you Tchos, I'll have a look at it.



#6
Dann-J

Dann-J
  • Members
  • 3 161 messages

My Handy VFX include a smith hammer visual effect, which removes the need to equip an actual hammer.


  • Jereniva aime ceci