atlanticslamon Posted June 18, 2011 Share Posted June 18, 2011 basically I'm making a house mod where all the rooms/storage are hidden behind the SI expansion 'secret walls' found in numerous dungeons. The problem is, the scripts for these doors are one-way only; you can open them, but not close them, atleast until the dungeon resets. Unofrtunately, I'm pretty awful at scripting, thus don't know how to write an appropriate script to do so. (I have enouhg knowledge about scripting to get a rough Idea of what some scripts do, but not enouhg to write my own). The script used for the base secret wall is as follows: scn RuinsTRAPSecretWallSCRIPT short init short busy short open short next float timer ref mySelf ref myParent begin onActivate set mySelf to getSelf set myParent to getParentRef if isActionRef player == 0 && isActionRef myself == 0 && busy == 0 if open == 0 playgroup forward 0 set open to 1 enableLinkedPathPoints else playgroup backward 1 set open to 0 disableLinkedPathPoints endif set next to 1 set busy to 1 set timer to 1 endif end begin gameMode if init == 0 ; set up ref vars set mySelf to getSelf set myParent to getParentRef ; prepare linked pathsgrid points disableLinkedPathPoints set init to 1 endif ; daisy-chain activation if next == 1 && timer <=0 set next to 0 myParent.activate mySelf 1 endif if isAnimPlaying == 0 && busy == 1 set busy to 0 endif if timer > 0 set timer to timer - getSecondsPassed endif end begin onReset reset3DState ;set open to 0 set next to 0 set busy to 0 disableLinkedPathPoints end Could some take the time to explain exactly how this script works and/or what changes I would need to make to make it do what I want? Cheers Link to comment Share on other sites More sharing options...
atlanticslamon Posted June 18, 2011 Author Share Posted June 18, 2011 Just to clarify, the code I posted is bethesda's original code for generic secret walls. Link to comment Share on other sites More sharing options...
HeyYou Posted June 18, 2011 Share Posted June 18, 2011 It looks like it should close the door, when you activate it again.... There is a timer, but, it is only one second...... Link to comment Share on other sites More sharing options...
fg109 Posted June 18, 2011 Share Posted June 18, 2011 (edited) The problem is, the player can't open or close the door. If you take out the condition "isActionRef player == 0", it'll work... But looking in the Construction Set, the doors are only supposed to be opened when you push a button. So, are you trying to activate the door directly, or through the button like in the vanilla game? If you want to do it through the button, you'll need to change the button's script: From:scn RuinsButtonBothDoOnceSCRIPT ; Activates parent immediately & only works once, hence the creative name. short triggered ref mySelf ref myParent begin onActivate if triggered == 0 playgroup forward 0 set mySelf to getSelf set myParent to getParentRef myParent.activate mySelf 1 set triggered to 1 Player.SetCrimeGold 0 endif end begin OnReset reset3DState set triggered to 0 end To: scn RuinsButtonBothDoMoreThanOnceSCRIPT ; Activates parent immediately & works more than once. short triggered short busy ref mySelf ref myParent float timer begin onActivate if (triggered == 0 && busy == 0) playgroup forward 0 set triggered to 1 elseif (triggered == 1 && busy == 0) playgroup backward 1 set triggered to 0 endif set mySelf to getSelf set myParent to getParentRef myParent.activate mySelf 1 set timer to 1 set busy to 1 Player.SetCrimeGold 0 end Begin GameMode if (timer > 0) set timer to timer - GetSecondsPassed elseif (timer <= 0) set busy to 0 endif begin OnReset reset3DState set triggered to 0 end Edited June 18, 2011 by fg109 Link to comment Share on other sites More sharing options...
atlanticslamon Posted June 19, 2011 Author Share Posted June 19, 2011 @fg109 I am trying to open it via a button.@HeyYou It will not close when I activate the button a second time, but it will replay the opening animation certain times I activate it. Link to comment Share on other sites More sharing options...
GreatLucifer Posted June 19, 2011 Share Posted June 19, 2011 I suggest you go ingame, find one of these secret walls, and open console. First, type in "playgroup forward 1". Close the console, and you should now see the door open. Now try the same thing, only with "playgroup backward 1". If it does nothing, or something weird, it has no closing animation... which I suspect to be the case. Link to comment Share on other sites More sharing options...
atlanticslamon Posted June 19, 2011 Author Share Posted June 19, 2011 @greatlucifer unfortunately i'm beginning to supsect that aswell. Link to comment Share on other sites More sharing options...
atlanticslamon Posted June 19, 2011 Author Share Posted June 19, 2011 Just confirmed it has no bakcwards animation.... I am disapoint. Thanks for the help everyone! Link to comment Share on other sites More sharing options...
GreatLucifer Posted June 19, 2011 Share Posted June 19, 2011 Unfortunate indeed, as several vanilla assets seem to suffer from this. But ok, you're welcome and good luck :ninja: Link to comment Share on other sites More sharing options...
Recommended Posts