When running the game, an error with the GlobalScript.asc

Started by Minitay, Fri 08/01/2016 09:21:06

Previous topic - Next topic

Minitay

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.

Snarky

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.

Khris

Since your tone implies otherwise, AGS is not out to get you. If it shows an error, it's because *you* made one.

Snarky

... 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?

Khris

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.

Minitay

well nevermind i gave up and remade the game (i needed to redraw the graphics and characters anyway)
haha whoops welp thread solved ">_>

SMF spam blocked by CleanTalk