• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Naming a Unit at the start of a map.

Status
Not open for further replies.
Level 6
Joined
Dec 9, 2014
Messages
176
I was wondering if someone could help me with a trigger that would allow the player to name their hero at the start of a map? Also, would it possible to take whatever they name it and use it as a variable or something so I can insert it into future npc dialog?
 
So what I was thinking was that when the map first starts it asks what you would like your name to be and then the player types whatever they want and from then on that name is used in future interactions with npcs. Any tips on where to start with that?
 
This example map allows you to set your character name for cinematics or whatever else you want to use the string in.

Awesome! Thanks so much! I made one as well, but yours is much better lol! Here was my attempt.

  • Naming
    • Events
      • Player - Player 1 (Red) types a chat message containing /n as A substring
    • Conditions
    • Actions
      • Set Name = (Substring((Entered chat string), 4, (Length of (Entered chat string))))
      • Player - Set name of Player 1 (Red) to (Substring((Entered chat string), 4, (Length of (Entered chat string))))
      • Trigger - Turn off (This trigger)
 
Status
Not open for further replies.
Back
Top