How to -hhn? Hide Hero Name

NightFelix

Active Member
Reaction score
1
-hhn stand for -hideheroname which the DotA game use for hiding their hero name behind of their players name.

What I'm going to do here is -repick to remove the hero name. When player type repick will remove his/her current hero and then remove the hero name behind his player name as well.

I already done the show hero name part but now I need hide hero name part.
My Show Hero Name:
Trigger:
  • Player Hero Name System
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Entering unit) is A Hero) Equal to True
    • Actions
      • Player - Set name of (Owner of (Entering unit)) to ((Name of (Owner of (Entering unit))) + ( ( + ((Name of (Entering unit)) + ))))
 

Faust

You can change this now in User CP.
Reaction score
123
Play with substring.
The hero has a constant name, so you can set an 'I' integer to the number of letters of the hero's name, then set the player's name to substring: player's name 1, number of letters in player name MINUS 'I'
 

Faust

You can change this now in User CP.
Reaction score
123
Trigger:
  • hhn
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Player - Set name of (Owner of (Triggering unit)) to (Substring((Name of (Owner of (Triggering unit))), 1, ((Length of (Name of (Owner of (Triggering unit)))) - (Length of (Name of (Triggering unit))))))
      • Player - Set name of (Owner of (Entering unit)) to ((Name of (Owner of (Entering unit))) + ( ( + ((Name of (Entering unit)) + ))))


It's two actions, because stings are always quite complicated and long, good luck not losing yourself in this one lol
 

NightFelix

Active Member
Reaction score
1
Trigger:
  • hhn
    • Events
    • Conditions
    • Actions
      • Player - Set name of (Owner of (Triggering unit)) to (Substring((Name of (Owner of (Triggering unit))), 1, ((Length of (Name of (Owner of (Triggering unit)))) - (Length of (Name of (Triggering unit))))))


This part seems to be not working. =.=
 

Faust

You can change this now in User CP.
Reaction score
123
Did you try it with entering unit instead of triggering unit?
 

Igor_Z

You can change this now in User CP.
Reaction score
61
I like to post some triggers. I think that it is something like this. I need JASS users to fix my actions or do it better somehow... Here it is, i'll give it a try

Trigger:
  • Map initializations
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Player_Names[1] = (Name of Player 2 (Blue))
      • Set Player_Names[2] = (Name of Player 3 (Teal))
      • Set Player_Names[3] = (Name of Player 4 (Purple))
      • Set Player_Names[4] = (Name of Player 5 (Yellow))
      • Set Player_Names[5] = (Name of Player 6 (Orange))
      • Set Player_Names[6] = (Name of Player 8 (Pink))
      • Set Player_Names[7] = (Name of Player 9 (Gray))
      • Set Player_Names[8] = (Name of Player 10 (Light Blue))
      • Set Player_Names[9] = (Name of Player 11 (Dark Green))
      • Set Player_Names[10] = (Name of Player 12 (Brown))


Trigger:
  • Set Player Names
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Triggering unit) is in PlayerNames_Group) Equal to False
          • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set PlayerNames_Unit = (Triggering unit)
      • Set PlayerNames_Owner = (Owner of PlayerNames_Unit)
      • Unit Group - Add PlayerNames_Unit to PlayerNames_Group
      • Player - Set name of PlayerNames_Owner to ((Name of PlayerNames_Owner) + ( ( + ((Name of PlayerNames_Unit) + ))))
      • Set PlayerNames_Unit = No unit
      • Set PlayerNames_Owner = Neutral Extra


Trigger:
  • Hide Player Names
    • Events
      • Player - Player 2 (Blue) types a chat message containing -hhn as An exact match
      • Player - Player 3 (Teal) types a chat message containing -hhn as An exact match
      • Player - Player 4 (Purple) types a chat message containing -hhn as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -hhn as An exact match
      • Player - Player 6 (Orange) types a chat message containing -hhn as An exact match
      • Player - Player 8 (Pink) types a chat message containing -hhn as An exact match
      • Player - Player 9 (Gray) types a chat message containing -hhn as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -hhn as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -hhn as An exact match
      • Player - Player 12 (Brown) types a chat message containing -hhn as An exact match
    • Conditions
    • Actions
      • Custom script: if GetTriggeringPlayer() == Player(2) then
      • Player - Set name of Player 2 (Blue) to Player_Names[1]
      • Player - Set name of Player 3 (Teal) to Player_Names[2]
      • Player - Set name of Player 4 (Purple) to Player_Names[3]
      • Player - Set name of Player 5 (Yellow) to Player_Names[4]
      • Player - Set name of Player 6 (Orange) to Player_Names[5]
      • Player - Set name of Player 8 (Pink) to Player_Names[6]
      • Player - Set name of Player 9 (Gray) to Player_Names[7]
      • Player - Set name of Player 10 (Light Blue) to Player_Names[8]
      • Player - Set name of Player 11 (Dark Green) to Player_Names[9]
      • Player - Set name of Player 12 (Brown) to Player_Names[10]
      • Custom script: endif
      • -------- ------------------------------------------------------------------------------------------------------- --------
      • Custom script: if GetTriggeringPlayer() == Player(3) then
      • Player - Set name of Player 2 (Blue) to Player_Names[1]
      • Player - Set name of Player 3 (Teal) to Player_Names[2]
      • Player - Set name of Player 4 (Purple) to Player_Names[3]
      • Player - Set name of Player 5 (Yellow) to Player_Names[4]
      • Player - Set name of Player 6 (Orange) to Player_Names[5]
      • Player - Set name of Player 8 (Pink) to Player_Names[6]
      • Player - Set name of Player 9 (Gray) to Player_Names[7]
      • Player - Set name of Player 10 (Light Blue) to Player_Names[8]
      • Player - Set name of Player 11 (Dark Green) to Player_Names[9]
      • Player - Set name of Player 12 (Brown) to Player_Names[10]
      • Custom script: endif
      • -------- ------------------------------------------------------------------------------------------------------- --------
      • Custom script: if GetTriggeringPlayer() == Player(4) then
      • Player - Set name of Player 2 (Blue) to Player_Names[1]
      • Player - Set name of Player 3 (Teal) to Player_Names[2]
      • Player - Set name of Player 4 (Purple) to Player_Names[3]
      • Player - Set name of Player 5 (Yellow) to Player_Names[4]
      • Player - Set name of Player 6 (Orange) to Player_Names[5]
      • Player - Set name of Player 8 (Pink) to Player_Names[6]
      • Player - Set name of Player 9 (Gray) to Player_Names[7]
      • Player - Set name of Player 10 (Light Blue) to Player_Names[8]
      • Player - Set name of Player 11 (Dark Green) to Player_Names[9]
      • Player - Set name of Player 12 (Brown) to Player_Names[10]
      • Custom script: endif
      • -------- ------------------------------------------------------------------------------------------------------- --------
      • Custom script: if GetTriggeringPlayer() == Player(5) then
      • Player - Set name of Player 2 (Blue) to Player_Names[1]
      • Player - Set name of Player 3 (Teal) to Player_Names[2]
      • Player - Set name of Player 4 (Purple) to Player_Names[3]
      • Player - Set name of Player 5 (Yellow) to Player_Names[4]
      • Player - Set name of Player 6 (Orange) to Player_Names[5]
      • Player - Set name of Player 8 (Pink) to Player_Names[6]
      • Player - Set name of Player 9 (Gray) to Player_Names[7]
      • Player - Set name of Player 10 (Light Blue) to Player_Names[8]
      • Player - Set name of Player 11 (Dark Green) to Player_Names[9]
      • Player - Set name of Player 12 (Brown) to Player_Names[10]
      • Custom script: endif
      • -------- ------------------------------------------------------------------------------------------------------- --------
      • Custom script: if GetTriggeringPlayer() == Player(6) then
      • Player - Set name of Player 2 (Blue) to Player_Names[1]
      • Player - Set name of Player 3 (Teal) to Player_Names[2]
      • Player - Set name of Player 4 (Purple) to Player_Names[3]
      • Player - Set name of Player 5 (Yellow) to Player_Names[4]
      • Player - Set name of Player 6 (Orange) to Player_Names[5]
      • Player - Set name of Player 8 (Pink) to Player_Names[6]
      • Player - Set name of Player 9 (Gray) to Player_Names[7]
      • Player - Set name of Player 10 (Light Blue) to Player_Names[8]
      • Player - Set name of Player 11 (Dark Green) to Player_Names[9]
      • Player - Set name of Player 12 (Brown) to Player_Names[10]
      • Custom script: endif
      • -------- ------------------------------------------------------------------------------------------------------- --------
      • Custom script: if GetTriggeringPlayer() == Player(8) then
      • Player - Set name of Player 2 (Blue) to Player_Names[1]
      • Player - Set name of Player 3 (Teal) to Player_Names[2]
      • Player - Set name of Player 4 (Purple) to Player_Names[3]
      • Player - Set name of Player 5 (Yellow) to Player_Names[4]
      • Player - Set name of Player 6 (Orange) to Player_Names[5]
      • Player - Set name of Player 8 (Pink) to Player_Names[6]
      • Player - Set name of Player 9 (Gray) to Player_Names[7]
      • Player - Set name of Player 10 (Light Blue) to Player_Names[8]
      • Player - Set name of Player 11 (Dark Green) to Player_Names[9]
      • Player - Set name of Player 12 (Brown) to Player_Names[10]
      • Custom script: endif
      • -------- ------------------------------------------------------------------------------------------------------- --------
      • Custom script: if GetTriggeringPlayer() == Player(9) then
      • Player - Set name of Player 2 (Blue) to Player_Names[1]
      • Player - Set name of Player 3 (Teal) to Player_Names[2]
      • Player - Set name of Player 4 (Purple) to Player_Names[3]
      • Player - Set name of Player 5 (Yellow) to Player_Names[4]
      • Player - Set name of Player 6 (Orange) to Player_Names[5]
      • Player - Set name of Player 8 (Pink) to Player_Names[6]
      • Player - Set name of Player 9 (Gray) to Player_Names[7]
      • Player - Set name of Player 10 (Light Blue) to Player_Names[8]
      • Player - Set name of Player 11 (Dark Green) to Player_Names[9]
      • Player - Set name of Player 12 (Brown) to Player_Names[10]
      • Custom script: endif
      • -------- ------------------------------------------------------------------------------------------------------- --------
      • Custom script: if GetTriggeringPlayer() == Player(10) then
      • Player - Set name of Player 2 (Blue) to Player_Names[1]
      • Player - Set name of Player 3 (Teal) to Player_Names[2]
      • Player - Set name of Player 4 (Purple) to Player_Names[3]
      • Player - Set name of Player 5 (Yellow) to Player_Names[4]
      • Player - Set name of Player 6 (Orange) to Player_Names[5]
      • Player - Set name of Player 8 (Pink) to Player_Names[6]
      • Player - Set name of Player 9 (Gray) to Player_Names[7]
      • Player - Set name of Player 10 (Light Blue) to Player_Names[8]
      • Player - Set name of Player 11 (Dark Green) to Player_Names[9]
      • Player - Set name of Player 12 (Brown) to Player_Names[10]
      • Custom script: endif
      • -------- ------------------------------------------------------------------------------------------------------- --------
      • Custom script: if GetTriggeringPlayer() == Player(11) then
      • Player - Set name of Player 2 (Blue) to Player_Names[1]
      • Player - Set name of Player 3 (Teal) to Player_Names[2]
      • Player - Set name of Player 4 (Purple) to Player_Names[3]
      • Player - Set name of Player 5 (Yellow) to Player_Names[4]
      • Player - Set name of Player 6 (Orange) to Player_Names[5]
      • Player - Set name of Player 8 (Pink) to Player_Names[6]
      • Player - Set name of Player 9 (Gray) to Player_Names[7]
      • Player - Set name of Player 10 (Light Blue) to Player_Names[8]
      • Player - Set name of Player 11 (Dark Green) to Player_Names[9]
      • Player - Set name of Player 12 (Brown) to Player_Names[10]
      • Custom script: endif
      • -------- ------------------------------------------------------------------------------------------------------- --------
      • Custom script: if GetTriggeringPlayer() == Player(12) then
      • Player - Set name of Player 2 (Blue) to Player_Names[1]
      • Player - Set name of Player 3 (Teal) to Player_Names[2]
      • Player - Set name of Player 4 (Purple) to Player_Names[3]
      • Player - Set name of Player 5 (Yellow) to Player_Names[4]
      • Player - Set name of Player 6 (Orange) to Player_Names[5]
      • Player - Set name of Player 8 (Pink) to Player_Names[6]
      • Player - Set name of Player 9 (Gray) to Player_Names[7]
      • Player - Set name of Player 10 (Light Blue) to Player_Names[8]
      • Player - Set name of Player 11 (Dark Green) to Player_Names[9]
      • Player - Set name of Player 12 (Brown) to Player_Names[10]
      • Custom script: endif


P.S: The third trigger needs fixing... It doesn't work. Who can fix it, fix it for the requester of this thread. Or create him a new one. I think that it is something like the triggers shown up
 

Komaqtion

You can change this now in User CP.
Reaction score
469
In JASS, player 1 (red) is "Player (0)", and that means player 2 (blue) is "Player (1)".
 

Igor_Z

You can change this now in User CP.
Reaction score
61
This isn't JASS... Its GUI. Hmm don't know. But is there anyway i can shorten this trigger for the requester?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Trigger:
  • Custom script: if GetTriggeringPlayer() == Player(12) then

JASS ! :p

It seems your actions are the same, so why are you even using all those "if"s ??
 

Igor_Z

You can change this now in User CP.
Reaction score
61
Well i don't want the player names to be changed for all players. Only the player who writes -hhn doesn't want to see hero names near the player names. Get it?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
But still:
Trigger:
  • Custom script: if GetTriggeringPlayer() == Player(12) then
    • Player - Set name of Player 2 (Blue) to Player_Names[1]
    • Player - Set name of Player 3 (Teal) to Player_Names[2]
    • Player - Set name of Player 4 (Purple) to Player_Names[3]
    • Player - Set name of Player 5 (Yellow) to Player_Names[4]
    • Player - Set name of Player 6 (Orange) to Player_Names[5]
    • Player - Set name of Player 8 (Pink) to Player_Names[6]
    • Player - Set name of Player 9 (Gray) to Player_Names[7]
    • Player - Set name of Player 10 (Light Blue) to Player_Names[8]
    • Player - Set name of Player 11 (Dark Green) to Player_Names[9]
    • Player - Set name of Player 12 (Brown) to Player_Names[10]
    • Custom script: endif


These action are still the same as these:
Trigger:
  • Custom script: if GetTriggeringPlayer() == Player(11) then
    • Player - Set name of Player 2 (Blue) to Player_Names[1]
    • Player - Set name of Player 3 (Teal) to Player_Names[2]
    • Player - Set name of Player 4 (Purple) to Player_Names[3]
    • Player - Set name of Player 5 (Yellow) to Player_Names[4]
    • Player - Set name of Player 6 (Orange) to Player_Names[5]
    • Player - Set name of Player 8 (Pink) to Player_Names[6]
    • Player - Set name of Player 9 (Gray) to Player_Names[7]
    • Player - Set name of Player 10 (Light Blue) to Player_Names[8]
    • Player - Set name of Player 11 (Dark Green) to Player_Names[9]
    • Player - Set name of Player 12 (Brown) to Player_Names[10]
    • Custom script: endif


And both times you've skipped player 1 and 7
 

Igor_Z

You can change this now in User CP.
Reaction score
61
Player 1 and Player 7 are Scourge and Sentinel in dotA... He said that he wanted to be like dotA. Player 1 and Player 7 don't control heroes... So their names aren't set to something else. They r just Sentinel and Scourge. Although he can modify those triggers how he wants, its his idea
 

Azylaminaz

Vox Populi
Reaction score
91
You have a global constant on all names, it appears, and that is "<player name> ((<unit name>))".
So you can just search for that and remove it...
Trigger:
  • Activate
    • Events
      • Player - Player 1 (Red) types a chat message containing -hhn as An exact match
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • For each (Integer A) from 1 to 27, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Substring((Name of (Picked player)), (Integer A), ((Integer A) + 1))) Equal to ((
                • Then - Actions
                  • Player - Set name of (Picked player) to (Substring((Name of (Picked player)), 1, ((Integer A) - 2)))
                • Else - Actions
I assume you can just disable the trigger that sets the player's names..

Hard to tell exactly, might be "( (" and not "((". If so, just change it to that.. o_O
 
General chit-chat
Help Users

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top