Any suggestions for making NPC switch weapons?

Post » Wed Mar 02, 2011 9:19 pm

Anyone got any suggestions on how to make an NPC switch weapons at random times when fighting? Like striking with his sword and shield for a few blows and then switching to his claymore for a couple more hits?

I have an idea, but am wondering if there isn't a more efficient method.
User avatar
Sammykins
 
Posts: 3330
Joined: Fri Jun 23, 2006 10:48 am

Post » Thu Mar 03, 2011 10:45 am

Just came across this, If its for a specific NPC ..... How about attaching a script to it like this;


Short Counter

Begin OnHit

If (Counter == 0 )
Set Counter to 1

ElseIf (Counter == 1 )
Set Counter to 2

ElseIf (Counter == 2 )
Set Counter to 3

ElseIf (Counter == 3 )
Set Counter to 4

ElseIf (Counter == 4)
UnequipItem Sword
EquipItem Bow
Set Counter to 5


Etc.....


This script means that on the fourth hit, the Npc will trade out weapon types. If you continue to "up" the counter and set 10 to a different weapon type, and then looped the counter back to 0, you could techically have the NPC switching weapons during the entire fight. Hope this helps.
User avatar
Miss Hayley
 
Posts: 3414
Joined: Tue Jun 27, 2006 2:31 am

Post » Thu Mar 03, 2011 2:58 am

Just came across this, If its for a specific NPC ..... How about attaching a script to it like this;


Short Counter

Begin OnHit

If (Counter == 0 )
Set Counter to 1

ElseIf (Counter == 1 )
Set Counter to 2

ElseIf (Counter == 2 )
Set Counter to 3

ElseIf (Counter == 3 )
Set Counter to 4

ElseIf (Counter == 4)
UnequipItem Sword
EquipItem Bow
Set Counter to 5


Etc.....


This script means that on the fourth hit, the Npc will trade out weapon types. If you continue to "up" the counter and set 10 to a different weapon type, and then looped the counter back to 0, you could techically have the NPC switching weapons during the entire fight. Hope this helps.


That's not a bad way to do it. I actually got a pretty nice way figured out using the Rand command from OBSE. I about forgot about this topic and meant to update it. heh :laugh:
User avatar
Charlie Sarson
 
Posts: 3445
Joined: Thu May 17, 2007 12:38 pm


Return to IV - Oblivion