Jump to content

Door locking


jakep

Recommended Posts

Hello.

 

I'm having some trouble getting a door to lock after it has been closed via a terminal.

I don't know if the Fo3 Geck differs a lot from The Nw geck but I followed this tip posted a year(ish) ago:

 

 

Posted 23 July 2010 - 09:54 AM by pkleiss

 

Make your door persistent and give it an Editor ID. Make two entries on your terminal, One for opening it , one for closing it. Tick the force redraw for both as you have surmised. Now, you are going to add a condition on each of the terminal entries. For the one that will open the door, right click in the conditions box and select new. Find "GetOpenState". Set the "value" to 3 (that means its closed). Then in the "Run On" drop down box, select "Reference". Then click on the "Select" button and move your red cross-hair over the door. When the cross-hair turns white, double click to make the door the reference to run this condition on. You may have to adjust your render window first so that the door will be in view to do this step. Now, click OK to add this condition to your menu choice. Next, right click on the condition you just added and select "Copy Condition", then paste it into your "Close" terminal entry. Then double click on the pasted condition and change the "Value" to 1 (this means open). Now, in the results script for your "Open" entry, type in the the following:

 

"MyDoorRef.SetOpenState 1" where "MyDoorRef" is replaced with the Editor ID of your door.

Do the same with the "Close" entry, but use a value of "0" instead.

 

That's it. If you did it all correctly, your terminal will open and close the door and you will only see one option at a time.

 

There is one caveat though. GetOpenstate will also return a different value for when the door is opening (not opened nor closed) and when it is closing. So you may want to add this line to the end of each results script:

 

ForceTerminalBack

 

That will force the player out of the terminal and give the door time to animate. Then activating the terminal again, will display the proper entry. But it is not really necessary as the door won't animate until the player is out of the terminal anyway as the game pauses while the player is using the terminal.

 

I Followed these instructions and i worked like a charm, so all i want the door to do, is to lock after it has been closed again.

Link to comment
Share on other sites

all i want the door to do, is to lock after it has been closed again.

 

i dont think it can be done with the terminal script alone..

 

you need a gamemode block to be running a timer update on every frame or to run conditional to check if its closed.

i have a script that does this but the work is all done through a hidden activator that just serves as a place for script to run from.

 

 

SCN SUBdoordisabler

int specialactivate

Begin OnTriggerLeave Player
SUBgolddoorREF01.setOpenState 0
set specialactivate to 1
END

Begin OnTriggerEnter Player
SUBgolddoorREF01.unlock
END

Begin Gamemode
if ( specialactivate == 1 ) && ( SUBgolddoorREF01.GetOpenState == 3 )
	SUBgolddoorREF01.lock 120
	set specialactivate to 0
endif
END

 

it used a trigger box to determine what need to happen but it can be modified to work for what you need.

which ive done here:

SCN AAAdoorLOCKER

int specialLOCK
ref meREF

Begin Gamemode
set meREF to getLinkedRef
if ( specialLOCK == 1 ) && ( meREF.GetOpenState == 3 )
	meREF.lock 100
	set specialLOCK to 0
endif
END

 

so for this to work you need to make a new activator. but first make a new script and save the one above. make the activator, select that script, place the activator somewhere near the door, open the ref and set the linked ref to the door. give the activator a refid and this is how you'll control it:

 

in your terminal you'll use the refID to change the variable that causes the door to lock: specialLOCK

so lets say you've named the activator's ref AAAspeciallockactivatorREF

in you're terminal you should use the line:

set AAAspeciallockactivatorREF.specialLOCK to 1

 

the variable will toggle on to lock the door whenever that variable is set and then toggle itself back off so it can happen repeatedly.

Edited by angelwraith
Link to comment
Share on other sites

Ok i'm testing it out now, but an activator can be like a terminal or a switch? as long as it's interactive?

 

world objects->activator

 

make a new one.. the model you use doesnt matter i usually go for an initially disables xmarker, in case i need to find it.

 

you can use the terminal to trigger it but not run it.

 

i think... im not sure but i do know terminals deal with menumode rather than gamemode so no do not use a terminal.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...