gah.
On one of the many GUIs in my game, only one has text that has a variable in it. The text in question is supposed to show an integer value, but I can't even get it to compile. Even copy/pasting from the Help comes up with this error:
GlobalScript.asc(118): Error (line 118): Parse error in expr near '"Cash: %d"'
Here's the code:
//set the cash monitor to the current amount of cash on hand
ShopGuiCashMonitor.Text = ("Cash: %d", Cash);
//display the now correctly formatted shop GUI
ShopGuiBuy.Clickable = false; // The buy button is not visible, since nothing has been selected.
Shop.Visible = true;
ShopGuiCashMonitor is a label. It works perfectly until I try to toss a variable at it.
Use String.Format, like this:
ShopGuiCashMonitor.Text = String.Format("Cash: %d", Cash);
Try using: ShopGuiCashMonitor.Text = String.Format("Cash: %d", Cash);
[edit]
hehe, 4 seconds too late ...
Thanks!
Works perfectly now. I didn't realize that I had to do that :P