November 3, 2005

Quake IV/Doom3 Script Errors?

Are you working on a mod for "Quake IV" or "Doom3"? Are you getting odd script errors like the following?

ERROR: Error: file scripts/maps/my_q4_mod.script, line 119: '}' is not a name

If so, don't worry. Check to see if you have an empty else clause in your code.

Evidently, if you have an else clause without at least one executable statement in it somewhere in your script, your script won't compile.

A common reason for this occuring is if you use sys.println() to dump debug spews to the console. You may end up with a code snippet like this:

//sys.println( "I AM COMMENTED OUT" );

If the above else is in your script, the script will not compile because there is no executable code in that script block. To correct the problem, either remove the else clause, or comment out the else block entirely by placing a /* immediately before the else keyword, and a */ immediately after the close bracket.

Update 11/4/2005, 8:41am: Corrected typo, grammatical error.

No comments: