scn GenericControlPodScript;See V112 for generic setup.short moderef myLinkbegin onActivateif IsActionRef player == 1 set myLink to getLinkedRef ;the linked ref should be the door. if ((myLink.getOpenState == 3) || (myLink.getOpenState == 1)) && mode != 2 ;door closed or open playgroup Forward 0 ;pull handle out set mode to 2 activate myLink ;activate all the things that this is an activate parent of - klaxon light and activator. endifendifendbegin gameModeif (mode == 2) if (isAnimPlaying == 0) set myLink to getLinkedRef ;the linked ref should be the door. playgroup Left 1 ;pull handle down set mode to 3 myLink.activate player endifendifend
Then someone suggested this script which sort of works but the door can still be activated directly and there are no control panel animations
ScriptName Vault74_door_key_open;Vault74Door;01012627 vault74 keyBegin OnActivate if(Player.GetItemCount 01012627 == 0);Does The player have the key? Return endif if(Vault74Door.GetopenState == 3 && Vault74Door.GetLockLevel == 100);Is the door Closed? Vault74Door.Lock 0 ;Unlock the door Vault74Door.SetopenState 1 ;Open the Door else ;Otherwise Vault74Door.Lock 100 ;Relock the door Vault74Door.SetOpenState 0 ;Close The Door endifEnd
Does anyone know what i would need to combine the two?
EDIT: ive done this:
ScriptName Vault74_door_key_open;Vault74Door;01012627short moderef myLinkbegin onActivate if IsActionRef player == 1 if(Player.GetItemCount 01012627 == 0);Does The player have the key? Return endif set myLink to getLinkedRef ;the linked ref should be the door. if ((myLink.getOpenState == 3) || (myLink.getOpenState == 1)) && mode != 2 ;door closed or open playgroup Forward 0 ;pull handle out set mode to 2 activate myLink ;activate all the things that this is an activate parent of - klaxon light and activator. endif endifendbegin gameMode if (mode == 2) if (isAnimPlaying == 0) set myLink to getLinkedRef ;the linked ref should be the door. playgroup Left 1 ;pull handle down set mode to 3 myLink.activate player endif endifendwhich works and only allows me to open the door with the control pod and key but i have to add the control panel as a parent activate and set it to parent activate only to stop you clicking on the door and it opening. Is that the best way to do it? does seem a bit sloppy