On controlling player passage

Discussion in 'Tutorials & Resources' started by Cylosis, Jul 18, 2013.

  1. Cylosis

    Cylosis L1: Registered

    Messages:
    5
    Positive Ratings:
    1
    I've been toying with a few unique map mechanics to stir the proverbial waters of gameplay. I have a few ideas that rely on a room or corridor only allowing one player inside at a time. When they leave, another player can enter.

    It's easy enough to have a door close behind them or implement a similar function, but is there a way to make sure that there is only one person present within the boundaries?

    Sorry if this seems an odd request
     
  2. henke37

    aa henke37

    Messages:
    1,864
    Positive Ratings:
    432
    You mean besides making the area a no build zone? No, still can't be done.

    I do not think that this is a good idea anyway.
     
  3. Egan

    aa Egan

    Messages:
    1,304
    Positive Ratings:
    1,486
    You can actually make something fitting that description using a filter_activator_name.

    filter_activator_name
    Name: filter_canAccessRoom
    Filter Mode: Disallow entities that match criteria
    leave filter name alone

    trigger_multiple
    Name: namer
    Delay before reset: 1
    Outputs:
    [​IMG]

    trigger_teleport
    Name: RoomDetection
    Filter Name: filter_canAccessRoom
    Outputs:
    [​IMG]

    Put the teleport inside of the multiple like this:
    [​IMG]

    What this does is when someone touches the outer 'namer' entity, the namer entity disables itself but not before naming the player canAccessRoom. As soon as you touch the teleport trigger it asks if you fit the description of the filter it has been assigned, which is "everything that isn't canAccessRoom", so it doesn't teleport you away. Once inside, if you somehow go away (or die), then the teleport recognizes that OnEndTouch and enables the namer again, but not before naming you Normal, so you can't get back inside.

    Edit: Maybe now that I think about it you should put the enable namer output on a delay or put a separate teleport inside this all to lead the person inside away without retriggering the multiple on his way out.

    I learned how to use this from this video, by the way:
    https://www.youtube.com/watch?v=rbFLnu_wVDA&t=8s
     
    • Thanks Thanks x 1
    Last edited: Jul 18, 2013
  4. Cylosis

    Cylosis L1: Registered

    Messages:
    5
    Positive Ratings:
    1
    I've set this up as you specified as well as toying with ideas from the video, but I still cannot get it to work as intended.

    Here is a copy of the test I put together.
    https://dl.dropboxusercontent.com/u/19901924/test.rar

    Could you take a look and tell me where I went wrong? Thanks again for taking the time to help me out.
     
  5. Egan

    aa Egan

    Messages:
    1,304
    Positive Ratings:
    1,486
    Ok, thanks for the file. I went through it and found a few things out. 1: You need a teleport_destination for the trigger_teleport to work. (I've added one in). 2: The trigger_teleport wasn't activating the OnEndTouch because that also only registers for people who meet the filter (and if you're inside it, you do not). So what I ended up doing was creating a second trigger_multiple inside the teleport and moved all the teleport's outputs from that to the 2nd multiple. Oh and also, the filter name on the filter did need to be filled with the value: canAccessRoom

    I also made a video covering the changes so you can maybe see it better.

    The door version has been done before in a few CounterStrike maps like surf_XIV, where everyone races for the middle, and the first one there gets to choose a minigame surf map for everyone to play. If you were doing the teleport version, keep in mind that everyone would then be teleporting into the same location (people might get stuck inside each other).

    Also when you get the file back you can delete the game_text (I was just using them for testing), and also the outputs that affect them. You can also move around and change the name of the teleport_destination, and you might also want to make the areas between each trigger smaller.

    Download fixed version
     
    • Thanks Thanks x 2
    Last edited: Jul 19, 2013
  6. Cylosis

    Cylosis L1: Registered

    Messages:
    5
    Positive Ratings:
    1
    Wow, now that's correspondence. Bravo, Egan, for going to these lengths to help me out. My computer is trying to pull itself together after a bluescreen, but I'll go and play around with your designs when we're back in business.

    "First to the middle" was one of the ideas I had sketched up for this, a series of points or 'gates' to pass through in a race or obstacle course for jumping. It's disheartening that is isn't as original as I had first thought, but no more discouraging.

    I've got three keys from a recent trade, and I'd like you to have them as thanks for being so helpful. I have added you on Steam.
     
    • Thanks Thanks x 1