Author Topic: Light Script Error.  (Read 860 times)

Ok, so im making my custom light set, And i went to test the first color, and the color didnt show up in my Lights list, This is the script:

//Beachbums Lights
datablock fxLightData(RedLight)
{
   uiName = "Red Light";

   LightOn = true;
   radius = 10;
   brightness = 9;
   color = "1 0 0 1";

   flareOn = true;
   flarebitmap = "base/lighting/corona";
   NearSize   = 2;
   FarSize = 1;
};

datablock fxLightData(TealLight: RedLight)
{
   uiName = "Teal Light";

   LightOn = true;
   radius = 10
   brightness = 9;
   color = "0 9 9 1"
   
   flareOn = true;
   flarebitmap = "base/lighting/corona";
   Nearsize   = 2;
   Farsize = 1;
};

Dont really know what the error is... Please help me.
« Last Edit: March 02, 2008, 07:25:30 PM by Beachbum790 »

First of all, you're missing some semi-colons. Remember to have a ; at the end of each line.

Second of all, the colors should each range from 0.0 to 1.0

You probably know that each of the four numbers "R G B A" represents Red, Green, Blue, and Alpha (transparency).

So pure red would be:
"1 0 0 1"
(Like you have)

But instead of having "0 9 9 1", you should have something more like "0 0.9 0.9 1" or "0 0.9 0.9 0.1" depending on what you were trying to do.
« Last Edit: March 02, 2008, 07:50:21 PM by exidyne »

Exidyne, Thank you soo much, Now my light script works, It should be up withen a few hours, But I have a question, When I get the RGBA If say my numbers would be
1 255 255 1
Should i change it to
1 0.255 0.255 1
Or what?

No, torque works with both the hexinomial (0-255 or 00-ff) color range and the 0-1 color range.