Author Topic: Unidentifiable syntax error  (Read 768 times)

I can't seem to find the "syntax error" in this. Can someone help me find it?
Code: [Select]
function fireScan(){
for(%i=0;%i<mainBrickGroup.getCount();%i++){
%group=mainBrickGroup.getObject(%i);
for(%a=0; %a <= %group.getCount(); %a++){
%brick=%group.getObject(%a - 1);
initContainerBoxSearch(%brick.position,"12 12 12",$TypeMasks::FxBrickObjectType);
%fireDetected=false;
%client=0;
while(%searchObj = containerSearchNext())
{
if(%searchObj.onFire){
%fireDetected=true;
%client=%searchObj.fireclient;
}
}
if(%fireDetected)
%brick.processInputEvent("onFireDetected",%client);
}
}
$fireScanSched=schedule(1000,0,fireScan);
}
registerInputEvent("fxDTSBrick","onFireDetected","Self fxDTSBrick\tClient GameConnection");
registerOutputEvent("fxDTSBrick","lightFire","",1);
fireScan();
It throws me this error:

Line: 35 (20 on this post) - Syntax error.
$fireScanSched=schedule(1000,0,fire##


Thanks.
« Last Edit: May 16, 2013, 10:55:19 PM by mitterdoo »

That's not the whole syntax error.  There should be something bounded by ##'s, not just floating there.

I get no syntax error when I compile the code myself, so you aren't providing enough information.

If I have to guess I'd say you're missing a curly brace somewhere else in your code.

That's not the whole syntax error.  There should be something bounded by ##'s, not just floating there.

I get no syntax error when I compile the code myself, so you aren't providing enough information.

I have a feeling you tried to make a change to an add-on that was already zipped, which causes errors.

When you're making add-ons, do not zip them until they are finished, that way you don't get random syntax errors that don't actually exist.

I have a feeling you tried to make a change to an add-on that was already zipped, which causes errors.

When you're making add-ons, do not zip them until they are finished, that way you don't get random syntax errors that don't actually exist.

This; the file length of a file inside of a zipped add-on doesn't update automatically, which means that your error is the "end" of the file. That's also why the ##s don't have a pair like they normally do.

You can use setModPaths(getModPaths()); as a hotfix, but as a general rule you shouldn't zip add-ons until you're ready to release it.

EDIT: Note: It isn't ACTUALLY at the end of the file. It's at where Blockland thinks the end of the file is.
« Last Edit: May 18, 2013, 04:02:19 PM by Xalos »

Thanks Chrono. I moved the files to separate folder.