Parse error
by CodingChris · in Torque Game Engine Advanced · 12/30/2007 (2:44 am) · 4 replies
Hi,
When I add this to my game scripts, I get all the time many pharse errors. I searched for the problem, but I could not find it... Please, help me!
When I add this to my game scripts, I get all the time many pharse errors. I searched for the problem, but I could not find it... Please, help me!
//-----------------------------------------------------------------------------
// Torque Shader Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Functions that implement game-play
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
package RacingGame {
//-----------------------------------------------------------------------------
function GameConnection::onClientEnterGame(%this)
{
commandToClient(%this, 'SyncClock', $Sim::Time - $Game::StartTime);
commandToClient(%this, 'SetGameGUI',"RacingGUI");
// Create a new camera object.
%this.camera = new Camera() {
dataBlock = Observer;
};
MissionCleanup.add( %this.camera );
%this.camera.scopeToClient(%this);
// Spawn the player
%this.score = 0;
%this.spawnPlayer();
}
//-----------------------------------------------------------------------------
function GameConnection::createPlayer(%this, %spawnPoint)
{
if (%this.player > 0) {
// The client should not have a player currently
// assigned. Assigning a new one could result in
// a player ghost.
error( "Attempting to create an angus ghost!" );
}
// Create the player object
%player = new WheeledVehicle() {
dataBlock = GXCarBase;
client = %this;
};
MissionCleanup.add(%player);
// Player setup...
%player.setTransform(%spawnPoint);
%player.setShapeName(%this.name);
// Starting equipment
// Update the camera to start with the player
%this.camera.setTransform(%player.getEyeTransform());
// Give the client control of the player
%this.player = %player;
%this.setControlObject(%player);
}
};About the author
#2
12/30/2007 (8:50 am)
Thanks, Gabriel. I do not see any erros either, but TGEA always says in the console "Parse error" and that all the time. It's really horrible. I've got a log file fuel of "parse error"...
#3
Also, it should be telling you what line number the error is happening at.
12/30/2007 (9:45 am)
*edit* Wait, I was wrong. That's the final line of the package. Make sure you call activatePackage() on what you are making.Also, it should be telling you what line number the error is happening at.
#4
12/30/2007 (10:56 am)
It's not telling me the line number, I just get the red "Parse error" and I'm activating the package correctly.
Torque Owner Gabriel Notman
Other than that (without trying to compile it) I was unable to see any errors in the script there.
Gabriel