*
Free and Open Source Code:
Anyone may copy, use, and redistribute the code contained herein without restriction implied or otherwise.
Limitation of Liability:
The author of this code can't be held liable for any results pursuant to the use of code whether expected or unexpected. Including any disputes arising from third parties about the usage by the user of the code; if by circumstance of dispute regarding proprietorship a lawsuit arises then the author of this code can't be held liable for any expenses or losses incurred by users of this code(royalties, etc arising from resolution of dispute).
*/
Utilizes OnPerception event to trigger combat between a designated guard type NPC
conditional upon the nearby presence of NPC witnesses of hostile actions such as
killing and stealing. Also, if one witness perceives another witness with whom
has witnessed an event outside of the first witnesses domain of perception then
the witnessed crime is passed along to the newly encountered witness.
To use this demo, I recommend using a premade character such as Damien One-Knife
and using pickpocket on the NPC named Pickpocket Me. Upon a successful pickpocket
you should notice that a message is displayed for each of the 4 nearby witnesses.
To the north is another witness and a guard. If you run to the north immediately
after the successful pickpocket you shouldn't be attacked by the guard(as long as
you didn't kill anyone) because none of the observing witnesses are close enough
to alarm the guard. Next, I recommend running back to the NPC "Pickpocket Me" and
triggering the orb item which was created on your PC at startup. The item will
give one of the witnesses the command to run to where the 5th witness and guard
are standing then to run back to the original position. Once the witness returns
you can run north again, and the guard should attack you. The message of the crime
observed has been transferred from the witness who ran north to the witness who
is standing next to the guard.
4th version. Witnesses transfer crime information to other witnesses using the OnPerception event of the witness receiving the information and a timestamp for keeping track of when the crime log of a NPC has been modified. Corrected a timestamp bug from version 3.
Uploaded version 2 which uses OnPerception events of witnesses to transfer crime logs from one NPC to another using timestamps for reducing the computational power necessary to perform the task. An orb item is given to the PC at startup which will force one of the NPCs to move to the far witness and guard to the north to transfer the pickpocket crime witnessed.
Posted by Ron Fred at 2009-02-10 11:45:31 Voted 9.00 on 02/10/09
I would like to use this in my works. Thank you for your time and effort.
__________________________________
How far down does this rabbit hole go?
Good point. Yes, it would be practical for the witnessers to attempt to relay their observations immediately upon witnessing the crime. I will include such a feature in the near future. A guard who might be labeled as a witnesser might not be within the proximal radius to detect the crime, but might receive the message through a sort of peer-to-peer network throughout the zone. Interesting, thank you. I think I will include a flag for each witnesser that specifies whether or not the witnesser will relay the message immediately(is the witnesser close enough to the guard to avoid danger from the relaying of the message).
Posted by Saduj at 2009-02-08 00:05:18 Voted 10.00 on 02/06/09
You mention good applications of witnessable crimes. In order to implement with bashing chests and doors, all that would be necessary is
#include "mf_wit_ondistuin"
and a call to
notifyWitnesses(oDisturber);
within the OnDamaged event of either chest, door, or whatever placeable desired.
Posted by Saduj at 2009-02-06 23:53:58 Voted 10.00 on 02/06/09
Works as advertised!
Suggestions : Detect bashed and failed pick lock on chests, doors, and other allied items...