Entity "On Enter"/"On Exit" zone logic blocks

    Joined
    Apr 4, 2015
    Messages
    24
    Reaction score
    15
    On Enter - When an entity enters the area, X happens. When Said entity leaves the area, nothing happens.

    On Exit - When an entity enters the area, nothing happens. When Said entity leaves the area, X happens.
     

    jayman38

    Precentor-Primus, pro-tempore
    Joined
    Jul 13, 2014
    Messages
    2,518
    Reaction score
    787
    • Purchased!
    • Thinking Positive
    • Legacy Citizen 4
    Will the entry/exit stuff still happen with multiple entities? (E.g. Ship 1 has entered and made something happen. Ship 2 shows up and.... Likewise, Ship 2 is there when Ship 1 leaves. Will something happen before Ship 2 leaves?)
     
    Joined
    Jun 24, 2015
    Messages
    148
    Reaction score
    33
    Perhaps 2 separate blocks. One that triggers only on enter with a pulse like a button so it can work for more then one user, and then one that triggers for exit in the same manner?
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    Perhaps 2 separate blocks. One that triggers only on enter with a pulse like a button so it can work for more then one user, and then one that triggers for exit in the same manner?
    Just look if the area trigger or activation block has a NOT block next to it. NOT makes it trigger on exit.
     
    Joined
    Jul 21, 2013
    Messages
    2,932
    Reaction score
    460
    • Hardware Store
    With these you cannot count how many entities are inside an area.

    The first player entering may activate, the second player deactivate, though there is still a player in that area (doors might close with a player inside).
    That can be solved by using 2 consecutive activation gates. If A activates, and then B activates, you know a player moved from beyond A to beyond B. If A triggers twice, you know a player moved from beyond A to between A and B and then back to beyond A. Analog for B.
    Assuming 2 players (a,b) move through in opposite directions, then one of the following will happen:
    1. A(a)→B(a)→B(b)→A(b) [a leaves the gates before b enters them]
    2. A(a)→B(b)→B(a)→A(b) [a is between gates while b enters them]
    3. B(b)→A(b)→A(a)→B(a) [b leaves the gates before a enters them]
    4. B(b)→A(a)→A(b)→B(a) [b is between gates while a enters them]
    Assuming both players move in the same direction:
    1. A(a)→B(a)→A(b)→B(b) [a leaves the gates before b enters them]
    2. A(a)→A(b)→B(a)→B(b) [a is between gates while b enters them] (chance of occurring can be reduced by closing distance between gates, and reducing gate radius)
    3. A(b)→B(b)→A(a)→B(a) [b leaves the gates before a enters them]
    4. A(b)→A(a)→B(b)→B(a) [b is between gates while a enters them] (chance of occurring can be reduced by closing distance between gates, and reducing gate radius)
    5. analog chains if direction of movement is reversed
    As you can see any case either works as intended, or the probability of the case occurring can be reduced artificially.
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    If A triggers twice, you know a player moved from beyond A to between A and B and then back to beyond A. Analog for B.
    And if 2 players cross, you don't notice. To count, you need 3 gates then.
    Maybe activation gates are better than triggers, not having 3 sec activation delay. I must test more.