Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Icey on Sat 27/08/2011 01:53:33

Title: Parse error?
Post by: Icey on Sat 27/08/2011 01:53:33
I have this line in one of my scripts

explabel.Text String.Format("EXP: %d/%d", PlayerEXP, BaseEXP);

When I try to run the game I get any error message. I think it has to do something with the last two variables.
Title: Re: Parse error?
Post by: DoorKnobHandle on Sat 27/08/2011 02:25:42
As always, please let us know WHAT kind of error you are getting? Is it really when running the game or when trying to compile?

In that line there is an '=' missing but I remember you actually being too lazy to copy (!) in the correct code from your script before so I guess that might not be the problem.
Title: Re: Parse error?
Post by: Icey on Sat 27/08/2011 02:44:25
Ohh that's right. I forgot about the (=) sign.

I can' comment on that part about me being lazy cause that was like a minute ago(a while ago)

Therefore I will just leave it that and say thanks.
Title: Re: Parse error?
Post by: monkey0506 on Sat 27/08/2011 04:09:50
A parse error is almost always a user error*. Just looking at that line it should have been obvious what the problem was..if you've ever scripted anything in AGS before that is.

If I sound rude here it's only because you should have been able to figure it out yourself, and so I figured the sarcasm in my post was warranted. :P

*Very, very, very, very, very, very rarely it can be related to an editor bug.
Title: Re: Parse error?
Post by: Icey on Sat 27/08/2011 05:01:59
It didn't sound rude. I actually feel kinda stupid as there was two lines below it that had the = sign in it. I got caught up in the variables so I thought that was the problem. 


explabel.Text  String.Format("EXP: %d/%d", PlayerEXP, BaseEXP);
   Label3.Text = String.Format("HP:%d", playerHP);//Health
   Label6.Text = String.Format("MP:%d", playerMP);//Magic