Loosing a addcond effect after class change

Discussion in 'Mapping Questions & Discussion' started by Newe6000, Jun 20, 2014.

  1. Newe6000

    Newe6000 L1: Registered

    Messages:
    15
    Positive Ratings:
    5
    I've been mapping for hammer off and on for years now. I've never finished a map (usually due to lack of motivation). However, after being inspired by what I really wanted to see in a trade map, I've started on a simple trade map with a few little features I really wanted to see.

    The big thing is that Red and Blu spawn together in an area where nobody can get killed. I wanted to do that since trade maps seem to love to include an area where people are meant to not kill each other, while having absolutely nothing to stop them from doing so. I got the effect working by putting a trigger_add_tf_player_condition over the area with a timer of -1, effect 51 (TF_COND_INVULNERABLE_HIDE_UNLESS_DAMAGED) and then hooking up the OnEndTouch output to a point_clientcommand with the command "removecond 51".

    It works beautifully. People spawning in get the effect and will loose it correctly upon leaving the area, and will even get it back when re-entering it! However, if somebody changes their class while in spawn, they lose the effect even though they're still in the brush area. Is there any way to fix this or will this be a case of "class changers beware?"
     
  2. Crash

    aa Crash func_nerd

    Messages:
    3,156
    Positive Ratings:
    4,774
    If I was doing this and I couldn't figure out a better work around, I'd just divide the initial trigger up into a few chunks so they'd always have to walk into a new one before leaving the spawn. To do this most efficiently, you could have one trigger over where all the spawn points are, and then another right in front of them.
     
    • Thanks Thanks x 1
  3. Egan

    aa Egan

    Messages:
    1,307
    Positive Ratings:
    1,488
    This might be fixed by doing what I do for toggle-able addcond areas:
    1. Set the duration on the addcond trigger to 1.3
    2. Create a logic_timer with a Refire Interval of 1
    3. Give the logic_timer the output: OnTimer, !self, ResetTimer
    4. Give the logic_timer the output: OnTimer, addcond, Enable
    5. Give the logic_timer the output: OnTimer, addcond, Disable, (after a delay of) 0.1
    This is an alternative to the leave-the-area-lose-the-effect thing you made with the point_clientcommand, but this may also work for the class changes since it, all at once, will disable and re-enable for the people inside of it.

    The toggle-able-ness comes from being able to disable the timer, and thus disabling the reset of the addcond area.
     
    • Thanks Thanks x 1
  4. Newe6000

    Newe6000 L1: Registered

    Messages:
    15
    Positive Ratings:
    5
    Sadly what I feared might happen, happened. With 2 areas when you cross from area A to area B then area B applies it's effect before area A removes the effect. Meaning, you loose the effect entering the new area instead of keeping it. Weirdly, being in area B and changing class so you're sent back to area A won't give you the effect back, which makes me think the effect not triggering on class change is a bug.

    This works, but it creates the problem that people spawning in/changing class can be left up to a second without invun. That may not sound like much but I don't trust trade server players not to abuse it.

    Sadly, I'm left with the option of giving up and changing my map design so it has 2 separated spawn rooms, or looking completely unprofessional and removing the func_respawnroom so that this issue doesn't surface.

    Update: So, uhh, guys... You're gonna want to see this. Setting the time to -1 automatically makes the effect only apply within the brush. I just confirmed it, removed everything to do with removing the effect or enabling/disabling the brush.

    In less mindblow bombshell news, I've decided to go with 2 spawn rooms because I thought about all the issues that would arise with 1 shared spawn room and decided it's not worth it.
     
    • Thanks Thanks x 5
    Last edited: Jun 21, 2014
  5. Freyja

    aa Freyja ¯\_(ツ)_/¯

    Messages:
    2,847
    Positive Ratings:
    4,828
    I love you. When the trigger came out we all decided that valve had just forgone the "while in trigger" and even entity-masters like Boojum use ridiculous ways to do it. It's hilarious that you found it when no one else managed to, great job.
     
  6. Crash

    aa Crash func_nerd

    Messages:
    3,156
    Positive Ratings:
    4,774
  7. Newe6000

    Newe6000 L1: Registered

    Messages:
    15
    Positive Ratings:
    5
    Haha, I feel special :p

    I discovered it completely by accident. I tried having the brush just cover underneath the spawn points and then having a trigger remove the effect. Imagine my confusion when it was only applying at spawn, and I confirmed I had correctly removed all outputs and inputs to the brush. Guess we should add this to the developer wiki.

    I've done some more testing with the brush, and unfortunately all the problems I have listed still happen (so I guess my solution probably didn't actually do anything :/ ).
     
  8. Egan

    aa Egan

    Messages:
    1,307
    Positive Ratings:
    1,488
    A different way you can achieve an invulnerable area would be to use a filter_damage_type:
    [​IMG]

    The 'Damage Type' in this instance is set to 1024, or 'Energy Beam', which TF2 has none of (I think). You can then use a trigger_multiple that sets the !activator's DamageFilter to your filter_godmode:
    [​IMG]
    [​IMG]

    This way when people spawn inside of it then are given god mode essentially, and when they leave the area their godmode is taken away (of course configurable). Normally without taking the damage filter away this effect will linger through changing to spectator, so I assume it will last through class changes as well.