Player's name in ingame text like in DotA?

Status
Not open for further replies.

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
Ah, i've forgotten to tell, for smooth use this to get player name:
  • Set string = (Name of Player 1 (Red))
'string' is a variable here. and then:
  • Game - Display to (All players) the text: (string + ( has pawned + (Name of Player 2 (Blue))))
You can use this for namy players.

Egzample in previous post will do that too, however variable will be better anyways.
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
You use the native which returns a string of the name of a certain player in combination with string concatination with constant strings.

  • Game - Display to (All players) the text: ((Name of Player 1 (Red)) + ( has pawned + (Name of Player 2 (Blue))))
Is a conmbination of strings with certain players? Don't say me that you looked only on second egzample, I just wanted to show that he can also use variable strings, becasue meaby he also needs players name for other stuff.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,124
Utalizating variables is part of the implimentation, the principle still remains the same. What you are advising him to do is cahce intermitent results to reduce coupling and improve perofrmance in the case that the player name is needed multiple times in the same procedure.
 
Status
Not open for further replies.
Top