Default Player Entity Name

Discussion in 'Mapping Questions & Discussion' started by 【EmNudge】, Jul 4, 2016.

  1. 【EmNudge】

    【EmNudge】 L4: Comfortable Member

    Messages:
    182
    Positive Ratings:
    37
    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?
     
  2. Nicky

    aa Nicky Lets try something new!

    Messages:
    912
    Positive Ratings:
    1,698
    You could surround the respawn area with a trigger_multiple or something like that, and in the outputs, the entity affect be "!activator".
     
  3. 【EmNudge】

    【EmNudge】 L4: Comfortable Member

    Messages:
    182
    Positive Ratings:
    37
    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.
     
  4. Izotope

    aa Izotope Never releases maps

    Messages:
    619
    Positive Ratings:
    584
    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.
     
    • Agree Agree x 1
  5. Egan

    aa Egan

    Messages:
    1,318
    Positive Ratings:
    1,507
    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).
     
  6. 【EmNudge】

    【EmNudge】 L4: Comfortable Member

    Messages:
    182
    Positive Ratings:
    37
    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:
     
  7. Egan

    aa Egan

    Messages:
    1,318
    Positive Ratings:
    1,507
    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.