Loosing a addcond effect after class change

  • If you're asking a question make sure to set the thread type to be a question!

Newe6000

L1: Registered
Jun 20, 2014
15
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?"
 

Crash

func_nerd
aa
Mar 1, 2010
3,315
5,499
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.
 

Egan

aa
Feb 14, 2010
1,375
1,720
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.
 

Newe6000

L1: Registered
Jun 20, 2014
15
5
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.

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 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.

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.
 
Last edited:

Freyja

aa
Jul 31, 2009
2,994
5,813
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.

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.
 

Newe6000

L1: Registered
Jun 20, 2014
15
5
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.

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 :/ ).
 

Egan

aa
Feb 14, 2010
1,375
1,720
A different way you can achieve an invulnerable area would be to use a filter_damage_type:
6UAyr0K.png


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:
pthl4V3.png

QBv1VOm.png


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.