Elevator
Showcase of my elevators that you can use in your own maps.
It has a button panel in elevator cabin which allows you to enter any floor number and displays the current floor. You can also call the elevator to any floor by pressing the up/down buttons on that floor.
As seen in my Acacia Apartments map.
https://steamcommunity.com/sharedfiles/filedetails/?id=2498343049
- Make a local copy of this project then copy the "elevator" folder into your own project.
- Create a script node in the scene and set the file to "MOD/elevator/elevator.lua". All elevator components must go under this node. Set param0 to "id=1", see note below.
- Add a cabin instance (MOD/elevator/cabin.xml) under the script node.
- Add one or more floor instances (MOD/elevator/floor.xml) for each floor the elevator should stop at. The floor instance also contains the doors and buttons for that floor.
- Make sure the back wall of the elevator shaft is no more than 2 or 3 voxels (0.2-0.3 meters) away from the back of the cabin. Any further and the motor joint won’t attach. However, in that case you can can move the joint to a better position.
- Enjoy!
NOTE: The "id" script parameter is to associate the elevator script (elevator.lua) with the cabin’s button panel script (elevator-screen.lua). The id here is set to "1".
To have more than one elevator in a map, you will need to copy the cabin.xml prefab then edit it and find the "numpad" screen node. Set it’s "id" tag to something else (e.g. "2"). Then set the second script "id" param to the same value.
I will look at making this easier in the future.
NOTE2: Riding in the elevator is very bumpy, but I think that’s just due to Teardown’s physics engine. There doesn’t seem to be anything I can do about it.
Credit to MrFox2000 A.K.A Deffcolony for the elevator motor sound.