Improved Unique Player Naming Logic 2021-9-2 v2.1

Minimal setup time! No lag! Efficient!

  1. Yaki
    Unique player naming is difficult and can be cumbersome to achieve within a map on its own. This prefab will make it easy for you (a map maker, I presume) to do in your map.

    This logic improves on an outdated version (found here on TF2Maps).

    What this logic improves on from the last version is:
    • All naming logic is condensed to where it only needs to be activated by a single relay. Then boom! It works.
    • No longer needs an supermassive map-wide trigger to use.
    • Works faster and with less stress on the server to operate.
    FAQ : How do I set this up?
    1. Place a way to Trigger "relay_name_players". (A trigger_multiple over respawn would do! Can be one big trigger or individual ones)
    2. Place all other logic in the map, typically somewhere that is inaccessible by the player.
    3. That's it.
    FAQ : What do I need to know as a Map Maker when I use the Improved Unique Player Naming Logic system?
    1. This system only needs one way to boot up, and it can be done at any time and does not need a player (or !activator) to start it. The best way (I imagine) for this to fire up is when a player spawns into the map. In this way, all players will have a unique name.
    2. This uses OnUser4
      • OnUser4 is used to "echo" back to the Naming system to see if the player is still in the server and that the name is or isn't being used. This one is preferably kept clear of use at all times, so the game can write the state of the name back to this system.
    3. If ever you wanted to write attributes to the player or write a unique OnUser to them, put the I/O's in the trigger_multiple named naming_logic that's in this prefab.

    FAQ : How does the logic work?

    At the beginning of a round, the Improved Unique Player Naming Logic system will activate.

    First, it will write to all named players and check to see if any names are taken. If no, continues to #1. If yes, it'll account for any name(s) taken and write again to the player for OnUser4 to tell the Improved Unique Player Naming system that their name is, well, taken! (It sets the logic_branch for that player to False, which means the name is being used)
    1. When the round starts (or a player touches the one trigger_multiple), it will proc the relay_name_players.
    2. From there, it will pick all players and add an addoutput "OnUser4 naming_logic:StartTouch::0:1", then FireUser4. This means all players will touch the naming_logic trigger immediately and anywhere in the map.
    3. The naming_logic trigger filters by unnamed players, and can only deal with one player at a time due to OnStartTouchAll. It then fires DisableAndEndTouch to refresh itself. (using StartTouch will always proc a trigger, even while disabled!)
    4. The queue system is made up of logic_branch entities that assign and decline player names. If a logic_branch is set to True, it will assign the unique name and stop there. If it is False, it will skip itself and move to the next logic_branch and see if that one is True.
    5. If all logic_branches are taken, it will automatically reset all logic_branch entities to True, and force players to send out an "echo" to see if they are still in the server. If a player is there, then their assigned logic_branch is set to False.
    6. The last piece of the puzzle is a way to trigger all of this. It is done by a player respawning into a trigger_multiple that procs the relay "relay_name_players", which does all of this over again!
    Please read the article for Egg War in the Special Thanks.

    Special Thanks


    1. preview_improved_naming_logic.png
    BigfootBeto, Pdan4 and pont thanked this.

Recent Updates

  1. whoops
  2. Improvements!
  3. I actually found a bug