ryuuki Posted October 23, 2010 Share Posted October 23, 2010 Hey all I'm playing with GECK for the first time and been following the tutorials by Bethesda on how to use it. I've got enough knowledge now to set up, light and clutter a new area and provide access points from the world to the new area. What I'm trying to do is build a custom player home with a sort of high security feel. My aim is to create a short quest to provide the player with a keycard that gives them access to this new area. The idea is that inside a cave there is a secured heavy door that is locked and needs the keycard to open. Now I can get that working fine without any problems. However, what I REALLY want is for the door not to open by a player activating it directly, but to have a control panel to the side of the door that the player has to activate while in possession of the keycard in order to unlock and open the door. I've been at it for hours now and no amount of googling has provided any breakthroughs. Could someone please provide some help? I never even suspected it was so complicated just to get a switch to unlock and open a door >_< Any help would be very much appreciated. Link to comment Share on other sites More sharing options...
BEArbiter Posted October 23, 2010 Share Posted October 23, 2010 ScriptName OpenMe ;DoorRef: Persitent Reference of the door ;KeyReference Geck ID of the item Begin OnActivate if(Player.GetItemCount keyReference == 0);Does The player have the key? Return endif if(DoorRef.GetOpenState == 3 && DoorRef.GetLockLevel == 100);Is the door Closed? DoorRef.Lock 0 ;Unlock the door DoorRef.SetopenState 1 ;Open the Door else ;Otherwise DoorRef.Lock 100 ;Relock the door DoorRef.SetOpenState 0 ;Close The Door endif EndIf the door is teleporting the player:ScriptName OpenMe ;DoorRef: Persitent Reference of the door ;KeyReference Geck ID of the item Begin OnActivate if(Player.GetItemCount keyReference == 0);Does The player have the key? Return endif if(DoorRef.GetLockLevel == 100);Is the door Locked? DoorRef.Lock 0 ;Unlock the door else ;Otherwise DoorRef.Lock 100 ;Relock the door endif End Link to comment Share on other sites More sharing options...
ryuuki Posted October 23, 2010 Author Share Posted October 23, 2010 ScriptName OpenMe ;DoorRef: Persitent Reference of the door ;KeyReference Geck ID of the item Begin OnActivate if(Player.GetItemCount keyReference == 0);Does The player have the key? Return endif if(DoorRef.GetOpenState == 3 && DoorRef.GetLockLevel == 100);Is the door Closed? DoorRef.Lock 0 ;Unlock the door DoorRef.SetopenState 1 ;Open the Door else ;Otherwise DoorRef.Lock 100 ;Relock the door DoorRef.SetOpenState 0 ;Close The Door endif EndIf the door is teleporting the player:ScriptName OpenMe ;DoorRef: Persitent Reference of the door ;KeyReference Geck ID of the item Begin OnActivate if(Player.GetItemCount keyReference == 0);Does The player have the key? Return endif if(DoorRef.GetLockLevel == 100);Is the door Locked? DoorRef.Lock 0 ;Unlock the door else ;Otherwise DoorRef.Lock 100 ;Relock the door endif End Thanks for the reply. Where is that I enter these scripts? Link to comment Share on other sites More sharing options...
BEArbiter Posted October 23, 2010 Share Posted October 23, 2010 ouch >< - You create a new script and put one of these (change the name (OpenME) to something like ESPNAME_Secure_Door_Script)- Go to your door (in the Cell and add a Persitent Reference)- Change the Persitent Reference of the script (DoorRef) to the one you made.- Save the script- Create A New activator (Clone existing One).- In the script option, Choose the script. Enjoy Link to comment Share on other sites More sharing options...
ryuuki Posted October 23, 2010 Author Share Posted October 23, 2010 Thanks again :) I will try this in the morning (sorry i'm a total noob at this and Bethesda's tutorials weren't much use for that) Link to comment Share on other sites More sharing options...
BEArbiter Posted October 23, 2010 Share Posted October 23, 2010 Be Carefull and make a backup before if you'r not sure of what you are doing ^^. Link to comment Share on other sites More sharing options...
ryuuki Posted October 24, 2010 Author Share Posted October 24, 2010 I'm not sure if I'm doing something wrong but it seems I can't save my script. I create a new one (tried clicking the little pencil button at the top, and right clicking in Scripts in the object window and pressing new) typed in the script, tried copying and pasting too, then hit the save button and nothing happens. When i close the window it asks "Do you want to save the current script? Current = " Yes or No. If i hit yes nothing happens and my script window stays on screen. If i hit no it goes away. Even if I hit yes it isn't saved. Any idea what's going on here? Link to comment Share on other sites More sharing options...
BEArbiter Posted October 24, 2010 Share Posted October 24, 2010 I'm sure you have a problem with The persistent Reference.Be sure to do this:- Right click on the door (the one you have in cell view pannel).- click edit- under "Reference Editor ID" put something like ESPNAME_MyDoor- Be sure that you have checker Persitant reference.- Copy paste The refenrence in the script (Note: If it don't save, it's because you've made an error, I checked the code Several Times. so I'm sure it's working. stay the reference name of the door) Link to comment Share on other sites More sharing options...
ryuuki Posted October 24, 2010 Author Share Posted October 24, 2010 I'm still not sure what I'm doing wrong. Persistence is checked.The door ID is: BLACKLAIRHubThe key ID is: BlackLairKeycard1 So the script should look like this? ScriptName BlackLairHub_Open ;BLACKLAIRHub ;BlackLairKeycard1 Begin OnActivate if(Player.GetItemCount BlackLairKeycard1 == 0);Does The player have the key? Return endif if(BLACKLAIRHub.GetOpenState == 3 && BLACKLAIRHub.GetLockLevel == 100);Is the door Closed? BLACKLAIRHub.Lock 0 ;Unlock the door BLACKLAIRHub.SetopenState 1 ;Open the Door else ;Otherwise BLACKLAIRHub.Lock 100 ;Relock the door BLACKLAIRHub.SetOpenState 0 ;Close The Door endif End It's still not saving, I've tried loads of combinations and It still won't work. I'm really sorry for the noobness, I'm very new at scripting, never really done it before. Link to comment Share on other sites More sharing options...
BEArbiter Posted October 24, 2010 Share Posted October 24, 2010 Are you sure that the "persitent reference" box is checked? Link to comment Share on other sites More sharing options...
Recommended Posts