Author Topic: Centerprint problem... -Solved ._. -  (Read 476 times)

Last post before I go to bed.

Anyways, for some reason, code that worked flawlessly before is now dumping a stuffload of syntax errors. Even if I comment out commandToClient, the next commandToClient takes its place in the syntax error bullstuff.

console.log:
Quote
>>> Some error context, with ## on sides of error halt:
%filename = "config/server/Relativity.txt";

$RelativityTxt.openForAppend(%filename);

%client.makingCustomCount = 0;

%client.makingCustomRot = 0;

commandToClient(%player.client, 'centerPrint', "\cSelection Confirmed.\n\c5Click a brick to add it. Click the base to make the next rotation/finish."##,##2);

return;

}

if(%client.makingCustom == 5 && %client.makingCustomBase != %col) {

%client.makingCustomCount++;

%pos = strreplace(%client.makingCustomBase.position, " ", "\t");

%bx = getField(%pos,0);

%by = getField(%pos,1);

%bz = getField(%pos,2);

>>> Error report complete.

Same loving code but with %player.client and the string replaced ingame:


I didn't get a screenshot because I closed BL before but copying what I wrote in evalchat and pasting it in the console gives the SAME SYNTAX ERROR AS THE ADD-ON!

« Last Edit: March 05, 2015, 09:36:31 PM by Pie Crust »

\cS is not a valid color code, and is probably what's throwing the syntax error.  A hint for the future: The error context doesn't show you EXACTLY where the error is, it shows you when the parser REALIZED there was an error.  Usually you'll need to look at the double-pounded area or somewhere a little before it, but in very rare cases the true problem can be lines before the line it decides to notate, and may not even be visible in the error context dump.

I could have sworn I pressed 2. Another issue caused by a stupid symbol missing.

The most common errors I have with coding are missing brackets, semi-colons, etc. Lol