value of variable in text message

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

P0RC4_S0L7A
Newcomer
Posts: 3
Joined: February 24th, 2012, 4:20 pm

value of variable in text message

Post by P0RC4_S0L7A »

I have created a variable "host" and "kitter" of type "Player" and i want to show the value of variable in the action:

Game - Display to (All players) for 100000.00 seconds the text: Host "host" have used Ck in the player "kitter".

How i make to show the value of variables in the text ????
User avatar
Syre
Forum Staff
Posts: 506
Joined: November 17th, 2008, 3:49 pm

Re: value of variable in text message

Post by Syre »

Code: Select all

Game - Display to (All players) for 30.00 seconds the text: (Host + ((Name of host) + ( have the Ck in the player  + (Name of kitter))))

Is what your looking for. To do this you will need to use multiple concatenate strings...so the steps are -
1. New Action
2. Game - Text Message
3. Click "Text".
4. Click dropdown bar and set to "Concatenate Strings".
At this point it should say "String 1 + String 2" in red letters. If it doesn't your on the wrong one.
5. Click "String 1" type in Host and add a space after so the text doesn't get jumbled.
6. Click "String 2" this time again select Concatenate Strings.
You should be at the menu where it says "String 1 + String 2" again.
7. Click "String 1" on the dropdown bar select "Player - Player name"
8. Click "Triggering Player" and set it to your host variable.
9. Click "String 2" and once more put Concatenate Strings.
10. Click "String 1" and type " have the Ck in the player ", again make sure to have a space before "have" and after "player"
11. Repeat steps 7 and 8 but this time for kitter variable.

Lots of steps but its pretty simple. Just a lot of repeating.
Image
naturesfury
Forum Spammer
Posts: 610
Joined: March 30th, 2009, 9:02 pm

Re: value of variable in text message

Post by naturesfury »

JASS is so much easier....
call DisplayTimedTextToForce(bj_FORCE_ALL_PLAYERS,30,"Host "+GetPlayerName(host)+" has used the Ck on the player "+GetPlayerName(kitter)+".")
User avatar
Syre
Forum Staff
Posts: 506
Joined: November 17th, 2008, 3:49 pm

Re: value of variable in text message

Post by Syre »

Yeah...but it aint that hard to do for GUI really it just takes time to explain. No real easy way to point out where the options to choose are.
Image