Game Development Community

Unknown Command Warning

by USC - IMD student 2 · in Torque Game Builder · 03/12/2006 (8:28 am) · 5 replies

I get the the warning "T2D/client/enemyTouch.cs (33): Unknown command moveTo." and other various warnings when I call certain commands. Is this due to my engine version? Do I need to download something else?

Here's an example where I get warned:
%ienemy.moveTo( %ienemy.nextPosition, %ienemy.speed, false, true, true, 0.03 );

#1
03/12/2006 (9:04 am)
Can you provide us more code? it will be hard to determine the error with the little you have given.
How about posting the entire function so that we can see how %ienemy is determined etc? also, what is %ienemy supposed to be? have you tried %ienemy.dump(); ???

-Ron
#2
03/12/2006 (9:09 pm)
What version are you using ?
#3
03/13/2006 (7:10 am)
I tried the dump, the %obj.moveTo was not listed. I'm guessing that's b/c i'm using the deprecated v1.0.2. I would like to use the moveTo function and other functions that are not built into v1.0.2. I've downloaded v1.1. Thus I need to convert a lot of existing code that I wrote for 1.0.2 to code for 1.1. Right now I'm going throught the basic tutorial inside the 1.1 download. Please let me know what you think is the best way to go about figuring out what I need to change so that the 1.1 version recognizes my code.

Here's the relevent code in 1.0.2, just in case:

function createEnemyTouch( %ix, %iy, %iclockwise, %ispeed, %idir, %ibox ) {
%in = $enemyTouchCounter++;
$enemyTouch::names[ %in ] = "enemy" @ %in;
$enemyTouch[ %in ] = new fxStaticSprite2D() { scenegraph = t2dSceneGraph; };
$enemyTouch[ %in ].setImageMap( spikeballImageMap );
$enemyTouch[ %in ].setSize( "2 2" );
$enemyTouch[ %in ].setPosition( %ix SPC %iy );
$enemyTouch[ %in ].setCollisionActive( true, true );
$enemyTouch[ %in ].setCollisionCallback( true );
$enemyTouch[ %in ].setGroup( 2 );
$enemyTouch[ %in ].setLayer( 2 );
$enemyTouch[ %in ].clockwise = %iclockwise;
$enemyTouch[ %in ].box = %ibox;
if( %iclockwise )
$enemyTouch[ %in ].setAngularVelocity( 180 );
else
$enemyTouch[ %in ].setAngularVelocity( -180 );
$enemyTouch[ %in ].LinearVelocityX = 0;
$enemyTouch[ %in ].LinearVelocityY = 0;
$enemyTouch[ %in ].speed = %ispeed;
$enemyTouch[ %in ].id = %in;
$enemyTouch[ %in ].type = "enemytouch";
$enemyTouch[ %in ].lastDirection = %idir;
$enemyTouch[ %in ].nextDirection = getNextDirection( $enemyTouch[ %in ] );
$enemyTouch[ %in ].nextPosition = getNextPosition( $enemyTouch[ %in ] );
enemyTouchMove( $enemyTouch[ %in ] );
}

function enemyTouchMove( %ienemy ) {
getNextPosition( %ienemy ); //sets next position for enemy to move to.
%ienemy.moveTo( %ienemy.nextPosition, %ienemy.speed, false, true, true, 0.03 );
}

function fxSceneObject2D::onPositionTarget( %ienemy ) {
enemyTouchMove( %ienemy );
}

Thanks!!
#4
03/13/2006 (5:36 pm)
Change " fxStaticSprite2D" to "t2dStaticSprite"

"t2dSceneGraph" to "t2dScene"

"function fxSceneObject2D::onPositionTarget" to "function t2dSceneObject::onPositionTarget"

Your velocities might be too high, the num values were scaled down so lower numbers are better :)
#5
03/13/2006 (11:40 pm)
.setGroup needs to become .setGraphGroup