Default Player Entity Name

EmNudge

L4: Comfortable Member
Sep 23, 2015
184
60
Well, what I'm trying to do is grant some form of respawn protection. That upon spawning, the player is given immunity to damage for a certain amount of seconds.

It seems that the way to do this would be with targetnames. Putting a filter for that default name on a trigger that grants the immunity and gives the player a different targetname. I can't seem to find what it is, if there even is one.

If I can't do what I want via this process, is there another way to filter an effect to only players that just recently spawned?
 

nickybakes

You should've played Rumbleverse
aa
Jul 28, 2015
911
1,739
You could surround the respawn area with a trigger_multiple or something like that, and in the outputs, the entity affect be "!activator".
 

EmNudge

L4: Comfortable Member
Sep 23, 2015
184
60
You could surround the respawn area with a trigger_multiple or something like that, and in the outputs, the entity affect be "!activator".
I already tried that, the problem is that players could just go back into the respawn area and get the immunity again. I want this to function once during a player's life and that's it. The best way would be to have a filter_activator_name with the player's default name and then change it - thus it happens once and that's it.
 

Izotope

Sourcerer
aa
May 13, 2013
698
764
Give them a name when they leave a map-wide trigger, then filter the effect for that name only.
Rename them again when they respawn.
 

EmNudge

L4: Comfortable Member
Sep 23, 2015
184
60
you can use a trigger_brush named game_playerspawn to hit the !activator with a set targetname, and then remove on delay. might have to sweep an uber condition filtered to that targetname across the entire map all the time with a func_movelinear since I think it doesn't auto detect targetname changes while not moving (even with duration set to -1).
This answer works best for me, but I can't seem to get it to work. I set up a test map with a very basic function.

I have the trigger_brush in a corner (since it's solid) that sets the player's targetname to "generic" upon spawn. I don't get what is removed or why something is removed, so I didn't include that step. I have a filter called newspawn_only that filters for the name "generic." That filter is attached to a basic trigger_hurt which also changes the player's targetname to "ubered" after a slight delay. This should work, here are some pictures:
numa4.png
numa2.png
numa3.png
numa5.png
numa1.png
 

Egan

aa
Feb 14, 2010
1,375
1,721
I think simply that the OnStartTouch from a trigger_hurt might not function, you can test by either hooking up a temporary game_text (set to all players flag) or using the console command 'developer 2' to see all IO logs. OnHurtPlayer should work - but why are you using a trigger_hurt to detect this anyway? Could just use a trigger_multiple probably - in the same location as a condition adder (because the trigger_tf_add_player_condition's OnStartTouch ALSO doesn't function...).

The reason for the delay was that I thought you wanted to have someone be ubered for like 5 seconds on spawn but then to not be allowed to be ubered again - as if you were not going to have spawnrooms in the map at all, just spawn randomly in the map and be ubered. If you were having spawn rooms then your 1 trigger at the door method would work ya.