"Unexpected '}'"? But I don't have any of them!

Started by Technocrat, Sat 29/05/2010 09:55:48

Previous topic - Next topic

Technocrat


This is a strange one. Every time I try to compile, it complains about this one bit of script -

<222> if(UnitSelected>-1){
<223> if(SqContent[50]==5) Display("Hello");
<224>}
<225>

The game claims that, in line 223, there's an unexpected } but unless I'm going blind, I can see no such thing. I have many other similar instances of code all over the script, but this is the first time it's started complaining, even if I copy/paste it from other parts. What on earth is it complaining about, and how can I fix it?

The exact message it gives is:

GlobalScript.asc(223): Error (line 223): Unexpected '}'

tzachs

From my experience the error messages/lines given by AGS can sometimes be misleading.
Try looking at the lines before 222 and search for a missing/extra { or } or "...

Dualnames

No point at all, and it's definitely not what causes your thing, but I'd do that.
Code: ags

if ((UnitSelected>-1) && (SqContent[50]==5)) {
      Display("Hello");
}

Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

SMF spam blocked by CleanTalk