Doors on a timer

Discussion in 'Mapping Questions & Discussion' started by TravisTouchdown, Feb 25, 2017.

  1. TravisTouchdown

    TravisTouchdown L2: Junior Member

    Messages:
    67
    Positive Ratings:
    5
    I have made a 1 room building. Inside there is items that add conditions. 1 for uber and 1 for crit and will probably make 3 or 5 more.

    I would like to set the doors on a timer to where they will open for 30 seconds once every 4-5 minuets.

    How can I do this?
     
  2. Werewolf

    aa Werewolf Probably not a real Werewolf

    Messages:
    752
    Positive Ratings:
    212
    Use a logic_timer to fire the 'Open' input to your doors. The doors themselves would have their "Delay Before Reset" field set to 30.
     
  3. TravisTouchdown

    TravisTouchdown L2: Junior Member

    Messages:
    67
    Positive Ratings:
    5
    Sorry I wanted to get back to you sooner but I have been under the weather.

    I want to see if I got this right because I dont know the first thing about adding in timers

    My doors are called door1 and door2. I set there delay Delay Before Reset to 30. Do I need to do anything else to the doors?

    I added in the logic_timer but what do you mean by fire the open input? I clicked on the input tab but its blank.
     
  4. Werewolf

    aa Werewolf Probably not a real Werewolf

    Messages:
    752
    Positive Ratings:
    212
    Well first, a watch the video below on Inputs and Outputs, though in short, any command an entity sends out to another entity is an Output, and anything received by an entity is an input.


    View: https://youtu.be/_8iPGfg117I


    The logic_timer can send an 'OnTimer' output. In this case, we need it to send an 'Open' command to your doors, which the doors will receive as an input. You'll want to go to the 'Output's tab of your logic timer, and set it as follows:
    Code:
    My Output named: OnTimer
    Target Entity named: Door1
    Via this input: Open
    with a parameter override of: <name>
    After a delay in seconds of: 0.00
    You won't need to set a parameter as the 'Open' command doesn't need any extra info, and you won't need a delay as your already using a timer to.
     
  5. SmallBiscuit

    SmallBiscuit L7: Fancy Member

    Messages:
    463
    Positive Ratings:
    242
    you may want to also add a trigger hurt inside, that gets enabled when the doors close, so that players don't get stuck inside
     
  6. Werewolf

    aa Werewolf Probably not a real Werewolf

    Messages:
    752
    Positive Ratings:
    212
    No need, func_doors already have a 'Blocking Damage' field and can be set to 'Force Close'. Using both will mean the door will close and crush anyone stood in it's way. The only time it won't kill players is when they have Godmode, either form using sv_cheats 1 or using SourceMod.
     
  7. SmallBiscuit

    SmallBiscuit L7: Fancy Member

    Messages:
    463
    Positive Ratings:
    242
    no, Im talking about when the doors close, and the players are still in the room. allegedly, there is only one door, and it opens on a timer. It would be more than anoying to be trapped in there with no escape, even by death
     
  8. Werewolf

    aa Werewolf Probably not a real Werewolf

    Messages:
    752
    Positive Ratings:
    212
    Well in that case might be easier to have a trigger_hurt or trigger_teleport(s, one for each team) to either kill players in the room or move them somewhere safe. In either case, set them to Enable when the door is OnFullyClosed and disable 0.50 seconds later.
     
    • Like Like x 1
  9. SmallBiscuit

    SmallBiscuit L7: Fancy Member

    Messages:
    463
    Positive Ratings:
    242
  10. Diva Dan

    aa Diva Dan hello!

    Messages:
    831
    Positive Ratings:
    1,367
    This is very important if you want the doors to continue opening and closing forever.

    First, you have to have a logic_relay with the output of opening the door, and and output of closing the door after a delay of 30 seconds.

    Then, create an output that also has a delay of 30 seconds and have it trigger ANOTHER logic relay. Inside of the second relay, add an output to trigger the first relay with a delay of 300 seconds (5 minutes).

    This creates an I/O loop. When one thing activates, then so will the other, then back, etc. However, it will start inactive, since you have nothing to set off the loop. So, create a logic_auto that triggers the second relay when the round starts. This will being the 5 minute timer and the loop will continue forever until the next round starts.

    I hope this helps!
     
    • Respectfully Disagree Respectfully Disagree x 1
  11. TravisTouchdown

    TravisTouchdown L2: Junior Member

    Messages:
    67
    Positive Ratings:
    5
    Thank you for the video. I have a better understanding about it now.

    Ok so I have it set to open on 300 ( am guessing that is 300 seconds so 5 minuets)

    I unchecked the box that says to open on touch so im hoping that dont cause any trouble

    I also set a start sound wav that is a game sound that is 35 seconds long so I will just everyone to get in and out before the sound stops.
     
  12. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,072
    Positive Ratings:
    833
    None of that is necessary. Werewolf's solution is the most elegant as it only requires one entity, logic_timer, which is an entity designed to do just what you are talking about. It works continuously, firing its outputs every time it reaches the end of its timer. It will open and close the doors every five minutes, or whatever the mapper has set.

    Advanced: Doors themselves can be given outputs that fire when they are fully open, begin to open, begin to close or are fully closed. You could give the doors an output that opens them again after a four minute delay, and begin their cycle using your team_round_timer or logic_auto if you have one, or any other existing entity that is manipulated at the beginning of the round. Note that you do not need to name your doors differently. You could give them the same name (e.g. door1) and they would both respond to a single output, saving the need for separate outputs that control them independently.
     
    • Agree Agree x 1
  13. Diva Dan

    aa Diva Dan hello!

    Messages:
    831
    Positive Ratings:
    1,367
    I had no idea it had that functionality, I just based mine off of what I've used in all of my other maps, sorry
     
  14. TravisTouchdown

    TravisTouchdown L2: Junior Member

    Messages:
    67
    Positive Ratings:
    5
    I think I have done something wrong.

    I made my door and I called it Door1. I set the flag to not allow open on touch because I want it opened on timer only. I set my delay before restart to 45 seconds because I want them to stay open for 45 seconds. I add in my logic timer and set it to ontimer door1 open. The door opens just fine. The trouble now is that the door dont close, it floats out of my map.

    [​IMG]
     
    • Funny Funny x 1
  15. Werewolf

    aa Werewolf Probably not a real Werewolf

    Messages:
    752
    Positive Ratings:
    212
    Take a screenshot of the object properties window for your door and your timer (Hint: Alt + PrtScn can be used to take a screenshot of just the currently selected window)

    Post both images here.
     
  16. TravisTouchdown

    TravisTouchdown L2: Junior Member

    Messages:
    67
    Positive Ratings:
    5
  17. henke37

    aa henke37

    Messages:
    1,876
    Positive Ratings:
    440
    That origin is questionable.
     
  18. TravisTouchdown

    TravisTouchdown L2: Junior Member

    Messages:
    67
    Positive Ratings:
    5
    Tell me what you mean by that and if you know how I can possibly fix it