Elevator and doors

Elevator and doors

Re: Elevator and doors Posted by Ryandor on Thu Sep 11th 2003 at 6:39am
Ryandor
43 posts
Posted 2003-09-11 6:39am
Ryandor
member
43 posts 54 snarkmarks Registered: Aug 29th 2003 Occupation: IT Location: CO, US
Here's the setup:

A simple cargo "platform" elevator in a shaft with doors on the wall only (not a "typical office building" type) that goes between two levels. In the elevator shaft are a button at each level that move the elevator between levels. Outside the shaft is the call buttons, one at each level.

Here's what I've got so far:

func_train: name: cargo, first stop target: cargopc1

func_door: name: cargodoor1

func_door: name: cargodoor2

path_corner: name: cargopc1, next stop: cargopc2, fire on pass: cargodoor1

path_corner: name: cargopc2, next stop: cargopc1, fire on pass: cargodoor2

func_button: name: cargoup, target: cargo

func_button: name: cargodown, target: cargo

func_button: name: call1, target: ?

func_button: name: call2, target: ?

My question is what is the easiest way to set up the call buttons so that it will move the elevator to the current level? Or just open the doors if it's already at the current level? I think it's an env_global but I'm not quite sure how to set this up. It's rather confusing to me. Also, is there a way to check the up/down buttons so that whatever level the elevator is at, the other button doesn't do anything?

I could just grab a prefab, but that really doesn't teach me anything (not to mention I'd have to edit it anyway)

Guidance would be appreciated on this. Thanks.

-Ryandor
Re: Elevator and doors Posted by Tracer Bullet on Thu Sep 11th 2003 at 7:26am
Tracer Bullet
2271 posts
Posted 2003-09-11 7:26am
2271 posts 445 snarkmarks Registered: May 22nd 2003 Occupation: Graduate Student (Ph.D) Location: Seattle WA, USA
I think you could do this with a func_door instead of the func_train and save yourself some trouble since you only need two positions.

I think a multisource might be what you want to use here. it is an entity that allows multiple conditions for a given action. for example: button-->door<--lift (or some trigger that specifies it's state. through the multisource, they both target the door so it will only open if, say the lift is down, and the button is pressed.

You will also want to know how to use multimanagers for this as they simplifiy timing and such greatly

sorry I can't be more specific right now, but hopefully this points you in the right direction.
Re: Elevator and doors Posted by Gollum on Thu Sep 11th 2003 at 11:39am
Gollum
1268 posts
Posted 2003-09-11 11:39am
Gollum
member
1268 posts 525 snarkmarks Registered: Oct 26th 2001 Occupation: Student Location: Oxford, England
Here is one possible setup; it may not be the most efficient, depending on what you want to do, but it should work:

button1 and [b]button2 [color=white]both [/b][/color]target a multi_manager, mmmm is the entity that determines "what happens when either call button is pressed".

Here is what mm does:

It triggers the train/door/whatever once, so that it moves between the two positions.  That means that if the lift is down, it will go up, and if it's up it will go down.  In a similar way, it toggles the doors at the top and bottom (one closes, one opens).  It also triggers an env_global called global1 and another env_global called global2.  [b][color=#ffa500]global1 [/b]has a "global state to set" of "b1state", and global2 has a state to set of "b2state".  Both globals have the flag "set initial state" ticked.  You also need two multisource entites, multi1 and multi2.  These are set to read the global states "b1state" and "b2state" respectively.[/color]

Let's say that button1 is the call button that will be active when the level starts.  Then you want to set global1 to be initially on, and global2 to be initially off.

Finally, set button1 to have a master of multi1 and button2 to have a master of multi2.

Each time a button is pressed, it turns it's own global off and the other one on.  The effect is for the button to disable itself and activate the other one.

 
Re: Elevator and doors Posted by warlord on Fri Sep 12th 2003 at 12:39am
warlord
166 posts
Posted 2003-09-12 12:39am
warlord
member
166 posts 247 snarkmarks Registered: Sep 11th 2003 Occupation: ill show ye Location: americas
what i did with my elevator of this style is i made the elevator with moving buttons (invisible buttons with fake buttons as part of the func_train)

so when the player hits the number floor he wants it will move to that floor then open the doors

but if the player wants to open the doors of the floor he is currently on then he would push the same number of the floor he is on

what the elevator would do is it would stay there and the doors would open

the technical part of it is  is that the path corners would open the doors ,not a multimanager or anything like that

so the button of the same floor would make the elevator move to the same path corner it is alreaddy at and that path corner would in turn activate the doors

if you want me to explain an entity setup plz reply

 
Re: Elevator and doors Posted by Ryandor on Fri Sep 12th 2003 at 2:40am
Ryandor
43 posts
Posted 2003-09-12 2:40am
Ryandor
member
43 posts 54 snarkmarks Registered: Aug 29th 2003 Occupation: IT Location: CO, US
Thanks Gollum. I figured it out based on your answer. Quite a bit involved, but I manged to get this mostly work this way. There's still a couple tweaks to get ironed out, but I think I can get it all from here.

Warlord, Sounds like yours is the simpler method, but I already had most of the setup done before I saw your post.

-Ryandor