Game Development Community

Shapebase::pickup

by Grant McNeil · in Torque Game Engine · 10/25/2005 (8:57 pm) · 1 replies

I have the following script:

-------------------------------------------------
datablock ItemData(WhateverData)
{
shapeFile = "~/data/shapes/Whatever/Whatever.dts";
};

function ItemData::create(%data)
{
%obj = new Item()
{
dataBlock = %data;
static = true;
rotate = true;
};
return %obj;
}

function ShapeBase::pickup(%this,%obj,%amount)
{
echo("Picked Up?");
}
---------------------------------------------------------------------------

I added an echo statement to the ShapeBase::pickup for the starter.fps, and it echo'd when I collided with it, and continued colliding.

I'm assuming ShapeBase::pickup is called when a client collides with a ShapeBase object, but I could be wrong.

Assuming i'm not wrong, when you hit an instance of my "Whatever" datablock, it should echo "Picked Up?"..

but it doesn't.

what am I doing wrong?

#1
10/26/2005 (6:43 am)
Look in server/inventory.cs, server/item.cs, and check out the oncollision method for the player object in server/player.cs to fully understand the inventory system.