The Elder Scrolls Forums

TES Construction Set and Plugins >> General TES Construction Set

Pages: 1
Nigedo
Diviner

Reged: 05/30/03
Posts: 2588
Loc: Deep beneath Vvardenfell
Crime Detection - a new method
      #2660304 - 06/05/04 11:49 PM

I stumbled across a strange bug/feature of OnPCHitMe today.

I don't think it's been documented before, so I thought I'd note down what I found out here.


If you declare OnPCHitMe in an NPC's script, any crime that they are aware of causes this function/variable to return True.

The crime does not actually have to be committed against that NPC, they just have to have a high enough Alarm setting, to care about a crime being committed within range, and the crime will count as a melee hit on them of zero damage.

Although this makes OnPCHitMe less reliable for detecting just attacks on the NPC it is declared on (I had to use a different method for the script I was actually working on ), it is potentially useful for detecting crimes taking place.


It is possible to use this to detect all crime events in one script, without needing an NPC to "report" them, i.e. increase Player's bounty, or needing to check or adjust PCCrimeLevel.

I found that the following alarm settings will (usually) cause OnPCHitMe to return True for the these events:-

Code:
Event			Minimum Alarm


Any theft 10

Assault of an NPC 90

Murder of an NPC 10


I tested these settings by adding this simple script to an NPC:-

Short OnPCHitMe

If ( OnPCHitMe )
Set OnPCHitme to 0
MessageBox "PC Hit Me!"
Endif

and adjusting his Alarm settings through the console for different test scenarios.

--------------------
Dean of The Theoretical Whirling School Of Vivec

The Whirling School | Academy for Dwemer Studies | TES Lore FAQ

Post Extras: Print Post   Remind Me!   Notify Moderator   Email Post
shannon
Disciple

Reged: 12/25/03
Posts: 1800
Re: Crime Detection - a new method [Re: Nigedo]
      #2660397 - 06/06/04 12:35 AM

Scripting is brain food. I dont really understand what you just explained too well, but if I did I'd be smart like you!

--------------------
--------------------------------
Do not blame God for having created the tiger, but thank him for not having given it wings.


Post Extras: Print Post   Remind Me!   Notify Moderator   Email Post
Argent
Disciple

Reged: 02/05/03
Posts: 1847
Loc: Australia
Re: Crime Detection - a new method [Re: Nigedo]
      #2660399 - 06/06/04 12:35 AM

Thanks for sharing this info .
Another serendipitous moment; using a feature that seems straight forward, broken for the intended purpose but extremely useful for other things never intended for it!

I had a similar experience with my HTH mod; trying to make a COS paralyze effect using a paralyze curse- ended up using a completely different approach for the paralysis yet the curse itself made HTH physical damage possible.

Good ol' Morrowind...

--------------------
Immersive Architect: Make Morrowind your world builder.
Morrowind Tech

Post Extras: Print Post   Remind Me!   Notify Moderator   Email Post
Nigedo
Diviner

Reged: 05/30/03
Posts: 2588
Loc: Deep beneath Vvardenfell
Re: Crime Detection - a new method [Re: shannon]
      #2660463 - 06/06/04 12:58 AM

Quote:

Scripting is brain food. I dont really understand what you just explained too well, but if I did I'd be smart like you!



Hehe, thanks Shannon.

What it basically means is that you can (theoretically) create situations where someone (or something) can know of the Player committing a crime anywhere, even when the guards don't know about it and there appear to be no witnesses to the crime.

Argent

Quote:

Another serendipitous moment...



Yup, totally accidental but amusingly useful. I'm considering how I should apply this in a small test mod.

--------------------
Dean of The Theoretical Whirling School Of Vivec

The Whirling School | Academy for Dwemer Studies | TES Lore FAQ

Post Extras: Print Post   Remind Me!   Notify Moderator   Email Post
Patrograd2
Curate

Reged: 02/02/04
Posts: 988
Loc: England
Re: Crime Detection - a new method [Re: Nigedo]
      #2660486 - 06/06/04 01:06 AM

Interesting.

I wonder if you could use this to update a global variable, which when it reached a certain level made the player a permanent outlaw....

--------------------
Patrograd's Annastian Adventures Mods
City of Thieves and DeathTrap Dungeon
http://www.geocities.com/patrograd/


Post Extras: Print Post   Remind Me!   Notify Moderator   Email Post
Nigedo
Diviner

Reged: 05/30/03
Posts: 2588
Loc: Deep beneath Vvardenfell
Re: Crime Detection - a new method [Re: Patrograd2]
      #2662687 - 06/06/04 01:21 PM

Sure, I guess you could create an invisble NPC that follows the Player around updating a global "CrimesCommitted".

It's a shame that there doesn't seem to be a way to gather more precise information about the crime. If varying levels of crime were to cause variable amounts of damage for one frame and then reset health, this would allow a more complex log of PC crimes to be constructed.

Perhaps it is possible to work out the impact of PC crime on the Fight settings of witnesses with varying Alarm settings and use this to estimate the nature of the crime??

As it stands, one example application could be to allow automatic expulsion of the Player from say a religious order, or a loss of paladin status even when the Player thinks they might be able to get away with something... "The gods see everything you know".

--------------------
Dean of The Theoretical Whirling School Of Vivec

The Whirling School | Academy for Dwemer Studies | TES Lore FAQ

Post Extras: Print Post   Remind Me!   Notify Moderator   Email Post
Pages: 1


Extra information
3 registered and 3 anonymous users are browsing this forum.

Moderator:  Umrahel, Freddo, Pete, klendathu, Lady Eternity, Locklear93, Hungry Donner, Attrebus, Miltiades, slateman, tegger, Archeopterix 

Favorite Thread! (toggle)
Print Thread

Permissions
      You can start new topics
      You can reply to topics
      HTML is disabled
      UBBCode is enabled

Rating: *****
Thread views: 99

Rate this thread
 
Jump to

The Elder Scrolls Homepage

*
UBB.threads™ 6.3

Click for Privacy Statement 2003 Bethesda Softworks LLC, a ZeniMax Media company. All Rights Reserved.
PRIVACY POLICY | TERMS & CONDITIONS | LEGAL INFORMATION | CONTACT US