Hello, today I come here with a question in mind that bothered me for a while.
Is it possible to change a unit's name to a player's name?
For example, if two players start a game with a same unit called 'Protoss Explorer,' it's normally going to be -
Player 1: Protoss Explorer
/ Player 2: Protoss Explorer
So can it be changed to like -
Player 1: Name of Player 1
/ Player 2: Name of Player 2
- this?
I searched Google through and through but nothing came out except adding tags on top of units via triggers.
I also modified the behavior to change the unit's name by adding "<d ref="PlayerName(1)"/>" but it didn't work.
Is it truly impossible to change a unit's name to a player's name? If so, please give me the answer as I've been working on this for quite a while to no avail.
Just a theory: Have multiple (as many players as you have) units of the same type of unit in the data editor. Then use the trigger editor and use catalog triggers to set the name for each unit.
Well, worst case scenario, if you don't find a data way - you can change units name through triggers by using "Catalog Field Value Set". It'll change unit types name for that player (so it only works if you only use one of said unit per player).
I was using that method earlier to colour units names before I found random name field (I didn't want color tags to mess up my unit data view).
Edit: Outsider beat me by a minute :D, shorta. To add to waht he said, catalog changes are per player based (think upgrades, every player has his own copy of data database that he can effect with upgrades).
Edit: Outsider beat me by a minute :D, shorta. To add to waht he said, catalog changes are per player based (think upgrades, every player has his own copy of data database that he can effect with upgrades).
----
Really? He won't have to duplicate units for it? Cool.
Thank you OutsiderXE and DuckyTheDuck for the answers:)
I just made an action 'Catalogue Field Value Set' and set the values to -
Catalogue: Units /
Entry: ViacreProtossExplorer /
Field Path: Name /
Value: ?
- and here I'm having trouble again. There seems to be no function to convert text to string in the functions, which is needed for the Player's Name. So I tried using <d ref="PlayerName(1)"/> in the Value(String) field to no avail. Is there any way to use a Player's Name in the Value? (Such as custom script)
Instead of creating X number of units for X number of players
maybe you can create X number of upgrades for X number of players, with each upgrade simply modifying the name
Damn, I'm sorry, I did not double check before posting, I should have.
After searching for an hour for a way to get player name into a string I found none =/
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Dear the community of SC2Mapster,
Hello, today I come here with a question in mind that bothered me for a while.
Is it possible to change a unit's name to a player's name?
For example, if two players start a game with a same unit called 'Protoss Explorer,' it's normally going to be -
Player 1: Protoss Explorer / Player 2: Protoss Explorer
So can it be changed to like -
Player 1: Name of Player 1 / Player 2: Name of Player 2
- this?
I searched Google through and through but nothing came out except adding tags on top of units via triggers. I also modified the behavior to change the unit's name by adding "<d ref="PlayerName(1)"/>" but it didn't work.
Is it truly impossible to change a unit's name to a player's name? If so, please give me the answer as I've been working on this for quite a while to no avail.
Thanks in advance,
[email protected]
Just a theory: Have multiple (as many players as you have) units of the same type of unit in the data editor. Then use the trigger editor and use catalog triggers to set the name for each unit.
EDIT: NEVERMIND, IT DOES NOT WORK THIS WAY
Well, worst case scenario, if you don't find a data way - you can change units name through triggers by using "Catalog Field Value Set". It'll change unit types name for that player (so it only works if you only use one of said unit per player).I was using that method earlier to colour units names before I found random name field (I didn't want color tags to mess up my unit data view).Edit: Outsider beat me by a minute :D, shorta. To add to waht he said, catalog changes are per player based (think upgrades, every player has his own copy of data database that he can effect with upgrades).Quote from DuckyTheDuck:
Edit: Outsider beat me by a minute :D, shorta. To add to waht he said, catalog changes are per player based (think upgrades, every player has his own copy of data database that he can effect with upgrades).
----
Really? He won't have to duplicate units for it? Cool.
Thank you OutsiderXE and DuckyTheDuck for the answers:)
I just made an action 'Catalogue Field Value Set' and set the values to -
Catalogue: Units / Entry: ViacreProtossExplorer / Field Path: Name / Value: ?
- and here I'm having trouble again. There seems to be no function to convert text to string in the functions, which is needed for the Player's Name. So I tried using <d ref="PlayerName(1)"/> in the Value(String) field to no avail. Is there any way to use a Player's Name in the Value? (Such as custom script)
Instead of creating X number of units for X number of players maybe you can create X number of upgrades for X number of players, with each upgrade simply modifying the name
Damn, I'm sorry, I did not double check before posting, I should have. After searching for an hour for a way to get player name into a string I found none =/