Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Minitay on Fri 08/01/2016 09:21:06

Title: When running the game, an error with the GlobalScript.asc
Post by: Minitay on Fri 08/01/2016 09:21:06
i dont know why it does it, it always finds a problem in that script no matter what.
it started when i tried to make a character. then it said, that the command doesnt have closing braces (it did.)
so i erased all the character interactions, and the character itself, and now it finds problems within the script (that i didnt write).

GlobalScript.asc(32): Error (line 32): Parse error: unexpected 'System'

GlobalScript.asc(-10): Runtime error: Function still open, missing }

i tried to temper with the second error a little, and i counted the braces and all, and it still shows that. as for the first error im afraid to do anything with it.
Title: Re: When running the game, an error with the GlobalScript.asc
Post by: Snarky on Fri 08/01/2016 10:27:27
There's a problem either in the Globalscript header, or possibly in another script module above it. We'd have to see the whole thing to identify exactly what's wrong.
Title: Re: When running the game, an error with the GlobalScript.asc
Post by: Khris on Fri 08/01/2016 12:41:17
Since your tone implies otherwise, AGS is not out to get you. If it shows an error, it's because *you* made one.
Title: Re: When running the game, an error with the GlobalScript.asc
Post by: Snarky on Fri 08/01/2016 13:51:47
... but it's also true that this error message can be quite confusing, since the mistake isn't necessarily in the script indicated.

My understanding of what's going on, which may not be 100% accurate, is that AGS somehow collects all the scripts into one long document during the compilation process. When the parser hits an error, it figures out which script the bit that fails is in, but actually the mistake (such as a closing brace that's missing) could be much further up: it's just that the parser doesn't realize something is wrong until it gets to a point where you're trying to write something that absolutely can't go inside the still-open code block. Perhaps the error message could mention this?
Title: Re: When running the game, an error with the GlobalScript.asc
Post by: Khris on Fri 08/01/2016 15:46:26
Yes, the error message (and especially the line number) can be misleading.

Minitay: could you post your current GlobalScript? Just put it on pastebin.com and give us the link.
Also, are you using any special template? Because afaik the default game's GlobalScript doesn't contain "System" commands.
Title: Re: When running the game, an error with the GlobalScript.asc
Post by: Minitay on Sat 09/01/2016 08:44:21
well nevermind i gave up and remade the game (i needed to redraw the graphics and characters anyway)
haha whoops welp thread solved ">_>