Parse error on my very first line of code... go me.
by Robert Clarke · in Torque Game Builder · 03/06/2010 (7:59 am) · 3 replies
Hi guys,
I'm following the old RTS tutorials over at the TDN (I’m new, still playing with the demo). I've added an exec MouseMove.cs to my Main.cs as you would expect, however it fails to compile the Script file on line 1. The console spews the following at me.
My first thought was that there were some unscrupulous characters hiding in there causing the compiler to choke, I’m using Microsoft Visual C# Express 2008 as my IDE. However, I am fairly sure this is not the case. The top of my MouseMove.cs reads as follows.
Think I might get Torsion with TGB when I get paid. Helpful comments, thoughts, verbal abuse, all welcome.
I'm following the old RTS tutorials over at the TDN (I’m new, still playing with the demo). I've added an exec MouseMove.cs to my Main.cs as you would expect, however it fails to compile the Script file on line 1. The console spews the following at me.
Quote:Compiling C:/Documents and Settings/Robert/My Documents/JUMP/game/gameScripts/MouseMove.cs...
C:/Documents and Settings/Robert/My Documents/JUMP/game/gameScripts/MouseMove.cs Line: 1 - parse error
>>> Advanced script error report. Line 1.
>>> Some error context, with ## on sides of error halt:
»¿//Robert Clarke 06/03/2010 A test file for creating mouse move functions.
##
##
// --------------------------------------------------------------------
// InitMouse()
//
// This function is called by the game.cs at start up.
// Its creates the container Selections, sets the selection limit, and
// eventually creates the box selection graphic.
>>> Error report complete.
My first thought was that there were some unscrupulous characters hiding in there causing the compiler to choke, I’m using Microsoft Visual C# Express 2008 as my IDE. However, I am fairly sure this is not the case. The top of my MouseMove.cs reads as follows.
//Robert Clarke 06/03/2010 A test file for creating mouse move functions.
// --------------------------------------------------------------------
// InitMouse()
//
// This function is called by the game.cs at start up.
// Its creates the container Selections, sets the selection limit, and
// eventually creates the box selection graphic.
//---------------------------------------------------------------------
function initMouse()
{
//create the selection container object.
new SimSet(Selections);
//this is the limit of the objects that you can select.
$selectionLimit = 20;
//Create the selection box graphic?
//...
}Think I might get Torsion with TGB when I get paid. Helpful comments, thoughts, verbal abuse, all welcome.
#2
03/06/2010 (8:42 am)
lol! You know Ryan I was really confused for a moment as to where that onload function had come from. It was not part of my code, then I realised that I had accidently copied and pasted it from the MarkUpLite example. I've amended it now so it looks as it should. I'm such a noob. So yeah the problem still stands.
#3
03/06/2010 (11:11 am)
And the winner is... the Hex Editor. Why didn't I try that first.
Torque Owner Ryan Mounts
CornerstoneViz
//Robert Clarke 06/03/2010 A test file for creating mouse move functions. function onload() { // Do post-loading stuff here... } // -------------------------------------------------------------------- // InitMouse() // // This function is called by the game.cs at start up. // Its creates the container Selections, sets the selection limit, and // eventually creates the box selection graphic. //--------------------------------------------------------------------- function initMouse() { //create the selection container object. new SimSet(Selections); //this is the limit of the objects that you can select. $selectionLimit = 20; //Create the selection box graphic? //... }If that doesn't clear it up, you might look at the file in a hex editor and verify that there are no strange characters after your first comment (like a '00'... that would mess things up).