Jump to content

Recommended Posts

  • Members
  • bullet_black.png
  • 13 posts
I want to do a mod in Oblivion similar with Silent Hill game . I'm good at 3D modeling and textures , but i don't know how to use an electric panel to lock a door . I need a script , I tried through a quest but i faild . If someone know that, please help me and i will credit you for that.

 

Link to comment
Share on other sites

You can use an OnActivate block. Here is an example script (rename it!):

ScriptName PanelTest

ref rDoor

Begin OnActivate PlayerRef
    set rDoor to GetParentRef
    If ( rDoor )
        If ( rDoor.GetLocked )
            rDoor.Unlock
            Message "The door has been unlocked."
        Else
            rDoor.Lock 100
            Message "The door has been locked tight."
        EndIf
    EndIf    
End

To make that work, you need to

  • rename the script and add it to your mod
  • make the panel base object an activator
  • set the script of the activator base object to that one
  • place one panel in the game world
  • double-click on the panel ref in the world, and set its Enable Parent to the door

Lock command here: http://cs.elderscrolls.com/index.php?title=Lock

Unlock command here: http://cs.elderscrolls.com/index.php?title=Unlock

GetLocked command here: http://cs.elderscrolls.com/index.php?title=GetLocked

 

No need to give any credit, anyone could answer that. It is pretty basic. And that only works for the static doors. If you want a door that swings, then the door model needs to be reset to closed state when locked.

Edited by Contrathetix
Link to comment
Share on other sites

  • Recently Browsing   0 members

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