• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Rename Players

Status
Not open for further replies.
Level 14
Joined
Dec 12, 2009
Messages
1,027
(Actions)
Set HeroName = <your hero>; HeroName is a unit variable type
Player - Set name of PlayerX (Color) to (Proper name of HeroName)

I use a variable since I don't know exactly which hero type will be used in my map, for your case you may be able to skip using a variable if the hero exists at map creation. If you find a better way, please let me know!

//\\oo//\\
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Here is a test map.

Instruction:
1. Type -name <yourNameHere> to change your name.

And like boris mentioned, we don't know how your hero is saved into a variable, that's why in my test map, I used it on a pre-existing unit (Blood Mage) to refer to the variable of the triggering unit.
 

Attachments

  • Rename Player.w3x
    12.5 KB · Views: 54
Level 4
Joined
Mar 13, 2014
Messages
93
  • Random
    • Events
      • Player - Player 1 (Red) types a chat message containing -random as An exact match
      • Player - Player 2 (Blue) types a chat message containing -random as An exact match
      • Player - Player 3 (Teal) types a chat message containing -random as An exact match
      • Player - Player 4 (Purple) types a chat message containing -random as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -random as An exact match
      • Player - Player 6 (Orange) types a chat message containing -random as An exact match
      • Player - Player 7 (Green) types a chat message containing -random as An exact match
      • Player - Player 8 (Pink) types a chat message containing -random as An exact match
      • Player - Player 9 (Gray) types a chat message containing -random as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -random as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -random as An exact match
      • Player - Player 12 (Brown) types a chat message containing -random as An exact match
    • Conditions
      • (Number of units in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))) Equal to 0
    • Actions
      • Set Random_Hero = (Random integer number between 1 and Random_Count)
      • Unit - Create 1 Hero_Array[Random_Data[Random_Hero]] for (Triggering player) at ((Owner of (Triggering unit)) start location) facing Default building facing degrees
      • Game - Display to (All players) the text: (PlayerNames[(Player number of (Triggering player))] + ( |cff32cd32Has randomed|r + (Name of (Last created unit))))
      • Player - Set name of (Triggering player) to ((Name of (Triggering player)) + ( + (( + ((Proper name of (Last created unit)) + )))))
      • Selection - Select (Last created unit) for (Owner of (Last created unit))
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Make (Unit-type of (Last created unit)) Unavailable for training/construction by (Picked player)
      • Set Random_Data[Random_Hero] = Random_Count
      • Set Random_Count = (Random_Count - 1)
  • Repick Command Copy
    • Events
      • Player - Player 2 (Blue) types a chat message containing -repick as An exact match
      • Player - Player 3 (Teal) types a chat message containing -repick as An exact match
      • Player - Player 4 (Purple) types a chat message containing -repick as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -repick as An exact match
      • Player - Player 6 (Orange) types a chat message containing -repick as An exact match
      • Player - Player 8 (Pink) types a chat message containing -repick as An exact match
      • Player - Player 9 (Gray) types a chat message containing -repick as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -repick as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -repick as An exact match
      • Player - Player 12 (Brown) types a chat message containing -repick as An exact match
    • Conditions
      • (Number of units in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True))) Equal to 1
    • Actions
      • Game - Display to (All players) the text: ((Name of (Picked player)) + Has Repicked)
      • Unit Group - Pick every unit in (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True)) and do (Actions)
        • Loop - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Player - Make (Unit-type of (Last created unit)) Available for training/construction by (Picked player)
          • Unit - Remove (Picked unit) from the game
      • Set Random_Hero = (Random integer number between 1 and Random_Count)
      • Unit - Create 1 Hero_Array[Random_Data[Random_Hero]] for (Triggering player) at ((Owner of (Triggering unit)) start location) facing Default building facing degrees
      • Selection - Select (Last created unit) for (Owner of (Last created unit))
      • Game - Display to (All players) the text: (PlayerNames[(Player number of (Picked player))] + ( |cff32cd32Has Repicked into |r + (Name of (Last created unit))))
      • Player - Set name of (Triggering player) to ((Name of (Triggering player)) + ( + (( + ((Proper name of (Last created unit)) + )))))
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Make (Unit-type of (Last created unit)) Unavailable for training/construction by (Picked player)
      • Set Random_Data[Random_Hero] = Random_Count
      • Set Random_Count = (Random_Count - 1)
  • Pick
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Sold unit) is A Hero) Equal to True
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Make (Unit-type of (Sold unit)) Unavailable for training/construction by (Picked player)
      • Game - Display to (All players) the text: ((Name of (Picked player)) + ( |cff32cd32Has chosen|r + (Name of (Sold unit))))
      • Player - Set name of (Owner of (Sold unit)) to (PlayerNames[(Player number of (Picked player))] + ( + (( + ((Proper name of (Sold unit)) + )))))
      • Selection - Select (Sold unit) for (Owner of (Sold unit))
      • Camera - Pan camera for Player 2 (Blue) to (Center of Anime Team 1 <gen>) over 0.00 seconds
      • Camera - Pan camera for Player 3 (Teal) to (Center of Anime Team 1 <gen>) over 0.00 seconds
      • Camera - Pan camera for Player 4 (Purple) to (Center of Anime Team 1 <gen>) over 0.00 seconds
      • Camera - Pan camera for Player 5 (Yellow) to (Center of Anime Team 1 <gen>) over 0.00 seconds
      • Camera - Pan camera for Player 6 (Orange) to (Center of Anime Team 1 <gen>) over 0.00 seconds
      • Camera - Pan camera for Player 8 (Pink) to (Center of Anime Team 2 <gen>) over 0.00 seconds
      • Camera - Pan camera for Player 9 (Gray) to (Center of Anime Team 2 <gen>) over 0.00 seconds
      • Camera - Pan camera for Player 10 (Light Blue) to (Center of Anime Team 2 <gen>) over 0.00 seconds
      • Camera - Pan camera for Player 11 (Dark Green) to (Center of Anime Team 2 <gen>) over 0.00 seconds
      • Camera - Pan camera for Player 12 (Brown) to (Center of Anime Team 2 <gen>) over 0.00 seconds
      • Unit - Move (Sold unit) instantly to ((Owner of (Sold unit)) start location)
      • Set Random_Data[Random_Hero] = Random_Count
      • Set Random_Count = (Random_Count - 1)
      • Trigger - Turn on Chance Sell Units <gen>
  • Player Name
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set PlayerNames[1] = (Name of (Matching player))
      • Set PlayerNames[2] = (Name of (Matching player))
      • Set PlayerNames[3] = (Name of (Matching player))
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Player - Set name of (Triggering player) to PlayerNames[(Integer A)]
 
Level 26
Joined
Aug 18, 2009
Messages
4,099
  • Player Name
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Player - Set name of PlayerNames[(Integer A)] to (Name of (Player(Integer A)))
and then

  • Player - Set name of <player> to (PlayerNames[(Player number of (<player>))] + (" " + <heroName>))
 
Status
Not open for further replies.
Top