Jump to content

Linking a secret door to lights.


ill tonkso

Recommended Posts

Hello

I 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 by ill tonkso
Link to comment
Share on other sites

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

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

I got it working, this is the script if anyone is interested. So simple!

 

scn ITSMSCLightPuzzleDoor

 

short open

short 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)

else

enable

endif

end

 

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

I'm no scripter, but based on usual programming, would this work?

 

scn ITSMSCLightPuzzleDoor

 

short open

short 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)

else

enable

endif

end

 

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 by MarkInMKUK
Link to comment
Share on other sites

  • Recently Browsing   0 members

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