OK, so I got a box with one open end and made it an func_train.
There are 4 buttons and an prop_dynamic (with the model props_lab/elevatordoor), wich all have there parent setting set to the func_train.
There are four floors, each with there own prop_dynamic (with the same model).
Now, I want the elevator to move to the desired level wich is chosen by the buttons inside the elevator. I want the doors to close when the elevator leaves, and the doors opend when the elevator stops at an sertain level (path_track's).
I first tried this with a 3 level, and I solved the problem by making the train circuit a full circle. 1->2->3->1 etc. Then I have a few logic_compare to check what should be done when you press a certain button, when you press button 2 while on level 3, the elevator starts going backwards. Etc.
Now there was a flaw in this system, because if the train whould go backwards after it stopped on a track going forward, it whould stop again on the same track (going forward -> stop @ point 2 -> backward -> stop @ point 2 -> backward -> stop @ point 1). So I needed to press button 1 twice before the elevator whould actually go down.
Now I tried a 4 level elevator shaft using a whole new system but also with logic_compares.
I added a logic compare that holded track of wich level was desired and wich level the elevator was on (levelchecker) (if equal -> stop, if less -> go backwards, if greater then -> go forward). Every time the elevator whould pass an path_track it whould check if the desired floor was reached.
I also added a logic compare to each floor (level#_open), also holding track of the elevator the same way the level checker whould do, only these logic compares whould open the doors if the elevator stopped(if equal, setanimation, doorlevel1, open). And it whould tell another logic compare (level#_close) that there is an elevator at this level.
When any button is pressed in the elevator, it asks (logic_level#_close) if the elevator was currently stuck at an level and then close the doors on that level before going to antother.
Allthough this system seemed flawless when I tried to sleep last night, my map wont start up. So I tried it with two floors only, and It crashed when the elevator started moving to the second floor.
Could any of you guys know how to solve this problem?
I've included my *.vmf ->
http://members.chello.nl/h.krempel/Corona/elevator.vmf