How to Force an NPC to Swing Weapon?

Post » Sun Jun 17, 2012 9:22 pm

Here's what I need to do, I need my NPC to swing his weapon. He doesn't have to hit anything, just swing it. I do want it to hit people If the swing is close enough. I tried first using PlayGroup, but the animation doesn't really hit anything. It just phases through enemies. Anyone wanna help?
User avatar
Ella Loapaga
 
Posts: 3376
Joined: Fri Mar 09, 2007 2:45 pm

Post » Sun Jun 17, 2012 6:37 am

AFAIK, the NPC has to really be in combat to do damage, otherwise the NPC's you see sparring in various places would all be dead.

One way might be to use a script to determine if there is an actor within the correct range and direction, and use the StartCombat command... but this is likely to be a messy with attacking NPC running around, blocking and shouting "I've fought mudcrabs more fearsome than you!" and other friendly greetings.

Another way might be to directly damage the target to simulate getting hit. You could do this by moving a small, initially disabled trigger zone directly in front of the swinging NPC, and enable it at the peak of every swing, disabling it again one frame later.

Both ideas will need a fair bit of scripting and testing though.
User avatar
Kortknee Bell
 
Posts: 3345
Joined: Tue Jan 30, 2007 5:05 pm

Post » Sun Jun 17, 2012 2:20 pm

Oh wow!

I really love the second Idea. I guess I'll begin the testing phase...

Thanks,
Moop.

P.S, If anyone has any other Ideas please post!
User avatar
Amanda savory
 
Posts: 3332
Joined: Mon Nov 27, 2006 10:37 am


Return to IV - Oblivion

cron