Remember Picking up Logos in TGE 1.5 tutorial?
by John Detmer · in Torque 3D Professional · 03/20/2010 (10:02 pm) · 2 replies
I have a question or two about porting to T3D the concept behind the old "Torque 1.5 Introductory Tutorial" on collecting torque logos and bumping a screen counter. I put the folder 3dtorquelogos under art/shapes, put the datablock script listed below under art/datablocks and can add the scripted logos to the sim group like before. However, since the clientCmdSetScoreCounter() isn't supported, the SCORE hud I added doesn't work nor does the "ShowVictory" (commented out). Modifying this simple script, the students under TGE 1.5 could add multiple counters for multiple objects like coins, blocks with points, etc. instead of logos. My question is how hard would it be to modify the logo datablock listed below so that they could be picked up and a point to be added to the F2 HUD under score? This would eliminate the extra counter and everone could see each other's scores. My emphasic is on educational games and do not require the kills and deaths points. Obviously, being able to collect objects for points has all kinds of potential. I tried messing with converting the health items code, but it never worked. Sure wish Gideon could pick up logos as he runs around in the desert ;) Appreciate any help. - Prof john
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
datablock StaticShapeData(TorqueLogoItem)
{
category = "Items";
shapeFile = "art/shapes/3dtorquelogo/torque_logo.dts";
};
function TorqueLogoItem::onCollision(%this, %obj, %col)
{
if(%col.getClassName() $= "Player")
{
%client = %col.client;
%client.score++;
// not supported -> commandToClient(%client, 'SetScoreCounter0', %client.score);
%obj.delete();
%logoCount = logos.getCount();
if(%logoCount > 0)
return;
// otherwise display victory screen
// not supported -> commandToClient(%client, 'ShowVictory', %client.score);
}
}
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
datablock StaticShapeData(TorqueLogoItem)
{
category = "Items";
shapeFile = "art/shapes/3dtorquelogo/torque_logo.dts";
};
function TorqueLogoItem::onCollision(%this, %obj, %col)
{
if(%col.getClassName() $= "Player")
{
%client = %col.client;
%client.score++;
// not supported -> commandToClient(%client, 'SetScoreCounter0', %client.score);
%obj.delete();
%logoCount = logos.getCount();
if(%logoCount > 0)
return;
// otherwise display victory screen
// not supported -> commandToClient(%client, 'ShowVictory', %client.score);
}
}
About the author
#2
Was wondering who came up with the slime gun weapon, but from your pic I think I know. - john
03/21/2010 (8:30 pm)
Thanks Scott. I did a crude score increase with "game.incScore(%client,1);" and that seemed to work. I still don't have a good feel for the scripted inventory system that would lead to the most robust solution. Not to push my luck, but would someone do a code snippet to set the logo up as an item? Scott, your tip about locating Warriorcamp assets saved the day! My next posting will be why the wave and salute animations are no longer bound to the keyboard. I can't believe Gideon can't do those animations like the comments say?Was wondering who came up with the slime gun weapon, but from your pic I think I know. - john
Associate Scott Burns
GG Alumni