NPC Alarm

Post » Mon Feb 08, 2010 2:49 am

I have a door with an 80 lock, guarded by two NPCs who admittedly are not "guard" class. I set their "alarm" to 100, but if the PC picks the lock, they just ignore the whole thing. No "Your crime has been reported, no NPC attack, just nothing. Do I have to make them guards to get a response?
User avatar
WTW
 
Posts: 3313
Joined: Wed May 30, 2007 7:48 pm

Post » Mon Feb 08, 2010 3:03 am

Have you assigned ownership?
User avatar
Richard Dixon
 
Posts: 3461
Joined: Thu Jun 07, 2007 1:29 pm

Post » Mon Feb 08, 2010 4:57 am

Have you assigned ownership?


Yes, but the owner is not present in the cell... Would that matter?
User avatar
Laurenn Doylee
 
Posts: 3427
Joined: Sun Dec 03, 2006 11:48 am

Post » Mon Feb 08, 2010 10:04 am

Not entirely sure, but from your results it would appear so. Try giving the "guards" either a same faction as the owner and assign that faction ID to the door ownership, or script the event (which may give you more leeway in emulating a guard reaction). If you go with the faction option, you may also want to give the guards a "NoLore" so they don't chat about it.

[edit] I just got off of work and I'm a little run-down. Hopefully this makes sense...
User avatar
Eoh
 
Posts: 3378
Joined: Sun Mar 18, 2007 6:03 pm

Post » Mon Feb 08, 2010 11:39 am

Not entirely sure, but from your results it would appear so. Try giving the "guards" either a same faction as the owner and assign that faction ID to the door ownership, or script the event (which may give you more leeway in emulating a guard reaction). If you go with the faction option, you may also want to give the guards a "NoLore" so they don't chat about it.

[edit] I just got off of work and I'm a little run-down. Hopefully this makes sense...


Makes perfect sense, I'll give it a shot... Thanks!

[EDIT]Okay, I assigned ownership to one of the two guards, gave them all a common faction, reduced their disposition to 10, and when the lock is picked the do absolutely nothing.

I'm not sure about the best way to script this. I want the PC to have a chance of successful lock picking without starting a fight, with the chance based on things like chameleon spells, sneak skill, and so forth. I'm not certain whether to set it up with the script on the door, a hidden activator, or on the guards.

I was kinda thinking a script something like the "proximity mine" script, only setting a variable that would in turn startcombat instead of casting a spell.

Any suggestions welcome eh? ;)
User avatar
Sammygirl500
 
Posts: 3511
Joined: Wed Jun 14, 2006 4:46 pm

Post » Mon Feb 08, 2010 11:14 am

I don't think you can detect when the player attempts to pick a lock (although nearby NPCs should detect this, I don't know why they didn't), but you can detect when the player SUCCESSFULLY picks a lock by having a script on the door like so:

Begin neil_door_pick_scriptshort doOnceif ( doOnce == 1 )	returnendifif ( GetLockLevel == 0 )	; Lock has been picked - do something here!	set doOnce to 1endifEnd


Then you can do all your detections like GetPCSneaking, Player->GetEffect sEffectChameleon, etc. to determine whether or not he should get away with it.

(Aside: I wish something like this could be done for all doors so that it wasn't so easy to just go 100% chameleon and pick a lock right under an NPC's nose :()
User avatar
suzan
 
Posts: 3329
Joined: Mon Jul 17, 2006 5:32 pm

Post » Mon Feb 08, 2010 2:04 am

I don't think you can detect when the player attempts to pick a lock (although nearby NPCs should detect this, I don't know why they didn't), but you can detect when the player SUCCESSFULLY picks a lock by having a script on the door like so:

Begin neil_door_pick_scriptshort doOnceif ( doOnce == 1 )	returnendifif ( GetLockLevel == 0 )	; Lock has been picked - do something here!	set doOnce to 1endifEnd


Then you can do all your detections like GetPCSneaking, Player->GetEffect sEffectChameleon, etc. to determine whether or not he should get away with it.

(Aside: I wish something like this could be done for all doors so that it wasn't so easy to just go 100% chameleon and pick a lock right under an NPC's nose :()


Do you mod Oblivion? The reason I asked, GetLockedLevel is a TES IV function, and apparently doesn't work in Morrowind. I used GetLocked, and it does fine anyway. I also changed the fight setting on my NPCs to 50, and they started noticing a failed lock pick attempt, but they wouldn't start combat. I have a script that seems to work, and I'll post it here in case anyone wants to use it.

Begin AT_LockedScriptshort ATChameleonshort ATCrimeCheckshort ATSneakingshort ATRandomshort doOnceshort sneakSkill;'globals: AT_InsanFightif ( doOnce == 1 )        returnendif;'check for lock picedif ( GetLocked== 0 )        ; Lock has been picked - do something here!        set ATCrimeCheck to 1        set doOnce to 1endif;'Check for Player sneak and skill then set a random to determine detected or notIf ( ATCrimeCheck == 1 )	if ( GetPCSneaking == 1 )			set sneakSkill to ( player->GetSneak )			set ATRandom to Random, 1000			set ATRandom to ( ATRandom / 10 )			set ATCrimeCheck to 2	Else			"AT_Sailor_04"->startcombat, player			"AT_Sailor_05"->startcombat, player			set ATCrimecheck to -1	endIfendIf;'Determine if chameleon present If ( ATCrimeCheck == 2 )	If ( Player->GetEffect sEffectChameleon == 1 )			set ATChameleon to (ATChameleon + 20 )	endIf		set sneakskill to ( sneakSkill + ATChameleon )		set ATCrimeCheck to 3endIf;'Start combat if failed, return if success. If ( ATCrimeCheck == 3 )	If ( ATRandom < sneakskill )		return	Else		"AT_Sailor_04"->startcombat, player		"AT_Sailor_05"->startcombat, player		set AT_InsanFight to 1 ;'A global that is used by an accompanying script to continue the fight with other NPCs after the PC passes through the door.		set ATCrimecheck to -1	endIfendIf	End AT_LockedScript


I think the problem with having all doors use something like this is the lack of reference object ID's for nearby NPCs. If you can solve that, you probably could mod most doors in that fashion.
User avatar
Matt Bee
 
Posts: 3441
Joined: Tue Jul 10, 2007 5:32 am

Post » Mon Feb 08, 2010 2:22 am

Do you mod Oblivion? The reason I asked, GetLockedLevel is a TES IV function, and apparently doesn't work in Morrowind.

I don't actually... but my bad! I don't know where I got GetLockLevel from...

I used GetLocked, and it does fine anyway. I also changed the fight setting on my NPCs to 50, and they started noticing a failed lock pick attempt, but they wouldn't start combat. I have a script that seems to work, and I'll post it here in case anyone wants to use it.

I'm glad you got it sorted!

I think the problem with having all doors use something like this is the lack of reference object ID's for nearby NPCs. If you can solve that, you probably could mod most doors in that fashion.

That, and it would involve adding a script to every door :/
(And wouldn't work for doors added by mods)
User avatar
Claire Vaux
 
Posts: 3485
Joined: Sun Aug 06, 2006 6:56 am


Return to III - Morrowind