Game Development Community

Changing (Dynamic) lightColor on ItemData?

by Jamie Stanley · in Torque Game Engine · 09/27/2006 (2:36 pm) · 0 replies

Hi all,

Bit of a newbie-noob question, and really stuck :(

I've got this datablock (taken from GPGT Ace book :) its the simple coin one:

datablock ItemData( Coin )
{
shapeFile = "~/data/Shapes/items/coin.dts";
category = "Coins";
sticky = true;
mass = 1.0;
respawn = true;
rotate = true;
lightColor = "1 0 1.0 1.0";
lightRadius = 3.0;
lightType = "PulsingLight";
};

and done the function

function Coin::SetColour(%thisDB, %obj, %inColour)
{
echo("Setting colour for: " @ %obj.GetName() @ " to " @ %inColour);
%obj.lightColor = %inColour;
}

When I do: Coin.SetColour(1486, " 0 0 1.0"); I get the echo "setting ... thecoin to ... etc" but nothing appears to have changed with the coin (sob sob)

Know Im doing something wrong! Just not sure what.

Basically I wish to set this color of the object for everyone connected playing against me in the game.

Cheers - Jamie