Page 1 of 1

An Elevator

Posted: July 9th, 2008, 10:23 pm
by Soviet
I want to create an advanced elevator, but unfortunately I have no idea how to go about it. I was hoping someone (drofder) could help me out. First, it needs to be a two-way elevator that goes from story 1 to story 2 and back. Each level needs to have an outer button that can be pressed to call the elevator to that level and open the door. When the person is inside the elevator there should be 2 buttons. One for the top story, one for the bottom story. If the door is open, pressing the button to go down/up once should close the door. Pressing it a second time should make the elevator go down/up and open the door on the other floor. If the door is closed and you press the button for the floor you are on, it should open the door.

Is this possible, reasonable, and are there any ways to simplify it?

Re: An Elevator

Posted: July 9th, 2008, 11:47 pm
by Drofder2004
Yep, KS has it spot on.
Each level make a vairable
elevator.floor_1 = (0,0,0);
etc

Then create an elevator status variable

i.e

elevator.status = 1 / 2 / 3

Each number represents a different thing.

1 = Bottom floor
2 = 2nd floor
etc

and finally, a door open/closed variable
elevator.door = open/closed

Then through use of correctly placed if statements, you can create the desired effect.

Start with obviously a button detection script.
Then check if the doors are open/closed
Then check which floor it is at and whether or not to open/close/move the elevator
Then repeat.

Write it yourself and then let us know how you get on and we can help from there.

Re: An Elevator

Posted: July 9th, 2008, 11:54 pm
by Soviet
Damn, I really need to learn scripting beyond rotate and moveto commands :P I get the concept of what you are saying, I just don't really know the syntax and how to put it all together. Is there any map that has used these commands so I can see a sample of them in action?

Re: An Elevator

Posted: July 10th, 2008, 3:30 pm
by Pedsdude
Soviet wrote:Is there any map that has used these commands so I can see a sample of them in action?
Your map, for the right price :lol: