Help in crime detection please.

Post » Sat Oct 24, 2015 5:36 pm

Hey everyone, I'm hoping I may get some help on trying to determin when a player commits any crime please.

here's my scenario, which has all been completed and runs perfectly as intended.


How the quest works so far: Player activates door, quest changes stages and starts a shrine quest. During that quest,
when a player clicks a shrine, an extra activation button appears saying "pray at this shrine". If the player
clickes 5 of these out of the 9 divine shrines, the quest changes stages again and instructs the player to go back to the door and enter.

All that is done, works great. love it. What i want now is a part 2 of that. so after the quest instructs the
player to go back to the door, (aka the shrine quest is done..for now) i want another quest to kick off silently
and detect when a player commits any kind of crime or rather anything that would inherintly break the law, including
stealing something while sneaking. eg.. assault, stealking, crime bounty etc...

I have no idea how to detect for that. I figure i'd need to be able to check if a player picked up any stolen items, assulted someone, had a bounty in any of the holds or crime factions. I know there's a crime event that can be set up on the quest tab, but I have zero experience using the story manager.

anyhow, reason for detection of a crime is, after the player prays and goes back to do the door if he/she commits a crime,
i want the shrine quest to start back up again. (ive actually put that part as a test into the quest for when I can get the crime detection working.

the whole point is, the player has to be 'clean' of any wrong doings before entering a particular area. so any crime commited after all the shrine praying would reset and have the player pray at 5 more shrines again. rinse and repeat.

User avatar
Yama Pi
 
Posts: 3384
Joined: Wed Apr 18, 2007 3:51 am

Post » Sat Oct 24, 2015 7:30 pm

guess you'd track a traced stat - http://www.creationkit.com/RegisterForTrackedStatsEvent_-_Form - , or a couple of them. iirc there's some for items stolen, stolen items value etc

User avatar
Teghan Harris
 
Posts: 3370
Joined: Mon Mar 05, 2007 1:31 pm

Post » Sat Oct 24, 2015 6:58 pm

Great!, that worked. Thank you.

I have another question. would modifying the crime gold to be 0, yeild the same result as playerpaycrimegold?

with that I mean, when you issue a playerpaycrimegold, the faction removes the gold, and all dialogue functions work correctly, no guards are wanting to attack you etc. It just works.

With the mod i'm working on, after the player prays at 5 of the 9 divine shrines, a function runs in a quest script that pays the hold factions off.

Here's part of the script that I've been using.

Spoiler

function ShrinesComplete()
int pcrimegold = 0

pcrimegold += CrimeFactionWhiterun.GetCrimeGold()
pcrimegold += CrimeFactionFalkreath.GetCrimeGold()

pcrimegold += CrimeFactionEastmarch.GetCrimeGold()
pcrimegold += CrimeFactionHaafingar.GetCrimeGold()
pcrimegold += CrimeFactionReach.GetCrimeGold()
pcrimegold += CrimeFactionHjaalmarch.GetCrimeGold()
pcrimegold += CrimeFactionPale.GetCrimeGold()
pcrimegold += CrimeFactionRift.GetCrimeGold()
pcrimegold += CrimeFactionWinterhold.GetCrimeGold()
pcrimegold += CrimeFactionOrcs.GetCrimeGold()

PlayerRef.Additem(Gold001, pcrimegold, true) ; give the needed gold to the player silently.

CrimeFactionWhiterun.PlayerPayCrimeGold(false,false)
CrimeFactionFalkreath.PlayerPayCrimeGold(false,false)
CrimeFactionEastmarch.PlayerPayCrimeGold(false,false)
CrimeFactionHaafingar.PlayerPayCrimeGold(false,false)
CrimeFactionReach.PlayerPayCrimeGold(false,false)
CrimeFactionHjaalmarch.PlayerPayCrimeGold(false,false)
CrimeFactionPale.PlayerPayCrimeGold(false,false)
CrimeFactionRift.PlayerPayCrimeGold(false,false)
CrimeFactionWinterhold.PlayerPayCrimeGold(false,false)
CrimeFactionOrcs.PlayerPayCrimeGold(false,false)

debug.messagebox("Your bounty in the holds have been erased.") ; placeholder

EndFunction

Only issue I had with that function is it displays a notification saying how much gold was payed per each faction. So I changed it around a bit using ModCrimeGold.

Spoiler

function ShrinesComplete()
int pcrimegold = 0
pcrimegold = CrimeFactionWhiterun.GetCrimeGoldViolent()
CrimeFactionWhiterun.modcrimegold(-pcrimegold,true)
pcrimegold = CrimeFactionWhiterun.GetCrimeGoldNonViolent()
CrimeFactionWhiterun.modcrimegold(-pcrimegold)

pcrimegold = CrimeFactionFalkreath.GetCrimeGoldViolent()
CrimeFactionFalkreath.modcrimegold(-pcrimegold,true)
pcrimegold = CrimeFactionFalkreath.GetCrimeGoldNonViolent()
CrimeFactionFalkreath.modcrimegold(-pcrimegold)

pcrimegold = CrimeFactionEastmarch.GetCrimeGoldViolent()
CrimeFactionEastmarch.modcrimegold(-pcrimegold,true)
pcrimegold = CrimeFactionEastmarch.GetCrimeGoldNonViolent()
CrimeFactionEastmarch.modcrimegold(-pcrimegold)

pcrimegold = CrimeFactionHaafingar.GetCrimeGoldViolent()
CrimeFactionHaafingar.modcrimegold(-pcrimegold,true)
pcrimegold = CrimeFactionHaafingar.GetCrimeGoldNonViolent()
CrimeFactionHaafingar.modcrimegold(-pcrimegold)

pcrimegold = CrimeFactionReach.GetCrimeGoldViolent()
CrimeFactionReach.modcrimegold(-pcrimegold,true)
pcrimegold = CrimeFactionReach.GetCrimeGoldNonViolent()
CrimeFactionReach.modcrimegold(-pcrimegold)

pcrimegold = CrimeFactionHjaalmarch.GetCrimeGoldViolent()
CrimeFactionHjaalmarch.modcrimegold(-pcrimegold,true)
pcrimegold = CrimeFactionHjaalmarch.GetCrimeGoldNonViolent()
CrimeFactionHjaalmarch.modcrimegold(-pcrimegold)

pcrimegold = CrimeFactionPale.GetCrimeGoldViolent()
CrimeFactionPale.modcrimegold(-pcrimegold,true)
pcrimegold = CrimeFactionPale.GetCrimeGoldNonViolent()
CrimeFactionPale.modcrimegold(-pcrimegold)

pcrimegold = CrimeFactionRift.GetCrimeGoldViolent()
CrimeFactionRift.modcrimegold(-pcrimegold,true)
pcrimegold = CrimeFactionRift.GetCrimeGoldNonViolent()
CrimeFactionRift.modcrimegold(-pcrimegold)

pcrimegold = CrimeFactionWinterhold.GetCrimeGoldViolent()
CrimeFactionWinterhold.modcrimegold(-pcrimegold,true)
pcrimegold = CrimeFactionWinterhold.GetCrimeGoldNonViolent()
CrimeFactionWinterhold.modcrimegold(-pcrimegold)

pcrimegold = CrimeFactionOrcs.GetCrimeGoldViolent()
CrimeFactionOrcs.modcrimegold(-pcrimegold,true)
pcrimegold = CrimeFactionOrcs.GetCrimeGoldNonViolent()
CrimeFactionOrcs.modcrimegold(-pcrimegold)

PlayerRef.StopCombatAlarm()

EndFunction

That works great as far as removing the gold from factions and not having it displayed as a notification. I'm just concerned that the game might think there is still gold in the crime factions. If it doesn't and it yeilds the same results as playerpaycrimegold, then I'll just stick with the modify function.

Edit: I have tested both ways in game and the second does work; The stats show no bounty and the guards don't ask for payment. I did have to add the stopcombatalarm though on the second version because the guards would still be in alert mode and try to attack or come after me. While this works for now and in the short run, I'm not sure what the long lasting effects of having the crime gold not be payed off by the player would be.

User avatar
Rude_Bitch_420
 
Posts: 3429
Joined: Wed Aug 08, 2007 2:26 pm


Return to V - Skyrim