Help! Getting a buffer exceeded error- and REALLY can't find the issue!

Started by reismahnic, Sun 17/07/2016 07:53:17

Previous topic - Next topic

reismahnic

Hi, I am having a problem.
I made a game with a team over the course of a week for a jam- which ends pretty soon- and after changing a line of code I am getting the buffer exceeded error pointing at a dialog!
The issue is... I have no idea what could possibly be wrong! Here is the section of code the error points to:

Code: ags

// Dialog script file
@S  // Dialog startup entry point


//*Diane enters Office, where Joseph stands by computer*
cDiane: Woah... what...?
cJoseph: I've been saving up for a while, 
 cJoseph.FaceLocation(157,186,eBlock);
cJoseph: and... well, I bought a computer!
 cDiane.Walk(184,186,eBlock);
 cDiane.FaceLocation(184,185,eBlock);
 cJoseph.FaceLocation(156,185,eBlock);
 
return

@1
cJoseph: Yeah! I'm going to be using it for the business moving forward.
cJoseph: Should be able to keep better track of whose car needs what,
cJoseph: and save their information somewhere other than that huge stack of books.
cJoseph: No more, "Hey, Joseph! Why are you so forgetful?"!
cJoseph: How was school?
cDiane: It was fine. Whatever. Show me the computer!
cJoseph: Ok, well, I'm still learning how to use it, so... here,
cJoseph: there's this little game on here....
cJoseph: ...
goto-dialog Dialog_Scene1_2

@2
cJoseph: Well, I was hoping to use it for work.
cJoseph: Should be able to keep better track of whose car needs what, 
cJoseph: and save their information somewhere other than that huge stack of books.\
cJoseph: No more, "Hey, Joseph! Why are you so forgetful?"!
cDiane: I guess...
cJoseph: Is it the money? Because I promise this isn't like before.
cDiane: No, it's... it's fine.
cJoseph: ...here, let me show you something.
cJoseph: ...
goto-dialog Dialog_Scene1_2


The error reads: Dialog 14(9): Error (line 9): buffer exceeded: you probably have a missing closing bracket on a previous line


I think it's super weird and if anyone could help I would REALLY appreciate it! I've never had AGS do this to me before.
Thank you!

reismahnic

Sigh... cancel... it seems that backslash doesn't work within a dialog.
Sorry!

Mandle

Shouldn't it be:

return;

with the semi-colon?
(or is that not needed in dialogs?)

reismahnic

Not needed in dialogs.
It really was, in this case, the backslash throwing the script off. Apparently ending a dialog line with backslash is a big no-no to AGS.

Crimson Wizard

Quote from: reismahnic on Sun 17/07/2016 09:56:02
It really was, in this case, the backslash throwing the script off. Apparently ending a dialog line with backslash is a big no-no to AGS.
That could be a bug, but could you point out where this backslash is in your code example? Because I cannot find it. oh, nevermind, found it.

We need to find out how the backslashes are processed in script.

Snarky

How did you intend this to work? Would the backslash be part of what the character says? (If so, weird.)

In many programming languages, a backslash at the end of a line is a sign to "ignore the line break": that the next line is really a continuation of this line. If that's how the AGS dialog script parser interprets it, the next line won't be understood as a separate script command, and the lines are probably wrong.

I'm not sure whether that by itself causes the overflow, or whether it throws off the parser completely so that all the following lines get interpreted wrong.

In any case, just avoid it.

jwalt

No expert here, but check line 8 in the original post. It's a FaceLocation script command that is not indented.

reismahnic

Quote from: Snarky on Sun 17/07/2016 21:05:25
How did you intend this to work? Would the backslash be part of what the character says? (If so, weird.)

In many programming languages, a backslash at the end of a line is a sign to "ignore the line break": that the next line is really a continuation of this line. If that's how the AGS dialog script parser interprets it, the next line won't be understood as a separate script command, and the lines are probably wrong.

I'm not sure whether that by itself causes the overflow, or whether it throws off the parser completely so that all the following lines get interpreted wrong.

In any case, just avoid it.

Yeah, it wasn't intentional, but I overlooked it as an issue because I foolishly didn't realize an issue COULD occur in the middle of a dialog.
My bad!

SMF spam blocked by CleanTalk