How do I make NPCs attack monstershostile NPCs?

Post » Wed May 02, 2012 8:48 pm

I need to have NPCs in my town function as guards, without actually reporting you for breaking the law, or arresting you if you have a bounty. They're basically just there to fight monsters that stray into the area.
User avatar
Bee Baby
 
Posts: 3450
Joined: Sun Jun 18, 2006 4:47 am

Post » Wed May 02, 2012 5:49 pm

Simply set their Alert status to zero
User avatar
REVLUTIN
 
Posts: 3498
Joined: Tue Dec 26, 2006 8:44 pm

Post » Wed May 02, 2012 6:19 pm

Simply set their Alert status to zero
That's not quite what I'm looking for. I still want them to attack you if you steal things, and I don't want them to arrest you if you talk to them with a bounty.

I basically just need a way to make normal people attack monsters that come near them.
User avatar
Kelsey Hall
 
Posts: 3355
Joined: Sat Dec 16, 2006 8:10 pm

Post » Wed May 02, 2012 10:45 pm

I believe in order for an NPC to have full guard behavior (e.g. attacking creatures and arresting criminals), they need to have their class set to Guard, and their Alarm rating set to 100. The Alarm may or may not be unnecessary in your case, you can play with it and see what works for you.
User avatar
IsAiah AkA figgy
 
Posts: 3398
Joined: Tue Oct 09, 2007 7:43 am

Post » Thu May 03, 2012 12:26 am

AiEscort player 0 0 0 0
User avatar
ZANEY82
 
Posts: 3314
Joined: Mon Dec 18, 2006 3:10 am

Post » Wed May 02, 2012 8:33 pm

AiEscort player 0 0 0 0
Almost there... with this, I had dozens of guards coming from miles around to my aid, every time a cliff racer attacked me... which is a bit excessive. Also, if I try to murder someone, instead of fighting me, they help me out. Any way to tweak it to make them only help within a small area, and still recognize it when I break the law, and attack me for it? (Without trying to arrest me, like guards do.)
User avatar
Felix Walde
 
Posts: 3333
Joined: Sat Jun 02, 2007 4:50 pm

Post » Wed May 02, 2012 11:58 pm

Almost there... with this, I had dozens of guards coming from miles around to my aid, every time a cliff racer attacked me... which is a bit excessive. Also, if I try to murder someone, instead of fighting me, they help me out. Any way to tweak it to make them only help within a small area, and still recognize it when I break the law, and attack me for it? (Without trying to arrest me, like guards do.)
Lol, that is just plain awesome. Imagine being in a fight against a couple of creatures, and in the distance you see hundreds of guards pouring over the hills to your aid.
User avatar
rae.x
 
Posts: 3326
Joined: Wed Jun 14, 2006 2:13 pm

Post » Wed May 02, 2012 6:05 pm

Almost there... with this, I had dozens of guards coming from miles around to my aid, every time a cliff racer attacked me... which is a bit excessive. Also, if I try to murder someone, instead of fighting me, they help me out. Any way to tweak it to make them only help within a small area, and still recognize it when I break the law, and attack me for it? (Without trying to arrest me, like guards do.)
Ohhh, haha, I thought when you said you didn't want them to arrest you, you wanted them to ignore you.

If you set their alarm to 100 they will attack you when you commit a crime and attack creatures attacking you but wont help against NPCs ( like Dark Brotherhood assassins ). The dialog for paying fines is tied to the guard class.

Another possible option is to have a script on each guard that checks for the player's proximity and changes their AIpackage accordingly ( AIEscort when nearby, AIWander when not ) and if the player's crime level increases use forcecombat. GetDistance is a bit slow so only have it check occasionally ( or check if the player is in the same cell instead ).
User avatar
Mari martnez Martinez
 
Posts: 3500
Joined: Sat Aug 11, 2007 9:39 am

Post » Wed May 02, 2012 2:40 pm

I believe in order for an NPC to have full guard behavior (e.g. attacking creatures and arresting criminals), they need to have their class set to Guard, and their Alarm rating set to 100. The Alarm may or may not be unnecessary in your case, you can play with it and see what works for you.
The guard class has some special behavior built into it, so you will need to set that.

To prevent them from arresting you, you need to provide a filtered dialogue option that overrides the usual arrest challenge.

To get them to attack hostile NPCs, you'll need to do some additional work. MCA has scripts that allow for that, I believe, so you may check there.
User avatar
mimi_lys
 
Posts: 3514
Joined: Mon Apr 09, 2007 11:17 am

Post » Thu May 03, 2012 2:48 am

The guard class has some special behavior built into it, so you will need to set that.

To prevent them from arresting you, you need to provide a filtered dialogue option that overrides the usual arrest challenge.

To get them to attack hostile NPCs, you'll need to do some additional work. MCA has scripts that allow for that, I believe, so you may check there.
Thanks, I hadn't thought to look at the dialogue. I figured it all out now though.

All I had to do was add a not ID function to every standard guard message, and they will act like guards, without ever trying to arrest you, even if you talk to them with a bounty. They still talk to you before starting to fight you though, so I just have them say "We don't tolerate criminals here, outlander. Prepare to die." in place of the normal "pay your fine or go to jail" message that guards give. It's all working pretty nicely now. Thanks.
User avatar
Steven Hardman
 
Posts: 3323
Joined: Sun Jun 10, 2007 5:12 pm

Post » Wed May 02, 2012 7:50 pm

That's not going to work, at all. Modifying all the default dialogue will break both other mods and dialogue links; you need to add your own entries (with an ID filter instead of a not ID, using the same ID value) before the existing ones.
User avatar
Kelvin Diaz
 
Posts: 3214
Joined: Mon May 14, 2007 5:16 pm

Post » Thu May 03, 2012 2:49 am

That's not going to work, at all. Modifying all the default dialogue will break both other mods and dialogue links; you need to add your own entries (with an ID filter instead of a not ID, using the same ID value) before the existing ones.
By ID Filter, do you mean the ID box under where it says Speaker Condition?

I got it to work for when they catch you committing a crime that way, but I can't seem to do it for when you turn yourself in. I've got all of the functions set the same way, and it's higher on the list, but they still say the standard guard message.
User avatar
Izzy Coleman
 
Posts: 3336
Joined: Tue Jun 20, 2006 3:34 am


Return to III - Morrowind