So, my question is: when does Misc Stat 9 (which keeps track of broken lockpicks) get updated? There is a quest running with a script attached that keeps track of this stuff. I'm finding that the Misc Stat 9 is not being updated during this script. I've tried using MenuMode and GetActiveMenuMode and that doesn't help.
Here's the basic idea:
On gameload record the number of broken lockpicks in a variable. (if I update the variable only when a lock is picked - see code below)
Upon opening a lock, check the Misc Stat 9 and figure out how many lockpicks have been broken. However I always get zero for the number of broken lockpicks.
Update the script variable with the new number of broken picks.
Below is the actual script. See my comments next to a couple of statements.
Spoiler
;lockpicking - tracking broken lockpickslet numberOfBrokenPicks := getPCMiscStat 9 - numberOfBrokenPicksOldlet numberOfBrokenPicksOld := getPCMiscStat 9 ---- At one point I commented this out and put the assignment in the if statement, below. When I had it further down in the script, I also added the initialization when the game is loaded.;if (ObXPMain.debugMode) ;scribe "Broken Lockpicks: %.0f, Old value: %.0f|OblivonXP" numberOfBrokenPicks numberOfBrokenPicksOld;endiflet tempLong := arrayMiscXP[1]if ( getPCMiscStat 8 > tempLong ) && ( numberOfBrokenPicks <= ObXPSettings.lockpicksBrokenMax ) let gainedXP := ( 1 + ObXPMain.playerLevel * ObXPSettings.multXPLevel ) * ( getPCMiscStat 8 - tempLong ) * ObXPSettings.multXPLockpick * lockPickDifficulty if ( gainedXP ) ** this block updates the running total of experience points and displays a message on-screen - it works fine endif ;let numberOfBrokenPicksOld := getPCMiscStat 9 ---- I tried this instead of the assignment outside of the if statement - it didn't work either.endif
ObXPSettings.lockpicksBrokenMax is normally set to 5, so if you break 5 or more lockpicks, you're not supposed to get any points. However the numberOfBrokenPicks is always zero, no matter what.
Later in the script there's a MenuMode block for some other processing. I tried adding if (GetActiveMenuMode == 1014) or if (MenuMode 1014 == 1) and setting variables in there, but that didn't help.
So does anybody know how I might accomplish this? I know Misc Stat 9 is getting updated, but I can't figure out what the timing is so I can query it in this scipt.
Thanks for any help!