Jump to content

Automatic door in GECK


grandpauj1

Recommended Posts

It really doesn't matter if the door is unlocked via a terminal, lockpick, keys, switch or whatever, using the above script will close and lock the door.

 

That said, you'll need to make sure that the terminal takes the script into account. For example, the terminal option to unlock the door will need to use a condition that checks if the door is locked. Obviously, if the door is in an open or unlocked state, that option should not appear to the player. You will also want to use the 'Force Redraw' flag on the lock (or unlock) menu item(s). Using this flag forces the game to reassess the available menu options. This has the effect of removing or adding new menu options immediately to the menu after an option has been chosen when choosing that option changes the conditions for other options - such as unlocking a door. Another words, without using the force redraw flag, the option to unlock the door will still appear in the menu immediately after the player chooses to unlock it - and that makes no sense. It is worth noting that this effect only works while the player is still within the terminal menu. Once he leave and returns, all the conditions will automatically be reassessed.

 

Another useful terminal tool is the ForceTerminalBack function. Place this code in the results script of a terminal menu item and it will force the terminal back up one level in a nested menu (a menu with a sub-menu, where choosing one menu item starts a whole second terminal sub-menu). If you place ForceTerminalBack in the top menu, it will force the player out of the terminal menu and back into the game.

 

As to locking a door via terminal, that requires a lock option on the terminal that uses a condition that is mutually exclusive to the unlock option - that means when the lock option is available, the unlock isn't and visa-versa. This is where the force redraw comes into play.

 

To lock the door manually, you'd have to intercept the activation of the door (use an OnActivate player block) and script an option for the player to choose (if the conditions are met that the door is truly unlocked) that then fires off a bit of code to relock the door. Personally, I would use a switch or terminal entry instead of making a more complicated scripted door menu system.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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