Finding Player Name (possible use of !player or !activator)

Discussion in 'Mapping Questions & Discussion' started by Kloopy, May 20, 2009.

  1. Kloopy

    Kloopy L1: Registered

    Messages:
    6
    Positive Ratings:
    0
    Hi,

    I have searched the forums briefly and hopefully I've not missed an obvious answer to my question. If I have, I apologise....

    Does anyone know how I can get the player name of someone who activates a trigger? At the moment I'm not too fussy which entity output I use to make use of the player name; to begin with I'd like a proof of concept method to get a players name.

    I've looked at the Valve Developer Community wiki's list of TF2 entities, and can't find a way to find the players name from !activator. Is there a way to do this and, for example, pass it to a game_text_tf? To begin with it would be wonderful to have a simple brush entity and when ever anyone walks in to it, their name is displayed in game.

    I'm pretty competant when it comes to mapping in Hammer and know most of the simple stuff... I'd just appreciate a nudge in the right direction on this one.

    Thanks for your time :)

    Kloopy
     
  2. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,769
    Positive Ratings:
    5,535
    Nope. The entity system is entirely disconnected from whatever holds the player's name.
     
    • Thanks Thanks x 2
  3. Kloopy

    Kloopy L1: Registered

    Messages:
    6
    Positive Ratings:
    0
    Bah, I feared as much. That's quite annoying. :(

    Thanks for the response.
     
  4. StoneFrog

    StoneFrog L6: Sharp Member

    Messages:
    395
    Positive Ratings:
    81
    In TFC, the info_tfgoal entity had a special dialog string (I think %a or something) that would place the name of the player who activated the goal (capping a flag, etc.) in the text message.

    I know of no such equivalent in TF2. /me wants specialized messages back!
     
  5. Kloopy

    Kloopy L1: Registered

    Messages:
    6
    Positive Ratings:
    0
    Is there any way to uniquely identify a player? Perhaps some sort of reference I can get from !activator to uniquely identify one player?

    This could be used, for example, to ensure the person who presses a button to open a door is the only one allowed to close it.
     
  6. -gr-

    -gr- L1: Registered

    Messages:
    17
    Positive Ratings:
    12
    Yep, when a person runs through a trigger, you can use OnTrigger !activator AddOutput targetname special_player to give them a unique name, and then use a filter_activator_name on another trigger/entity that only fires for that named person. (special_player)

    OR

    You can parent a point_proximity_sensor to the player and use that to determine if a person is "carrying" it when they go near whatever you want to interact with. The advantage of that compared to the other method (if you need such an advantage, depends on the map) is that the point_proximity_sensor can be unique, so only one person at a time can have it.

    There may be other methods, but those are the two I've used in my maps with good success. I have small sample maps showing both methods. If you want to see them, let me know.
     
    • Thanks Thanks x 1
  7. Kloopy

    Kloopy L1: Registered

    Messages:
    6
    Positive Ratings:
    0
    -gr-, I'd be interested in a map showing your first solution, if that's not too much trouble! It sounds just what I'm after!

    I'll keep an eye out for forums PM and on this thread. If you want my email address, let me know.

    Thanks!
     
  8. -gr-

    -gr- L1: Registered

    Messages:
    17
    Positive Ratings:
    12
    Here it is, .bsp and .vmf attached in a .zip archive.

    First arch adds the "special_player" name.
    Second arch will only harm players named "special_player".
    Third arch removes the "special_player" name.

    Enjoy.
     
    • Thanks Thanks x 1