Game Development Community

And yet another error! AARGH

by Tasty Green Pees :-, · in Torque Game Engine · 02/19/2006 (2:20 pm) · 2 replies

I followed the tutorial to use the rocket launcher. In player.cs I added these lines as advised:

function PlayerShape::onAdd(%this,%obj)
{
    parent::onAdd( %this, %obj );
    %obj.mountImage( RocketLauncherImage, 0 );
    %obj.setImageAmmo( 0, 1 );
}

It seems to work fine but this error is grating me. Help please.

tutorial.base/server/player.cs (636): Unknown command onAdd.

#1
02/19/2006 (4:58 pm)
The error is saying that whatever class PlayerShape is derived from has no onAdd method for it to call. I have not looked at that rocket launcher code so I realy don't know why it's using a class called playerShape, but you are not alone in having the problem.

The simple solution is to comment out the line, a better solution is to determin if playerShape is the proper name for the class or if it should be something else.
#2
02/23/2006 (1:33 am)
Thank's, Martin. That was correct.