Creating Guards who will try to arrest me

Post » Fri Apr 30, 2010 7:11 pm

Hi. I'm fairly new to modding with TESCS and I'm dutifully following the Wiki and the excellent tutorials there, however, Iv run into a problem with a guard.

I followed a "Patrolling Guards" tutorial that I found with some success; the guard will patrol exactly as he is meant to, however, if I commit a crime right in front of him, he will no attempt to arrest me with the "Break the law on my watch will you" dialog, nor is there any option to pay a fine or resist arrest etc.

I have a small town area that I have created, populated with its own custom race, and this includes the guards, and I would like them to behave the same as all the other guards in the game when I commit a crime.

So far I have my patrol package, along with the GuardPatrolBeginPatrol package and my own wander package, and they all seem to work fine, except that the guard behaves just like any other citizen.

One other problem - I have the Respawn box checked for my guard, but if I kill him he does not seem to respawn. Is there a specific method required to get this behavior to work?

Any ideas please?

Cheers

MVK
User avatar
Darlene Delk
 
Posts: 3413
Joined: Mon Aug 27, 2007 3:48 am

Post » Fri Apr 30, 2010 5:52 pm

I followed a "Patrolling Guards" tutorial that I found with some success; the guard will patrol exactly as he is meant to, however, if I commit a crime right in front of him, he will no attempt to arrest me with the "Break the law on my watch will you" dialog, nor is there any option to pay a fine or resist arrest etc.

Did you add any of the ImperialLegion factions to your guard? Also, make sure your NPC's class is set to guard, as shown http://img94.imageshack.us/img94/652/npcclasslocation.jpg.


One other problem - I have the Respawn box checked for my guard, but if I kill him he does not seem to respawn. Is there a specific method required to get this behavior to work?

Any ideas please?

Enemies & NPCs respawn after three days, but only if you don't enter the cell for that amount of time. Try killing your guard, then going to a fort or cave and waiting for three days before returning to your town.
User avatar
Greg Swan
 
Posts: 3413
Joined: Tue Jun 05, 2007 12:49 am

Post » Fri Apr 30, 2010 11:34 pm

Did you add any of the ImperialLegion factions to your guard? Also, make sure your NPC's class is set to guard


The class is set to guard, but I have no Imperial Legion faction added. Ill give that a go.

Enemies & NPCs respawn after three days, but only if you don't enter the cell for that amount of time. Try killing your guard, then going to a fort or cave and waiting for three days before returning to your town.


I knew that it was something like that, but I didn't know that I had to stay out of the cell during that time!

Thanks Vyper, Ill give that faction thing a go later, and now I know about re-spawning Ill check that too. Nice one!

MVK
User avatar
Queen
 
Posts: 3480
Joined: Fri Dec 29, 2006 1:00 pm

Post » Fri Apr 30, 2010 11:10 pm

Also, check to make sure that your guards have a Responsibility of 100.
User avatar
Esther Fernandez
 
Posts: 3415
Joined: Wed Sep 27, 2006 11:52 am

Post » Fri Apr 30, 2010 12:06 pm

Hmm, thanks guys, but there is still a problem:

Iv added the Imperial Legion faction to my guard NPC (and the responsibility is 100). The patrol still works okay, and if I slap the guard up side of the head he'll draw his sword and try to take me out, but he does not attempt to arrest me, and there is no option to pay gold, go to jail or resist arrest.

Another problem is now with the locals. The city is my own, and the locals are my own custom race. There are several NPC's who wander about at all hours, and a group of out door traders who offer wares pretty much around the clock, however, their custom race is pretty cool toward any other race, which means that as soon as my guard took a swipe at me for slapping him, most of the town suddenly jumped up and attacked the poor sap, because of course his faction included the Imperials!

I'm sure you can see where I need to be with this: A custom race, with their own faction and their own town, who are not on the best of terms with anyone else, and a set of guards who respond to stealing and murder just like guards in the other cities.

That alone would be fine, but of course it would be nice if the guards in my city responded badly to any other cities guards who might happen to chase me into town to arrest me! Sure, they will still try to arrest me as a thief/murderer, but if I avoid them and they see guards from other cities/races rampaging through the streets they'll have at them on sight. Perhaps thats a bit too much to ask, I'm not sure at this stage, so some advice would be very much appreciated.

Cheers

MVK
User avatar
maya papps
 
Posts: 3468
Joined: Mon Aug 07, 2006 3:44 pm

Post » Fri Apr 30, 2010 10:36 am

*Shameless bump
User avatar
Dagan Wilkin
 
Posts: 3352
Joined: Fri Apr 27, 2007 4:20 am

Post » Fri Apr 30, 2010 2:00 pm

*Shameless Necropost*

I came across this thread when I had a similar problem with my own mod. It has to do with the way the speech is dealt with.

Because there are different voices for most races (and two genders, of course), the game must find a way to differentiate between the different character who are talking, so as to avoid an orc having an imperial voice, or a man having a woman's voice.

For all the arresting guard topics, there is the condition
GetIsRace Imperial == 1
. This means that only Imperials can say these lines, and hence all guards in the base game are Imperials. (This gave me a lot of trouble in my mod, when guards in one city could arrest you, but not the other)

There are two ways to fix this problem, and it all depends on whether you want to do some voice-overs or not (Presumably if you've made a whole town, you're willing to do that)




The first (and easiest) way is simply to open up the filtered dialogue screen (Characters>Filtered Dialogue), then in the topics tab, scroll down to GREETING and find all the things the guards say (They are sorted under 'Crime' in the quest column) and then add a new condition to it:
GetIsRace [Your Custom Race] == 1


You will also need to check the 'Or' box on both your new statement and the old one pertaining to Imperials. This method will make your guards have an Imperial voice, which could be ok if your race is similar to Imperials.




The Second method will be a lot more time consuming. You will actually need to create all the things you want your guards to say from scratch. To do this, open up the GREETING topic in the same way as above, then right click inside the box and select 'New'. From there you can type what you want the guards to say into the box for 'Response Text'. You can also record the voice-over and set the facial expression here, but I wont go into how to do that. Once that's done, click OK.

Next, in the box titled 'Resulting Script' put the following script in:
Set Crime.PCBounty to Player.GetCrimeGoldMessage "Current Bounty: %.0f" Crime.PCBounty, 10

This will make the player's bounty appear in the top left of the screen.

Next, in the Conditions box, put the following conditions:

GetIsRace [Your Race] == 1   Not run on TargetIsPlayerInJail == 0    Not run on TargetCanPayCrimeGold == 1 Run on TargetGetCrimeGold > 0 Run on TargetIsGuard == 1 Not run on Target


All those should be self-explanatory.

Next, in the choices tab, add the topics: 'ServeSentence', 'ResistArrest' and 'PayGoldForCrime'. This will bring up the usual choices when the player gets caught.

Finally, check the random box if you want to have different greetings each time you're arrested.

You will also need to make topics for each of the choices the player can make. Use the same method as above, but put the replies in the ServeSentence, ResistArrest and PayGoldForCrime sections respectively.

Also, you will need to add these scripts to each reply's resulting script box:
ServeSentence:
Player.GotoJailAnvilPCCellDoorRef.LockBravilPCCellDoorRef.LockBrumaPCCellDoorRef.LockCheydinhalPCCellDoorRef.LockChorrolPCCellDoorRef.LockICPCCellDoorRef.LockLeyawiinPCCellDoorRef.LockSkingradPCCellDoorRef.Lock

Note: If you make a new jail, add the door reference to this list with a .Lock suffix.

ResistArrest
ModDisposition Player -10StartCombat Player


PayGoldForCrime
player.PayFine


Hopefully this will clear up any trouble for people who have this problem in future.


P.S. This will also need to be done if you want to have guards of non-custom races (Such as Nords), as these aren't available in the base game.
User avatar
Charity Hughes
 
Posts: 3408
Joined: Sat Mar 17, 2007 3:22 pm

Post » Fri Apr 30, 2010 9:19 am


You should make an article on the wiki or somewhere with this info, this is exactly the issue I was running into myself.
User avatar
Taylor Bakos
 
Posts: 3408
Joined: Mon Jan 15, 2007 12:05 am

Post » Fri Apr 30, 2010 8:29 am

You should make an article on the wiki or somewhere with this info, this is exactly the issue I was running into myself.


I'm not entirely sure how to do that lol. :hehe: Anyone with that knowledge can feel free to toss my post up on the wiki though
User avatar
Pixie
 
Posts: 3430
Joined: Sat Oct 07, 2006 4:50 am

Post » Fri Apr 30, 2010 3:11 pm

Great post, Syhrus! :)

You just helped me solve a problem I haven't even run into yet (but was about to run into).
User avatar
Undisclosed Desires
 
Posts: 3388
Joined: Fri Mar 02, 2007 4:10 pm


Return to IV - Oblivion