ill tonkso Posted March 10, 2011 Share Posted March 10, 2011 (edited) HelloI am working on a small puzzle where the player has to deactivate all of the lights in a room to open a door. I have all the lights linked into switches (6 in total) so the player can switch them all off individually but I cannot for the life of me work out how to make this open the door?Can anyone please help me? This is actually for an MSC project :s Thanks, Dan Edit: I just put this in the wrong subforum... sorry. Edited March 10, 2011 by ill tonkso Link to comment Share on other sites More sharing options...
Skevitj Posted March 10, 2011 Share Posted March 10, 2011 I can't remember if this method works: but it should be possible to just script the door, such that there is a game mode block which will open it when all the light's references check as disabled, and close it otherwise. An onactivate block would also be needed to stop the PC from just opening it manually, unless it was key locked, and it is unlocked and opened simultaneously and closed and locked simultaneously. Link to comment Share on other sites More sharing options...
ill tonkso Posted March 10, 2011 Author Share Posted March 10, 2011 I can't remember if this method works: but it should be possible to just script the door, such that there is a game mode block which will open it when all the light's references check as disabled, and close it otherwise. An onactivate block would also be needed to stop the PC from just opening it manually, unless it was key locked, and it is unlocked and opened simultaneously and closed and locked simultaneously. Thanks for your reply but I do not understand. It is also the alyied ruins secret door (the three moving stones thing) if that helps, as opposed to a conventional door. I am slowly learning the script but there is a lot to take in. Link to comment Share on other sites More sharing options...
ill tonkso Posted March 10, 2011 Author Share Posted March 10, 2011 I got it working, this is the script if anyone is interested. So simple! scn ITSMSCLightPuzzleDoor short openshort busy begin gameMode if rtutlight1.getDisabled == 1 && rtutlight2.getDisabled == 1 && rtutlight3.getDisabled == 1 && rtutlight4.getDisabled == 1 && rtutlight5.getDisabled == 1 && rtutlight6.getDisabled == 1;Conditions check to ensure the lights in the scene are disabled.disable;disables the door mesh (out of players view)elseenableendifend I didn't need to worry about the mesh suddenly disappearing because it is out of the player view, though I will be trying this script with the animation call. Link to comment Share on other sites More sharing options...
MarkInMKUK Posted March 11, 2011 Share Posted March 11, 2011 (edited) I'm no scripter, but based on usual programming, would this work? scn ITSMSCLightPuzzleDoor short openshort busy begin gameMode if (rtutlight1.getDisabled && rtutlight2.getDisabled && rtutlight3.getDisabled && rtutlight4.getDisabled && rtutlight5.getDisabled && rtutlight6.getDisabled);i.e. anything non-zero in all of those;Conditions check to ensure the lights in the scene are disabled.disable;disables the door mesh (out of players view)elseenableendifend Of course, I could just be displaying my ignorance ... but if it's like C, the bracketed function should be faster and less memory hungry than the previous version Edited March 11, 2011 by MarkInMKUK Link to comment Share on other sites More sharing options...
ill tonkso Posted March 14, 2011 Author Share Posted March 14, 2011 I shall try it, thanks. Always up for a bit of optimisation! Link to comment Share on other sites More sharing options...
Recommended Posts