Home   Help Search Login Register  

Author Topic: How to change the color of a light  (Read 5434 times)

0 Members and 1 Guest are viewing this topic.

Offline McSpuds

  • Members
  • *
How to change the color of a light
« on: 10 Sep 2012, 17:03:16 »
I am working on a new airfield on my map.  The traditional way we have been doing the runway lighting is to use "conelights" and setting the elevation to a minus. 

Initialization:
Code: [Select]
this setPos [getPos this select 0, getPos this select 1, -0.500]
The conelight is a small red and white cone with a yellow lamp on top that is lighted at night.  Adding several of these in a row gave us a nice set of runway lights.

I am trying to change the color of the lamp from a yellow hue to a blue, red or green.

Any Ideas?

Offline Gnat

  • Addons Depot
  • Former Staff
  • ****
  • I Bite!
    • Gnats
Re: How to change the color of a light
« Reply #1 on: 12 Sep 2012, 05:47:20 »
Assuming you have identified the correct one to us ....
The ALLINONE Config from DevHeaven is a #1 source of config information.
Seacrhing "conelight" gave me this;

Code: [Select]
class Land_coneLight: Thing
{
scope = 2;
vehicleClass = "signs";
simulation = "thing";
animated = 0;
model = "\CA\Structures\Misc\Armory\coneLight\coneLight";
icon = "\ca\data\library\data\icons\road_cone_CA.paa";
mapSize = 0.1;
displayName = "Road cone (light)";
accuracy = 0.2;
class DestructionEffects
{
};
class MarkerLights
{
class YellowBlinking
{
name = "zluty pozicni blik";
color[] = {0.99,0.69,0.17,1};
ambient[] = {0.099,0.069,0.017,1};
brightness = 0.01;
blinking = 1;
};
};
};

So all you need to do is make a new object thats a copy, but with different light;
Code: [Select]
class CfgPatches
{
class SPU_Lights
        {
units[] = {};
weapons[] = {};
requiredVersion = 1.0;
};
};
class CfgVehicles
{
class Land_coneLight;
class Land_SPUconeLight2: Land_coneLight // inherit all other parameters, except those stated below
{
displayName = "Road cone (Blue)";
class MarkerLights
{
class BlueBlinking
{
name = "zluty pozicni blik";
color[] = {0.11,0.11,0.99,1};
ambient[] = {0.099,0.069,0.017,1};
brightness = 0.01;
blinking = 1;
};
};
};
};
Untested. Fiddle with color[] etc
Place that text in a config.cpp. Place that file in a folder called something like SPU_Lights, then run BinPBO on the folder to make you own PBO addon.

To do this without a addon? Sorry, dont know how. Ask in Mission Editing and Scripting instead if thats what you wanted.