| 08-04-2002, 08:14 PM | #1 |
Guest | Hey, is there any way to insert the text value of a variable into a text message that is displayed to the players? For instance, what if the color of a player were different each game, and you set that color to a variable saying "Set PlayerColor = Color of (Picked Player)" or whatever - the point being that PlayerColor is now my variable... So if I wanted to send a message to players (say it's a Quest message with a ding) that "The <PlayerColor> player has acquired the item!" - how do you put that variable into the text that's displayed so that it says "The Red player has acquired the item!" - ? |
| 08-04-2002, 10:58 PM | #2 |
Well, because there's no PlayerColor2String function, you're going to have to do something like this: If (player color comparison: player color equal to red) then game text, "Red did blah blah" If (player color comparison: player color equal to blue) then game text, "Blue did blah blah" |
| 08-04-2002, 11:58 PM | #3 |
Guest | That's a lot of work for a game that'll have 12 players with a randomly selected team captain, but hey - that solution will work :) Thanks. |
| 08-05-2002, 01:04 AM | #4 |
You don't need to go quite that far dataangel. Have a loop (pick every player?) which runs on map initilization which sets a string (p1 color?) = to a string of their color (if color comparison(picked player) = red P1Color="Red" else if color comparison(picked player) = blue then P1Color= "Blue" ect This could of course be simplified by using an array, and probably should be done by using an array.... Make an array of strings, and instead of P1Color="Blue" do playerColors[player Number (Picked player)]="Blue" And if that doesn't make sense let me know (oh playerColors is the name of the array, put whatever name you like; and when you want to have the personalized message you just need to say concatinate strings and put in playerColors[Player Number You Want The Color For] as one of the strings... |
