Repeatable Lockpicking. Close to giving up

Post » Mon Nov 19, 2012 12:55 pm

My setup is as follows:
A placeholder container. (This has BlockActivation() and points activation to PlaceAtMeCopies) This is seemingly what the player is interacting with.
A container to be copied. (CopyMeRef. Hidden out of sight)
An XMarker. (Also hidden out of sight, PlaceAtMe copies spawn here)

Script01 on Placeholder:
Spoiler

Scriptname MDHRelockScript extends ObjectReference{Re-locks a container for the player to train lockpicking against};simply re-locking the container will only give the player experience from the first unlock.Actor Property PlayerRef AutoObjectReference Property CopyMe AutoObjectReference Property TargetMarker AutoGlobalVariable Property MDHOneCopy AutoEvent OnLoad()BlockActivation()EndEventEvent OnActivate(ObjectReference akActionRef)BlockActivation()If akActionRef == PlayerRef  If MDHOneCopy.GetValue() == 0  ObjectReference Dupe = TargetMarker.PlaceAtMe(CopyMe)  MDHOneCopy.SetValue(1)  Dupe.Activate(akActionRef)endif  endifEndEventEvent OnLockStateChanged()  ;fires if the  player attempts to unlock this container by cheatingLock()EndEvent


Script02 on CopyMeRef:

Spoiler

Scriptname MDHRelockScriptChild extends MDHRelockScript{Child Script changes needed global};This script is on MDHRelockScript.CopyMe and gets applied to Dupe as well.Message Property Success AutoObjectReference Property CannotDelete Auto ;it seems my OnCellLoad event is deleting CopyMeRef somehowEvent OnLockStateChanged()	;fires if the  player attempts to unlock this container by cheatingLock()		 ;prevents container from opening after successful lockpick;MDHRelockScript.ClearDupe	;how do I do this???? Might not be necessaryMDHOneCopy.SetValue(0)	;Doesn't seem to fire after Delete(); Success.Show()	   ;Debug  Delete()		;won't delete whilst still property in Parent?EndEventEvent OnCellLoad()	   ; Clean's up remnant copies on cell loadMDHOneCopy.SetValue(0)Delete()		 ;Can have this on CopyMe, won't fire because its still a property and always will be. mwahahaEndEvent


Several Issues. Some are described in script annotations. But I will detail them here:

1st: Simply having Lock() inside an OnLockStateChanged() Event won't continue to give the player experience. D:
2nd: My code won't work if the Player has to close the lockpicking menu without a successful lock pick (see script01)
3rd: Somehow CopyMeRef is getting deleted, this shouldnt happen as the actual object reference "MDHCopyMeRef" is a property in both scripts

Talk about a work-around. When I first tested:
Event OnLockStateChanged()Lock()EndEvent
The heavens parted, I saw the matrix. At least I thought I did. Perhaps my methodology is needlessly complex. Please help.
User avatar
Rudi Carter
 
Posts: 3365
Joined: Fri Sep 01, 2006 11:09 pm

Post » Mon Nov 19, 2012 6:30 pm

Bump
User avatar
Roberta Obrien
 
Posts: 3499
Joined: Tue Oct 23, 2007 1:43 pm


Return to V - Skyrim