Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: mode7 on Sun 26/06/2011 22:28:25

Title: Buffer Exceeded - Line too long?[Solved]
Post by: mode7 on Sun 26/06/2011 22:28:25
I was messing around with AGS a little and stepped over an Buffer Exceeded Error.
This is not due a missing closing bracket. Here's the line:

surface.DrawTriangle(vertex[polygon[PC].a].x * polygon[PC].a].z*100, vertex[polygon[PC].a].y * vertex[polygon[PC].a].z*100, vertex[polygon[PC].b].x * vertex[polygon[PC].b].z*100, vertex[polygon[PC].b].y * vertex[polygon[PC].b].z*100, vertex[polygon[PC].c].x * vertex[polygon[PC].c].z*100, vertex[polygon[PC].c].y * vertex[polygon[PC].c].z*100);

I think I remember there is a 500 chars per line limit in ags. If this is the case, Is there some kind of workaround?
Title: Re: Buffer Exceeded - Line too long?
Post by: DoorKnobHandle on Sun 26/06/2011 22:29:36
Split it up into multiple lines!

Quote from: mode7 on Sun 26/06/2011 22:28:25

surface.DrawTriangle(vertex[polygon[PC].a].x * polygon[PC].a].z*100, vertex[polygon[PC].a].y * vertex[polygon[PC].a].z*100, vertex[polygon[PC].b].x * vertex[polygon[PC].b].z*100,
vertex[polygon[PC].b].y * vertex[polygon[PC].b].z*100, vertex[polygon[PC].c].x * vertex[polygon[PC].c].z*100, vertex[polygon[PC].c].y * vertex[polygon[PC].c].z*100);

Title: Re: Buffer Exceeded - Line too long?
Post by: Khris on Sun 26/06/2011 22:44:02
I was replacing the struct names with letters to check for errors and got this:

surface.DrawTriangle(
v[p[PC].a].x *   p[PC].a].z*100, v[p[PC].a].y * v[p[PC].a].z*100,
v[p[PC].b].x * v[p[PC].b].z*100, v[p[PC].b].y * v[p[PC].b].z*100,
v[p[PC].c].x * v[p[PC].c].z*100, v[p[PC].c].y * v[p[PC].c].z*100
);


As you can see, a missing opening bracket seems to be the reason for the error.

In other words, add "vertex[" after the first "*".
Title: Re: Buffer Exceeded - Line too long?
Post by: mode7 on Sun 26/06/2011 23:28:28
 ::) thanks a lot for that khris, sorry I should've checked more thoroughly before posting.
Also thanks DKH, I didnt know you could break lines. makes it much easier to format long and convulted expressions like Khris did.