• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How to return player name? {putting a player's name back to the standard}

Status
Not open for further replies.
Level 6
Joined
Jul 25, 2005
Messages
221
This should do the work for you.
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Setting name to name+(dead) --------
      • Player - Set name of Player 1 (Red) to ((Name of Player 1 (Red)) + ( + (Dead)))
      • -------- Displaying player name + (dead) --------
      • Game - Display to (All players) the text: (Name of Player 1 (Red))
      • -------- Setting a variable to a string --------
      • Set Player_name = ((Name of Player 1 (Red)) + ( + (Dead)))
 
Level 3
Joined
Jul 13, 2008
Messages
38
Set name of player 1 to player 1

Was that so hard?

The attitude is not needed and you are far off from fixing the problem.

This is what you need to do. First when map starts you will have to create a variable to set all players names:
  • BoardNames
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set Player_Names[(Integer A)] = (Name of (Player((Integer A))))
      • Custom script: call DestroyTrigger( GetTriggeringTrigger() )
Then when ever you wish to return them to there real name say after they are not dead run a trigger to set there names accordingly.

I added "Custom script: call DestroyTrigger( GetTriggeringTrigger() )" Since this trigger on its own would not be called again since the variable stored the information and no new information should be stored in these variables. also the Custom script: call DestroyTrigger( GetTriggeringTrigger() ) reduces lag in game a good bit.
 
Level 14
Joined
Mar 4, 2009
Messages
1,156
i dont know how to return it:xxd:i started the trigger again but it didnt work ....
is it good to do Custom script: call DestroyTrigger( GetTriggeringTrigger() ) for every trigger that will run only once?

{EDIT}
i did it on this way it works great :)

  • set real names
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set NAME[1] = (Name of Player 1 (Red))
      • Set NAME[2] = (Name of Player 2 (Blue))
      • Set NAME[3] = (Name of Player 3 (Teal))
      • Set NAME[4] = (Name of Player 4 (Purple))
      • Set NAME[5] = (Name of Player 5 (Yellow))
      • Set NAME[6] = (Name of Player 6 (Orange))
      • Set NAME[7] = (Name of Player 7 (Geen))
      • Set NAME[8] = (Name of Player 8 (Pink))
      • Set NAME[9] = (Name of Player 9 (Gray))
      • Set NAME[10] = (Name of Player 10 (Light Blue))
      • Set NAME[11] = (Name of Player 11 (Dark Green))
      • Set NAME[12] = (Name of Player 12 (Brown))
  • return player names
    • Events
      • Player - Player 1 (Red) types a chat message containing -return as An exact match
      • Player - Player 2 (Blue) types a chat message containing -return as An exact match
      • Player - Player 3 (Teal) types a chat message containing -return as An exact match
  • bla bla bla........
    • Conditions
    • Actions
      • Player - Set name of (Triggering player) to NAME[(Player number of (Triggering player))]
 
Last edited:
Level 3
Joined
Jul 13, 2008
Messages
38
Happy to see it works. As for the custom script i showed you to remove the trigger, i would suggest it for anyone if they understand what they are doing. If the trigger is only going to run once and never again in the game then yes use it. Other then that if you are not sure i wouldn't, it might cause some problems.
 
Level 6
Joined
Jul 25, 2005
Messages
221
zapleaf said:
Happy to see it works. As for the custom script i showed you to remove the trigger, i would suggest it for anyone if they understand what they are doing. If the trigger is only going to run once and never again in the game then yes use it. Other then that if you are not sure i wouldn't, it might cause some problems.

If you ask me, that function is overrated.
To be honest, if you're telling rookies to start using JASS functions they know very little about, at least explain what it does and why you should use it.

No offense. :cute:

(I am of course assuming that the OP is a rookie)
 
Status
Not open for further replies.
Top