Jump to content

GECK - Can't get doors to work (Scripts)


terickson227

Recommended Posts

I am currently working on something in the GECK, which I hope to use in game (I have no plans of uploading this). I haven't gotten very far, mostly because I haven't been working on it very long. My experience with the GECK isn't great when it comes to the more complex parts, like scripting. With what I want to do, there is no way around it, so I've looked online for scripts that do more or less what I want them to.

 

What I'm working on is a sort of underground base, which has a hatch placed near Vault 101 to get inside. After that, a large blast door (using a copy of the large entrance door of Raven Rock [RRExtMainEntranceDoor01] ) blocks the entrance, but can be opened by one of two switches, one outside the door and one just past it, similar to the switches that open the Gear Doors of Vault 101 and Vault 112.

 

After that, there is a room that has two other switches. When one switch is activated, it closes doors at both ends, activates 12 fog-like effects, and clears all rads from the Player. Then the door leading inside is supposed to open, while the door leading outside should stay closed. Activating the switch on the other end of the room should do the same thing, but in reverse. I intend this room to be a sort of decontamination chamber.

 

Here are some pictures of what I'm working on:

 

http://img35.imageshack.us/img35/8841/exitdoor.jpg

Door that goes above-ground

 

http://img829.imageshack.us/img829/5894/blastdoor.jpg

Blast Door (from outside)

Currently, the Blast Door is closed when I enter the Bunker (as it should be), but neither switch makes the door open, and the alarm sound is on endlessly.

 

http://img171.imageshack.us/img171/2779/blastdoor2.jpg

Blast Door (from inside)

 

http://img802.imageshack.us/img802/1607/airlockchamber.jpg

Outside the Airlock Chamber

 

http://img641.imageshack.us/img641/1789/airlockchamber4.jpg

Inside the Airlock Chamber, after activating it

NOTE: The doorway in this picture should have a door preventing you from leaving before the process is finished. In reality, it did, but I was able to open it manually during the decontamination process. Neither door should ever be open for any reason if the fog effects are active, and not manually openable by the Player at any time.

 

http://img6.imageshack.us/img6/6133/airlockchamber3.jpg

 

http://img29.imageshack.us/img29/3479/airlockchamber2.jpg

This is what the Player should be seeing. The door is closed, but unlike what should be the case, the door can be opened by the Player.

 

http://img862.imageshack.us/img862/6379/airlockchamber1.jpg

 

 

What I want to happen is this:

1. Player enters Bunker through an exterior hatch, and arrives in front of the Exit Door. Blast Door is closed, Outer Airlock Door is open, and Inner Airlock Door is closed.

2. Player activates a switch that opens the Blast Door, and turns on flashing alarm lights and alarm sounds both in front of and behind the Blast Door.

3. Player walks through the now opening Blast Door. The flashing alarm lights and alarm sounds continue until the Blast Door fully opens.

4. Player walks towards the Airlock Chamber. Blast Door closes automatically about 15 seconds after being opened (with alarm lights and sounds on until the Blast Door ||2|| fully closes)

5. Player enters Airlock Chamber, and presses a switch near the Inner Airlock Door, which closes both the Outer and Inner Airlock Doors (Airlock Doors should always be activated by the switches only, and can't be activated directly by the Player. Switches are inside the Airlock Chamber.)

6. Airlock effects turn on for about 10 seconds, then turn off. The Inner Airlock Door opens, while the Outer Airlock Door remains closed.

7. Player opens a door to the rest of the Bunker (doesn't currently exist)

8. Player returns and enters Airlock Chamber again. Inner Airlock Door is open, Outer Airlock Door is closed.

9. Player activates the switch next to the Outer Airlock Door

10. Both the Inner airlock door and outer airlock door close, and the airlock fog effects turn on again for about 10 seconds.

11. Airlock fog effects turn off, inner airlock door remains closed, outer airlock door opens.

12. Player activates switch next to the blast door, turning on the alarm lights and sounds again, and opening the blast door.

13. Player walks through the Blast Door, while the alarm lights and sounds continue until the door fully opens.

13. Player leaves through the Exit Door, and ends up next to the same hatch they entered the Bunker through.

14. Blast Door automatically starts closing after 15 seconds, with alarm lights and sounds on until the Blast Door fully closes.

NOTE: I want the Blast Door alarm lights and sounds to start the same moment one of the switches is activated, and to stay on until the door is fully open/closed. The Blast Door should start opening/closing about 2-3 seconds after a switch is activated (for effect). To see the general idea I have in mind, activate and watch the large Gear Door of either Vault 101 or Vault 112 open and close. I would use one of these doors, but the doors have their unique gear shape, and they need unique room sections to look right. I'm thinking of more like a single hallway leading into the rest of the Bunker, while the Vault Entrance room section has doors that branch off from the room with the door.

 

 

This is what really happens:

1. Player opens exterior hatch O, and arrives in front of the Exit Door. Blast Door is closed, Outer Airlock Door is open, and Inner Airlock Door is closed.

2. Player activates switch, but Blast Door doesn't open.

NOTE: The Blast Door did work fine before I used any scripting. I simply set the linked references of the two switches to the Blast Door, and it opened and closed as it should have repeatedly. Trying to add scripts, however, for a working visible and audible alarm not only doesn't work, but stops the switches from opening the Blast Door as well.

3. After getting literally through the Blast Door (tcl console command), Player enters the Airlock Chamber, then activates the switch next to the Inner Airlock Door.

4. Outer and Inner Airlock Doors close, but in at least some of the tests both doors could be opened manually and directly by the Player, which should not be possible.

5. Airlock Chamber effects turn on, but once they all stayed on much longer than the 10 seconds they should have (and likely would have remained on forever).

6. Both Airlock Doors reopen at the same time, when only one door (the Inner Door in this case) should open, while the other door remains closed until the opposite switch is activated and the airlock process ends.

7. Player goes back into the Airlock Chamber, and presses the switch next to the Outer Airlock Door (with the same result as Step #6).

8. Player activates switch to open Blast Door, but nothing happens (like Step #2).

NOTE: Once, when I tested the Bunker in-game, the Blast Door was completely open (It should always be closed when first entering the Bunker), and the alarm sounds were on with no signs of stopping. The alarm lights were off.

9. Player leaves the Bunker, and ends up next to the hatch that they entered through.

NOTE: This is the only part that has worked for me (besides the Blast Door before I added scripts), possibly because it is relatively simple. Both the Entrance Hatch and the Exit Door have worked in each test so far.

 

 

Here are the scripts I'm using:

 

Blast Door Script:

ScriptName PreservationBunkerMainBlastDoorScript

BEGIN OnActivate
    IF (IsActionRef player == 1)
         ShowMessage GenericDoorActivatedElsewhereMsg
    ELSE
         Activate
    ENDIF
END

 

Blast Door Switch Script:

ScriptName PreservationBunkerMainBlastDoorSwitchScript

short mode
ref doorRef

BEGIN onActivate
    IF (IsActionRef player == 1 ) ; if the player tries to activate
         ELSEIF ( mode == 1 ) ; unlocked, player can now activate it
              playgroup Left 0
              set mode to 2
         ENDIF
    ELSE
        IF mode == 0
             playgroup Forward 0
             set mode to 1
        ENDIF
        ENDIF
END

BEGIN GameMode
    IF (mode == 2) && (isAnimPlaying == 0)
         set mode to 3
         set DoorRef to GetLinkedRef
         DoorRef.activate DoorRef
    ENDIF

END

 

Alarm Lights (Klaxon Light Script):

scn KlaxonLightScript

short state ; 0 = off, 1 = flashing

BEGIN OnLoad
    IF state == 1 ; If the light is flashing
         playgroup left 0
    ENDIF
END

BEGIN OnActivate
    IF state == 1
         set state to 0
         playgroup backward 0
    ELSE
         set state to 1 ; Make the light start flashing
         playgroup forward 1
    ENDIF
END

BEGIN GameMode
    IF state == 1 ; If the light is flashing
         IF isAnimPlaying == 0
              playgroup left 0
         ENDIF
    ENDIF
END

 

Airlock Door Switch 1 Script:

scn PreservationBunkerAirlock00Script

;ORIGINAL SCRIPT BY Death01 AT [http://forums.nexusmods.com]
;ORIGINAL SCRIPT AT [http://forums.nexusmods.com/index.php?/topic/286595-i-really-need-help-with-a-timer-script/]
;This is an object script.  Use this script on the switch activator, and make sure both doors have
;"Persistent Reference" checked.  Effects references used here are checked as "Persistent Reference" and
;"Initially Disabled."

;You need to run the timer in a game mode block and use the "GetSecondsPassed" function to count down.
;The "Short Shutoff" is used like a flip-flop to shut/open doors and turn effects on and off checking.

;-------------------------------------------------------------------------------------------------------------------------------------------

Float ShowerTime
Short Shutoff

BEGIN GameMode
    IF Shutoff == 1
         IF ShowerTime > 0
              Set ShowerTime to ShowerTime - GetSecondsPassed
                   ELSEIF GetOpenState == 1 ;If the Shower is still on...
                        SetOpenState 3 ;...turn the Shower off.
                        PreservationBunkerDeconMist01.disable
                        PreservationBunkerDeconMist02.disable
                        PreservationBunkerDeconMist03.disable
                        PreservationBunkerDeconMist04.disable
                        PreservationBunkerDeconMist05.disable
                        PreservationBunkerDeconMist06.disable
                        PreservationBunkerDeconMist07.disable
                        PreservationBunkerDeconMist08.disable
                        PreservationBunkerDeconMist09.disable
                        PreservationBunkerDeconMist10.disable
                        PreservationBunkerDeconMist11.disable
                        PreservationBunkerDeconMist12.disable
                        PreservationBunkerAirlockDoorOuter.SetOpenState 0 ;Outer Door is open
                        Set Shutoff to 0
         ENDIF
    ENDIF
END

BEGIN OnActivate
    IF (GetOpenState == 1 || GetOpenState == 3) ;Checks state of Switch
         IF GetOpenState == 3
              Set ShowerTime to 10
              Set Shutoff to 1
              PreservationBunkerAirlockDoorOuter.SetOpenState 0 ;Outer Door is closed
              PreservationBunkerAirlockDoorInner.SetOpenState 0 ;Inner Door is closed
              PreservationBunkerDeconMist01.enable
              PreservationBunkerDeconMist02.enable
              PreservationBunkerDeconMist03.enable
              PreservationBunkerDeconMist04.enable
              PreservationBunkerDeconMist05.enable
              PreservationBunkerDeconMist06.enable
              PreservationBunkerDeconMist07.enable
              PreservationBunkerDeconMist08.enable
              PreservationBunkerDeconMist09.enable
              PreservationBunkerDeconMist10.enable
              PreservationBunkerDeconMist11.enable
              PreservationBunkerDeconMist12.enable
                   ELSE
                        PreservationBunkerDeconMist01.disable
                        PreservationBunkerDeconMist02.disable
                        PreservationBunkerDeconMist03.disable
                        PreservationBunkerDeconMist04.disable
                        PreservationBunkerDeconMist05.disable
                        PreservationBunkerDeconMist06.disable
                        PreservationBunkerDeconMist07.disable
                        PreservationBunkerDeconMist08.disable
                        PreservationBunkerDeconMist09.disable
                        PreservationBunkerDeconMist10.disable
                        PreservationBunkerDeconMist11.disable
                        PreservationBunkerDeconMist12.disable
                        PreservationBunkerAirlockDoorInner.SetOpenState 1 ;Inner Door is open
         ENDIF
    Activate
    ENDIF
END

 

Airlock Door Switch 2 Script:

scn PreservationBunkerAirlock01Script

;ORIGINAL SCRIPT BY Death01 AT [http://forums.nexusmods.com]
;This is an object script.  Use this script on the switch activator, and make sure both doors have
;"Persistent Reference" checked.  Effects references used here are checked as "Persistent Reference" and
;"Initially Disabled."

;You need to run the timer in a game mode block and use the "GetSecondsPassed" function to count down.
;The "Short Shutoff" is used like a flip-flop to shut/open doors and turn effects on and off checking.

;-------------------------------------------------------------------------------------------------------------------------------------------

Float ShowerTime
Short Shutoff

BEGIN GameMode
    IF Shutoff == 1
         IF ShowerTime > 0
              Set ShowerTime to ShowerTime - GetSecondsPassed
                   ELSEIF GetOpenState == 1 ;If the Shower is still on...
                        SetOpenState 3 ;...turn the Shower off.
                        PreservationBunkerDeconMist01.disable
                        PreservationBunkerDeconMist02.disable
                        PreservationBunkerDeconMist03.disable
                        PreservationBunkerDeconMist04.disable
                        PreservationBunkerDeconMist05.disable
                        PreservationBunkerDeconMist06.disable
                        PreservationBunkerDeconMist07.disable
                        PreservationBunkerDeconMist08.disable
                        PreservationBunkerDeconMist09.disable
                        PreservationBunkerDeconMist10.disable
                        PreservationBunkerDeconMist11.disable
                        PreservationBunkerDeconMist12.disable
                        PreservationBunkerAirlockDoorInner.SetOpenState 1 ;Inner Door is open
                        Set Shutoff to 0
          ENDIF
    ENDIF
END

BEGIN OnActivate
    IF (GetOpenState == 1 || GetOpenState == 3) ;Checks state of Switch
         IF GetOpenState == 1
              Set ShowerTime to 10
              Set Shutoff to 1
              PreservationBunkerAirlockDoorOuter.SetOpenState 0 ;Outer Door is closed
              PreservationBunkerAirlockDoorInner.SetOpenState 0 ;Inner Door is closed
              PreservationBunkerDeconMist01.enable
              PreservationBunkerDeconMist02.enable
              PreservationBunkerDeconMist03.enable
              PreservationBunkerDeconMist04.enable
              PreservationBunkerDeconMist05.enable
              PreservationBunkerDeconMist06.enable
              PreservationBunkerDeconMist07.enable
              PreservationBunkerDeconMist08.enable
              PreservationBunkerDeconMist09.enable
              PreservationBunkerDeconMist10.enable
              PreservationBunkerDeconMist11.enable
              PreservationBunkerDeconMist12.enable
                   ELSE
                        PreservationBunkerDeconMist01.disable
                        PreservationBunkerDeconMist02.disable
                        PreservationBunkerDeconMist03.disable
                        PreservationBunkerDeconMist04.disable
                        PreservationBunkerDeconMist05.disable
                        PreservationBunkerDeconMist06.disable
                        PreservationBunkerDeconMist07.disable
                        PreservationBunkerDeconMist08.disable
                        PreservationBunkerDeconMist09.disable
                        PreservationBunkerDeconMist10.disable
                        PreservationBunkerDeconMist11.disable
                        PreservationBunkerDeconMist12.disable
                        PreservationBunkerAirlockDoorOuter.SetOpenState 3 ;Outer Door is open
         ENDIF
    Activate
    ENDIF
END

 

I didn't make any of these scripts. I found some of them used with already existing areas in the GECK, and I found other ones online. I changed most of them to include the RefIDs of the doors, etc. I hope all this makes sense, but if not, please ask me what else you need to know.

 

Thanks.

Edited by terickson227
Link to comment
Share on other sites

  • 2 months later...
I did not take the time to read the scripts through. However, what you're looking for is the Activate Parent option in the ref objects (the ones placed in the cell). Take a look at the Vault 101 door and controls for a good example of how it's set up. But that setup will give you the message "This object(?) is activated somewhere else".
Link to comment
Share on other sites

  • Recently Browsing   0 members

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