Game Development Community

Why Doesnt This Work?! please help

by Chris Farley · in Torque Game Engine · 11/30/2006 (5:08 pm) · 2 replies

Iv been following the tutorials to the dot, but when i test my game in TGB there is always a "parse error in line 1" of the player.cs file i made.


heres the first lines of the file:

function PlayerFish::onLevelLoaded(%this, %scenegraph)
{
   $FishPlayer = %this;

   moveMap.bindCmd(keyboard, "w", "fishPlayerUp();", "fishPlayerUpStop();");
   moveMap.bindCmd(keyboard, "s", "fishPlayerDown();", "fishPlayerDownStop();");
   moveMap.bindCmd(keyboard, "a", "fishPlayerLeft();", "fishPlayerLeftStop();");
   moveMap.bindCmd(keyboard, "d", "fishPlayerRight();", "fishPlayerRightStop();");
}


can somebody please tell me why it doesnt work?! iv been stuck on this for an hour and i cant figure it out! please help.

#1
11/30/2006 (5:18 pm)
First, this should go in the TGB Public/Private Forums (if they don't show up for you, go to the Forum Listing and hit Edit Subscriptions) - you'll get more help there.

I don't see anything wrong with that. The only thing that comes to mind is that your script file is actually not a .cs file and has an appended hidden .txt extension or something.
#2
11/30/2006 (7:15 pm)
I second Tom. On the chance that you may have used copy/paste, there's a chance you grabbed a hidden character. Also, check the script before your player.cs, and make sure everything looks good there.