• 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.

[Trigger] I failed to store and load names of players

Status
Not open for further replies.
What is here wrong?
-Trigger:
*Save:
33x1hSd.png

eNxvFRE.png

*Load:
f6eLJmq.png

Y8qP71t.png

-Variables:
AsmAG8i.png
k3GXKvS.png
 
Level 11
Joined
Jun 2, 2013
Messages
613
You're overwriting every single one of those variables with "picked player" which just goes through all the picked players, and then gets set to player 12 - since that's the last picked player..

What you need to do is create a PlayerName[] array variable. (string)

Pick every player in all players and do
set PlayerName[(Player Number of Picked player)] = name of picked player.
 
Last edited:
You're overwriting every single one of those variables with "picked player" and it just goes through all the picked players, so they all should get set to player 12 - since that's the last picked player..

What you need to do is create a PlayerName[] array variable. (string)

Pick every player in all players and do
set PlayerName[(Player Number of Picked player)] = name of picked player.
Is it important what array number is set?
EDIT:Never mind,that was a dumb question.You don't need to answer. x)
 
I don't get it,i cant even return one player name.
It get's changed to the name of the second player.

I showed you the exact solution to the problem, Bora. Why didn't you follow it?

  • Player Names
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set tempPlayer = (Picked player)
          • Set tempInt = (Player number of tempPlayer)
          • Set PlayerName[tempInt] = (Name of tempPlayer)

Then whenever you need to refer to it:
  • Actions
    • Set tempPlayer = (Triggering player)
    • Set tempInt = (Player number of tempPlayer)
    • Game - Display to (All players) the text: PlayerName[tempInt]
 
I showed you the exact solution to the problem, Bora. Why didn't you follow it?
I did it like this,but i did something wrong on variables.So im sure it has something to do with the array number or with the integer.
Integer i have set to 12.
Array number to 1.
I need it for 11 players.
EDIT:i forgot to say,i want that they get the name back.
P.S. i have try to set this on the button for triggering player,but i don't works,so i have try to set it to picked player,it loads the second player name.
btw.The event is when unit enters different region.
 
I did it like this,but i did something wrong on variables.So im sure it has something to do with the array number or with the integer.
Integer i have set to 12.
Array number to 1.
I need it for 11 players.
EDIT:i forgot to say,i want that they get the name back.
P.S. i have try to set this on the button for triggering player,but i don't works,so i have try to set it to picked player,it loads the second player name.
btw.The event is when unit enters different region.

The triggers I showed you LITERALLY does that. Dont edit the default variable types... leave them as is when you create them. Instead of triggering player, just do Owner of Triggering Unit.
 
Status
Not open for further replies.
Top