( object ); a"> Syntax error in aiPlayer.cc | Torque Game Engine | Forums | Community | GarageGames.com

Game Development Community

Syntax error in aiPlayer.cc

by Michael Schaumburg · in Torque Game Engine · 12/05/2002 (11:48 am) · 3 replies

If you need to stop your bot/npc with the function AIPlayer::stopMove() you must correct a syntax error in the file aiPlayer.cc

ConsoleMethod( AIPlayer, stop, void, 2, 2, "ai.stopMove();" )
{
AIPlayer *ai = static_cast( object );
ai->stopMove();
}

replace it with :

ConsoleMethod( AIPlayer, stopMove, void, 2, 2, "ai.stopMove();" )
{
AIPlayer *ai = static_cast( object );
ai->stopMove();
}

There was missing the Move in stopMove.

#1
12/05/2002 (12:38 pm)
Is that really a syntax error? It LOOKS like the console method for the AIPlayer was meant to be "stop" while the C++ function was called "stopMove". Your script could have just called "aiplayer->stop()" and worked fine. Or am I being dense again?
#2
12/05/2002 (1:08 pm)
I would have opted for the .cs change, less hassel and no recompiled needed (that is a recompile of the binary)

-Ron
#3
12/05/2002 (1:23 pm)
Ok, but if you use like it is written in aiPlayer.cs you get problems :

// The AIPlayer C++ class implements the following methods.
//
// AIPlayer::stopMove();
// Stop the player where he is.
//

First I was thinking where is my mistake, such an easy function.......