ionoblivion Posted May 22, 2016 Share Posted May 22, 2016 (edited) 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. Edited May 22, 2016 by ionoblivion Link to comment Share on other sites More sharing options...
ionoblivion Posted May 22, 2016 Author Share Posted May 22, 2016 It is about a electric panel to unlock a door... Link to comment Share on other sites More sharing options...
MalachiDelacot Posted May 22, 2016 Share Posted May 22, 2016 This area of the forums is for discussing various subjects, not specific game or mod problems. You should try posting in https://forums.nexusmods.com/index.php?/forum/180-oblivion-mod-troubleshooting/ Link to comment Share on other sites More sharing options...
Surilindur Posted May 22, 2016 Share Posted May 22, 2016 (edited) Ah. Whoops. I already answered that same question here, where you also had it posted (in addition to the general discussion section). If someone finds the comment by Malachi Delacot a bit odd, it is because this thread was apparently moved here from a general (very, very general) discussion section not specific to any game. Now that the comment still remains, and the thread has already been moved, it does look interesting. :tongue: Here is the answer I managed to come up with, copy-pasted from the other thread: 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 EndTo make that work, you need torename the script and add it to your modmake the panel base object an activatorset the script of the activator base object to that oneplace one panel in the game worlddouble-click on the panel ref in the world, and set its Enable Parent to the doorLock command here: http://cs.elderscrolls.com/index.php?title=LockUnlock command here: http://cs.elderscrolls.com/index.php?title=UnlockGetLocked 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 May 22, 2016 by Contrathetix Link to comment Share on other sites More sharing options...
ionoblivion Posted May 22, 2016 Author Share Posted May 22, 2016 Thanks for your reply. My intention is to unlock a door with a numeric code ( example 7133 ) via an electrical keypad panel. So to unlock a door you need to type this code numbers in that keypad. Link to comment Share on other sites More sharing options...
Surilindur Posted May 22, 2016 Share Posted May 22, 2016 (edited) No problem. Now that sort of input would require more scripting. The first three most obvious solutions would be these:make each button a separate activator, and move the "input check" into the door itself use messageboxes, with one button for each number, and the box displayed X times in a row, with the "input check" in the door itself instead of separate buttons, use the OBSE user text input, and have player input the whole set as a stringNumber 1 might be the best one, maybe, if you want the buttons to be sort of "clickable". It would mean quite a few buttons, but I have an idea. Maybe something like this:the door keeps a list (an array) of button references in the "correct" order (the array can be built in an OnLoad block, maybe)each button checks from the door to see if the correct ref has been activated, as well as advances an index if it was the correct one (maybe also makes a sound if it was not the correct one?)when all refs in the array have been clicked in the right order, the door would unlockI need to test a little myself, then I might be able to suggest something. An interesting idea that panel. Edited May 22, 2016 by Contrathetix Link to comment Share on other sites More sharing options...
ionoblivion Posted May 22, 2016 Author Share Posted May 22, 2016 I want chose the first solution, with many buttons that you can press, but you must press the corresponding order code ( again example 7133 ). If you press other number you lose all building code and you have to start again with the first number. I dont't know what script to use, i think is hard to make that in Oblivion. Anyway, thank you Contrathetix! Link to comment Share on other sites More sharing options...
Surilindur Posted May 23, 2016 Share Posted May 23, 2016 (edited) Okay, I managed to come up with some sort of a solution, or more like an example. The example works like this:there are nine separate activator base objects, each has the number as the name (like "1", "2", etc.)one door, a persistent reference, with a door scripton the door script, a String_var holds the correct "code", and an index variables keeps track of the current index in that stringwhen a button is clicked, the script compares the name of the clicked button to the symbol at the current index of the key, if they match, it moves forwards, if not, the index returns to the startif the index reaches the last symbol of the code, the door is unlockedThe example plugin should be attached on this post as an attachment here: You can get in the test cell with this console command: coc FurphyCellThe scripts require OBSE, and I would recommend using the Construction Set Extender by shademe, because at least that should work. It is also a huge improvement over the normal CS in general: http://www.nexusmods.com/oblivion/mods/36370/ Here is the button script: ScriptName FurphyButtonScript Begin _OnActivate PlayerRef If Eval ( FurphyDoorRef.sCode[FurphyDoorRef.iIndex] == GetName ) let FurphyDoorRef.iIndex += 1 Message "Right button!" If Eval ( FurphyDoorRef.iIndex > ( ( sv_Length FurphyDoorRef.sCode ) - 1 ) ) FurphyDoorRef.Unlock FurphyDoorRef.PlaySound3D DRSLockOpen Message "The door has been unlocked!" EndIf Else let FurphyDoorRef.iIndex := 0 PlaySound3D CMetalSmall Message "Wrong button!" EndIf End And here is the door script: ScriptName FurhpyDoorScript String_var sCode Int iIndex Begin _OnLoad let sCode := "7133" let iIndex := 0 End Hopefully that helps a little. Making that work was an interesting task, definitely enjoyed it. The project sounds interesting, and I wish you the best of luck with it. :thumbsup: Edited May 23, 2016 by Contrathetix Link to comment Share on other sites More sharing options...
ionoblivion Posted May 23, 2016 Author Share Posted May 23, 2016 Thank you man, i will try that. If i am successful i will annnounce you... Link to comment Share on other sites More sharing options...
Recommended Posts