One-Way Elevator?

Chuff

New Member
Reaction score
1
Hi,

I've been working on a map where the player moves up 'levels' of the map via elevators (i.e. the map looks like a giant staircase). For this purpose, once a player has gone 'up' they should not be able to get back 'down', however, other players should be able to keep going 'up'.

Also, monsters from the level above should not be able to go 'down' (elevators only operate when all monsters of current level are dead, so monsters going 'up' is no problem).

I'm sure there must be a simple way to do this, but I'm having trouble finding it.

At the moment, the elevator simply comes back down automatically after 3 seconds. Some sort of "Wait until all user-players units have left the region" would be mighty helpful, but I cant get that happening.

Thanks in advance
 

millz-

New Member
Reaction score
25
Do the elevators do anything special? If not, just use a simple "Teleporter" region. Unit enters Elevator 1, move unit to level 2. Unit enters Elevator 2, move unit to level 3 etc.
 

Chuff

New Member
Reaction score
1
The levels are of course physically connected - the unit walks onto the elevator, goes up, then walks out onto the next level. Wouldn't it look silly if u just zipped up when u walked on it?

I had an idea, perhaps it would be easiest to treat the elevator like a gate, and have a region either side. When they enter one, the elevator opens. When they enter the following one the elevator closes.

Maybe this:

Code:
Trigger A:

    A unit enters <elevator>

    Elevator height is 1

    [elevator goes up and open sides swap]

Trigger B:

    A unit leaves <elevator>

    Number of units in <elevator> = 0
    Elevator height is 2

    [elevator goes down and open sides swap]

That way the elevator should stay up until all units are off it, but what then if those players are attacked by creeps who get into the elevator zone?

Should I just do:

Code:
    And
      Number of units in <elevator> owned by player 1 = 0
      Number of units in <elevator> owned by player 2 = 0
      Number of units in <elevator> owned by player 3 = 0
      ...
      Number of units in <elevator> owned by player 12 = 0

Surely there's a better way?
 

Chuff

New Member
Reaction score
1
Ok, I think I've figured it out. This seems to form a one-way elevator, but I need a way to ensure neutral hostile units can't get on the elevator (at all). Otherwise they could get on it and stop more players getting up, or if they don't count in the trigger they could escape to the level below and cause problems that way. Any ideas?

Here's the code for the one-way elevator so far:

Code:
Elevator Part 1
    Events
        Unit - A unit enters ElevatorRegion <gen>
    Conditions
        (Height of Elevator (1) 0000 <gen>) Equal to 1
    Actions
        Wait 3.00 seconds
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of units in (Units in ElevatorRegion <gen>)) Greater than 0
            Then - Actions
                Destructible - Close West wall of Elevator (1) 0000 <gen>
                Destructible - Set height of Elevator (1) 0000 <gen> to 2
                Destructible - Open East wall of Elevator (1) 0000 <gen>
            Else - Actions
                Do nothing


Elevator Part 2
    Events
        Unit - A unit leaves ElevatorRegion <gen>
    Conditions
        (Height of Elevator (1) 0000 <gen>) Equal to 2
        (Number of units in (Units in ElevatorRegion <gen>)) Equal to 0
    Actions
        Destructible - Close East wall of Elevator (1) 0000 <gen>
        Destructible - Set height of Elevator (1) 0000 <gen> to 1
        Destructible - Open West wall of Elevator (1) 0000 <gen>

Any improvements would be appreciated :)
 

Halofan

New Member
Reaction score
7
I didn't really go by your posts, I just tried my best to make a simple trigger for a one way elevator that didn't react to creeps. The only things you have to make sure of is that the creeps are on Neutral Hostile team (otherwise you'll have to edit the trigger accordingly), and that only one person can use the elevator at a time, otherwise people could get stuck and have to go and mess around with them. They'd still work, but would be buggy and a pain in the ass.

Code:
Elevator
    Events
        Unit - A unit enters <REGION_1>
    Conditions
        (Owner of (Entering unit)) Not equal to Neutral Hostile
    Actions
        Destructible - Set height of <ELEVATOR> to <UP_HEIGHT>

Code:
Elevator Down
    Events
        Unit - A unit enters <REGION_2>
    Conditions
        (Owner of (Entering unit)) Not equal to Neutral Hostile
    Actions
        Destructible - Set height of <ELEVATOR> to <DOWN_HEIGHT>

Place your first region on/under the elevator, so that when the unit enters they trigger it, and then the second region should be there when the player steps off the elevator. Set the height of the elevator for whatever it needs to be. Add wait times as you see fit.
 

Chuff

New Member
Reaction score
1
Yes, that's more or less the idea I'm going off, my code above is pretty similar and allows multiple people to go on the elevator, however I'm still finding it to be flawed (e.g. needs to be number of living units, or a unit dying on the elevator screws things up).

What I've come to realise is that elevators are a terrible, terrible way of doing what I want to achieve :p.

I'm thinking I'll remake it as separate sections, where the players are simply teleported to the next section. The elevators are too tricky and buggy to be worthwhile.
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top