It's actually reasonably easy once you know how
There are a couple ways though:
First, if you want the shelf to slide to the left (I don't think you can make it slide to the right), Follow these steps:
1. Make a lever. Call it "Lever". Make it's settings whatever you want.
2. Place the "shelf_secret_door" entity. Name it "Shelf".
3. In the OnStart part of your script, put this:
ConnectEntities("door_connection", //Name of connection
"Lever", //Parent entity (Affects)
"Shelf", //Child entity (Affected)
false, //Invert the state sent
1, //States used (0=both), checked before invertion.
"CreateDust"); //callback
That was copied from the Old Archives level in the actual game - when I put it in mine I removed the comments but that made it not work, so I don't advise it (Even though I probably just messed something up
)
If you want to have the castlebase secret door slide up like in the actual game, put the secret door in the map (It's under "Door"), name it "secret_door" and copy and paste the above script in your OnStart section but change "Shelf" to "secret_door"
Now, If you want the shelf to swing open like in the original game, It's a little bit more complicated. Follow these steps:
1. Make the lever in step 1 above.
2. Make a "shelf_secret_door_rot" entity. Name it Shelf.
3. Make an area at the right side of the shelf (Where it will pivot). Name it "RotateArea".
4. Go into the entity settings of the shelf and under "AngularOffsetArea" make it "RotateArea" with no quotes.
5. Add the above code.
Things to note:
1. If you want to pull the lever up instead of down the easiest way is to change "false" in the script to "true".
2. To make a door like in Justine where you can pull up to open it and down to close it, change the "1" in the script to "0" and turn the lever upside down (At least that's what I had to do).
And you should be done! If I've messed up and the script doesn't work, just tell me. Hope it helps!