Jump to content

Doors: uhm.. how?


reddwarf45

Recommended Posts

I've tried to make doors that open by hitting a switch, like the secret door that leads to vault 101s entrance. I put the door in the gap, made it persistent, spawned a switch (from the activator section) and made the door the reference. But when i try it in game the switch does not work. I tried this with the main vault door as well but no luck. What am i doing wrong? Thanks.
Link to comment
Share on other sites

Attach this to the switch, and the door MUST have an animation (not a load door)

 

Short Open

Begin OnActivate

If Open == 0
  DoorReference.SetOpenState 1
  Set Open to 1
Else
 DoorReference.SetOpenState 0
EndIf

End

 

That way the door is both closed AND opened with the switch. Also, to prevent the player from being able to open/close the door by activating it you want to set the door as Inaccessable.

Link to comment
Share on other sites

To attach a script you need to find the switch you want to use under the World Objects -> Activators menu. From there, you need to create a duplicate of it (Right click, Edit, change the ID, say Okay and YES to make a new form) Then, find you duplicated switch, right click, edit, then look for where it says Script with a dropdown box. Click the button with the ellipsis (...) to bring up the script editing. From there, go to File New, type in your script, and save. then find the script name in the dropdown and select it then say Okay. If it's not there you'll probably have to close the base editing, open it up again and then check the dropdown box once more. If that still doesn't work then you didn't save the script properly.

 

Oh, and looking back I made a slight error in that script. You need to add a Set DoOnce to 0 after the Ref.SetOpenState to 0 line so the door can be reopened by activating the switch again.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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