I got this error message and I have no idea what's causing it :-\
Runtime error: Function still open, missing } | GlobalScript.asc | line -10
(http://i.imgur.com/cMKslhl.png)
AGS v3.3.3, December 2014
640*400 32 bit
Windows 7 Professional
...heh! Found the effin bracket :-[
Good (nod)
it also pays to save your game very often then you know instinctively your last scripting movements should an error occur ;)
Thanks mate ;-D
That's exactly how I figured it out.
How was it possible anyway? First, it sais "runtime error" - did it occur when game was run as opposed to compilation? If it did, then how did it compile at first place.
Second: line -10?
Can you give more info on how did this error occur? I think there might be something wrong with AGS.
I often encounter "-" lines... assumed that's AGS way of saying that it's not sure which script line is the cause?
Can't remember in which occasions I often get that though, sorry.
CW: I will mimic the same conditions to produce the same error and get back to you with this asap.
Thanks Cassiebsg for the note, and sorry for the double post :-\
CW, here's exactly what I just did now:
I undid the addition of the bracket
} which solved this topic. Then Ran the project (F5) and got exactly the same error:
(http://i.imgur.com/hLOLd5n.png)
(http://i.imgur.com/RTix0r4.png)
(http://i.imgur.com/kQc8H0p.png)
Then:
Quote from: AnasAbdin on Sun 20/09/2015 08:19:31
I got this error message and I have no idea what's causing it :-\
Runtime error: Function still open, missing } | GlobalScript.asc | line -10
(http://i.imgur.com/cMKslhl.png)
AGS v3.3.3, December 2014
640*400 32 bit
Windows 7 Professional
From memory, AGS will classify an error as a runtime error if it doesn't have a line number associated with it. Presumably, this means it got to the end of the input stream without finding '}'.
AnasAbdin, I think what would be useful here is to know where the bracket was missing, e.g. from the first function in GlobalScript (and was it the bracket containing the whole function or an internal bracket?), the last function, somewhere in the header, or what.
Quote from: Snarky on Mon 21/09/2015 08:57:26
AnasAbdin, I think what would be useful here is to know where the bracket was missing, e.g. from the first function in GlobalScript (and was it the bracket containing the whole function or an internal bracket?), the last function, somewhere in the header, or what.
Yes, this is what I wanted to know :).
I get those negative line errors when I forget a closing bracket at the bottom of a script. :-\ But get Anas' story none-the-less
ok sorry about that.
The bracket was missing from the last function in the Global.asc
The structure of the function is like this:
function pyramid_bgo_OnClick(GUIControl *control, MouseButton button)
{
while ( ... )
{
...
...
if ( ... )
{
...
}
else
{
if ( ... )
{
...
}
else
{
...
return;
}
}
}
...
...
} // <-- this was the forgotten bracket & the final line in the script
Okay, thank you, I could reproduce by putting this in the end of the script:
Quote
void F()
{
I will open a new issue, because the error message should be fixed.
Thanks Crimson really appreciate it :)