Game Development Community

Glowstick issue

by fossilnite · in Torque Developer Network · 01/09/2012 (12:41 am) · 4 replies

Hi all. Thanks for taking your time reading this. Straight to the point im a complete noob at tge. I want to create a glowstick that the player is able to hold.... But im not sure what kind of datablock to use to create the glowstick itself. sgLightObjectData? ShapeBaseImageData? Can any kind soul point me to the right direction or show me a small sample that i can refer to.... : )

Edit: What i tried...
datablock sgLightObjectData( glowStick )
{
shapeFile = "~/data/shapes/glowStick/glowstick.dts";

sgCastsShadows=true;

}

And this

datablock ShapeBaseImageData( glowStick )
{
shapeFile = "~/data/shapes/glowStick/glowstick.dts";


lightType = "ConstantLight";//Let there be light - NoLight, ConstantLight, PulsingLight, WeaponFireLight,spotlight.
lightColor = "0.5 0.5 0.5";
lightDuration = 200;
lightRadius = 10;
}

But to no avail...... help me and you'll save the world.......... : )

#1
01/09/2012 (7:22 am)
What are you using TGE?

Try a staticShape - you can mount them on the player as an object (eg in the hand).
#2
01/09/2012 (9:53 am)
If you're using Torque 3D then the sgLightObject doesn't exist.

If you're using TGE the property names that you're trying to use for the light on the shape image is slightly different -- those are Torque 3D properties.

Torque3D example:
// Let there be light - NoLight, ConstantLight, PulsingLight, WeaponFireLight.
lightType = "WeaponFireLight";
lightColor = "1.0 1.0 0.9";
lightDuration = 200;
lightRadius = 10;

TGE example:
lightType = "WeaponFireLight"; // NoLight, ConstantLight, PulsingLight, WeaponFireLight.
lightColor = "0.8 0.8 0.8 1.0";
lightTime = 1000; // Indicates the time when the light effect started.
lightRadius = 2; // Extent of light.

lightDuration and lightTime being the main difference between the two. There may be a few others as well, it's been a while... and if I remember correctly the actual values used for colors and times ended up being different between the two engines.
#3
01/09/2012 (10:20 pm)
Thanks for your time.

yea im using TGE... But i need to create an object that can be mounted on the hand and glows at the same time.... and will it be possible if i spawned this object and placed it onto the ground?
#4
01/09/2012 (10:22 pm)
If possible can you write for me a sample code that will create an object that emits light and is mountable? will really reaaaaallly appreciate it >.<