Infinite ammo for bad guys

Post » Tue Aug 23, 2011 8:37 am

I'm trying to make a hostile NPC is that is up on a ledge, shooting down arrows. I want him to have infinite ammo while in combat, but not give the player infinite ammo when they loot the body.

I tried giving him -10 arrows, but it doesn't work. Owning a container containing -10 arrows also doesn't work. But he does look cool shooting http://planetelderscrolls.gamespy.com/View.php?view=mods.detail&id=4926 out of the dark.

Do I need a script attached to the NPC to refill his ammo? Can I get him to refill his arrows when he runs low and only have the script run during combat?

I'd like to get him to summon a creature down on the level of the player, but I don't see a way to do that either.
User avatar
Big mike
 
Posts: 3423
Joined: Fri Sep 21, 2007 6:38 pm

Post » Tue Aug 23, 2011 6:19 am

Summoning on target will be a little bit more difficult, take some fun scripting.

For the arrows, just do a basic script like:

if ( GetItemCount "arrows" < 10 )    AddItem "arrows" 10endif


That'll give him infinite arrows. You can set it up to only run at certain times, or disable after the player kills him or something, to help with balance.
User avatar
Bambi
 
Posts: 3380
Joined: Tue Jan 30, 2007 1:20 pm

Post » Tue Aug 23, 2011 10:38 am

Summoning on target will be a little bit more difficult, take some fun scripting.

For the arrows, just do a basic script like:

if ( GetItemCount "arrows" < 10 )    AddItem "arrows" 10endif


That'll give him infinite arrows. You can set it up to only run at certain times, or disable after the player kills him or something, to help with balance.

Thanks! That helps.
User avatar
Kristian Perez
 
Posts: 3365
Joined: Thu Aug 23, 2007 3:03 am


Return to III - Morrowind