Lever to open zoning door crosscell reference

Post » Wed Jun 20, 2012 6:09 am

Hey modders!

My problem sounds more complex than it is. I want a zoning door to be initially inaccessible or "locked and cant be picked" and made accessible or unlocked by using a lever in a different cell.

The idea is pretty simple but I couldnt firgure the script out yet.





My first idea was looking like this: Going from inaccessible to accessible seems to be easier than from "cant be picked" to "unlocked".
Have the door initially inaccessible and the use of the lever (onaction) makes inaccessible become false. (or accessible = true). The reference itself shouldnt be the problem.


Does anyone have a more "precise" solution?

Cheers!
User avatar
Brandon Bernardi
 
Posts: 3481
Joined: Tue Sep 25, 2007 9:06 am

Post » Wed Jun 20, 2012 8:08 am

On 'init' you can call 'BlockActivation()' on the door. So this INIT would be attached to the door as a script.

 Scriptname EntranceDoor extends ObjectReference Event OnInit()  BlockActivation()  Debug.messagebox("Door initalized as blocked")endEvent


On the lever, you would have as part of its activate script,
You will need to add a property reference to the script to point to your door. (I called it 'myDoorREF' in the script below)
 	myDoorREF.BlockActivation(false)	Debug.messagebox("Door changed to unblocked")
User avatar
barbara belmonte
 
Posts: 3528
Joined: Fri Apr 06, 2007 6:12 pm

Post » Wed Jun 20, 2012 3:55 am

Its as easy as that! Thanks for the answer, sir!
User avatar
Daddy Cool!
 
Posts: 3381
Joined: Tue Aug 21, 2007 5:34 pm

Post » Tue Jun 19, 2012 11:19 pm

That assumes the player has 'loaded' the blocked door in their game BEFORE they activate the lever. Otherwise, when the door is loaded, it will become blocked again.
User avatar
Laura Mclean
 
Posts: 3471
Joined: Mon Oct 30, 2006 12:15 pm

Post » Wed Jun 20, 2012 12:53 am

The player will run past the locked door before he gets the chance to use the lever. Will this be sufficient?
User avatar
Justin Hankins
 
Posts: 3348
Joined: Fri Oct 26, 2007 12:36 pm

Post » Wed Jun 20, 2012 10:14 am

yes, the door would then be loaded.
But it will be blocked everytime the door is loaded. If you want it to remain open, you can set a variable in the script.

Scriptname EntranceDoor extends ObjectReferenceint myStateEvent OnInit()   if myState == 0	  myState = 1	  BlockActivation()   endifendEvent
User avatar
Michael Korkia
 
Posts: 3498
Joined: Mon Jul 23, 2007 7:58 pm


Return to V - Skyrim