Game Development Community

Collecting Logos in Tutorial

by Kris Keeler · in General Discussion · 01/11/2008 (12:32 am) · 3 replies

Hi All,
I did a search but couldnt find anything about the issue Im having. Im doing the tutorial that comes with TGE - the one where you place logos on the ground and youre supposed to collide with them and pick them up. I have gone over the tutorial about 10 times and still cant get it to work. Here is the code I place in server/logoitem.cs

function TorqueLogoItem::onCollision(%this, %obj, %col)
{
if(%col.getClassName() $= "Player")
{
%client = %col.client;
%client.score++;
commandToClient(%client, 'SetScoreCounter', %client.score);
%obj.delete();
%logoCount = logos.getCount();
if(%logoCount > 0)
return;
// otherwise display victory screen
commandToClient(%client, 'ShowVictory', %client.score);
}
}

I created the logos group and added all the code to all the places it instructs me to and I still cant get the logos to delete when I run into them. Any advise?

Thanks

About the author

Recent Threads


#1
01/11/2008 (1:19 am)
What does the datablock of your item look like?

Here's mine:

datablock ItemData(logo)
{
catagory = "Coins";
//basic properties
shapeFile = "~/data/shapes/items/torqueLogo.dts";
mass = 0.7;
friction = 0.8;
elasticity = 0.3;
respawnTime = 530 * 60000;
salvageTime = 15 * 60000;
//dynamic properties
pickupName = "Logo Item";
value = 1;
};

It should work.
#2
01/11/2008 (1:23 am)
Did you remember to call it in the game.cs ? when you create a new script?
#3
01/12/2008 (2:46 am)
Hi Mike.. heres what my datablock currently looks like:

datablock StaticShapeData(TorqueLogoItem)
{
category = "Items";
shapeFile = "~/data/shapes/3dtorquelogo/torque_logo.dts";
};

Ill try your suggestions, thanks.

Edward, the tutorial doesnt say anything about making a call in game.cs however it does say to call exec("./client/clientGame.cs"); in main.cs

Do you guys know if there is a way to enable the numeric keypad in the editor? Thanks