Factions and NPC vs NPC

Post » Tue Dec 29, 2009 8:50 pm

I know this comes up all the time, but a search of recent topics hasn't bought anything conclusive.

I'm trying to get NPCs of two opposing faction to attack each other on sight, I've tried setting the respective faction reaction to -128 and the fight rating to 70, I placed the two NPCs nose to nose and they still didn't attack each other, ( though they do attack the PC if the PC is from one of the two factions in question ). Has anyone had success with this method?

As a seccond idea, if I create two NPCs with a script attached for one to attack the other and populate a cell with several instances of each, will that confuse the game engine, or will they just attack the nearest instance of the opposing NPC?

Also a third random question, is an NPC companion clever enough to drink a potion if they need it and how would I give or take items away from said companion. Is there a script already out there that makes them level up in line with the PC and do their stats increase accordingly?
User avatar
Adrian Powers
 
Posts: 3368
Joined: Fri Oct 26, 2007 4:44 pm

Post » Tue Dec 29, 2009 6:14 am

I know this comes up all the time, but a search of recent topics hasn't bought anything conclusive.

I'm trying to get NPCs of two opposing faction to attack each other on sight, I've tried setting the respective faction reaction to -128 and the fight rating to 70, I placed the two NPCs nose to nose and they still didn't attack each other, ( though they do attack the PC if the PC is from one of the two factions in question ). Has anyone had success with this method?

As a seccond idea, if I create two NPCs with a script attached for one to attack the other and populate a cell with several instances of each, will that confuse the game engine, or will they just attack the nearest instance of the opposing NPC?

Also a third random question, is an NPC companion clever enough to drink a potion if they need it and how would I give or take items away from said companion. Is there a script already out there that makes them level up in line with the PC and do their stats increase accordingly?


1. dont know, never tried

2. nearist/first instance, i'm fairly sure. if you want them all to fight, make a unique individual for both groups (unique only in script and ID) that all the rest are scripted to AI follow, and have one of these startcombat with the other.

3. i know for sure NPCs will drink non-player made health, magika, and stamina potions. i think they will also drink cure disease, or other status restoration potions if needed. they may also drink player made potions with these effects, i'm not sure. to give or take away ppotions, use the companion share selection in the dialog menu. to enable this, include the short "companion" on the NPCs script, and set it to 1 when they are your companion, usually accomplished with dialog. they may be some framework scripts out there. i'm fairly sure there are. i never really bothered to check because i wanted to script my companions myself. increasing level on an npc does nothing, really except function as an extra variable (for getlevel checks and such) to simulate leveling up, it's skills would have to be modified individually by script.
User avatar
Meghan Terry
 
Posts: 3414
Joined: Sun Aug 12, 2007 11:53 am

Post » Tue Dec 29, 2009 10:45 am

Thanks for the reply, I suspected that level ups on NPCs wouldn't recalculate their skills to match. As for companion share I didn't realise this existed in Morrowind, I will have to investigate...
User avatar
Cheryl Rice
 
Posts: 3412
Joined: Sat Aug 11, 2007 7:44 am


Return to III - Morrowind