Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Icey on Sun 24/06/2012 20:29:12

Title: Expected ; even when there is one.[solved]
Post by: Icey on Sun 24/06/2012 20:29:12
So tried to run the game when I get an saying expected ;. I looked and seen there is already one.
Code (AGS) Select
Features.Text = "ATK+: %d  DEF+: %d",_DawnStorm, _DawnStormDEF;
Title: Re: Expexted ; even when there is one.
Post by: Khris on Sun 24/06/2012 20:33:24
AGS expects the semicolon after the string; you can't put values inside strings like that, you need String.Format:
Code (ags) Select
Features.Text = String.Format("ATK+: %d  DEF+: %d", _DawnStorm, _DawnStormDEF);
Title: Re: Expected ; even when there is one.
Post by: Icey on Sun 24/06/2012 20:36:06
Oh how foolish of me. I have to do that for displaying HP/MP and stuff. But still, thanks. As long as I remember that then I shouldn't run into this prob again.