Jump to content
Scalings // Mr. Whale

[TUTORIAL] Customization of Lights! (COP & EMS)

Recommended Posts

Hi, This is my first actual Tutorial let me know if I worded it correctly!
 

In this tutorial, I will show you how to get different colour lights etc on your Cop/EMS Vehicles!

The file we'll be editing can be found here:

Cop: Altis_Life.Altis\core\cop

EMS: Altis_Life.Altis\core\medical

Then you should see the file "fn_copLights.sqf" or "fn_medicLights.sqf" . Open them.

To change the colour of the left light go to line 18 and change the "_lightRed"

_lightleft setLightColor _lightRed;

To change the colour of the red light go to line 63 and change the "_lightBlue"

_lightright setLightColor _lightBlue;

Doing the above will allow you to change your lights.

You can change them to the following colours:

  • _light [Pink] (I think)
  • _lightBlue [Blue]
  • _lightGreen [Green]
  • _lightWhite [White]
  • _lightYellow [Yellow]

 

In addition to this, it is possible to change the brightness, how far you can see the lights from etc in the same file.

For instance, if you want to change how bright your left light is, increase '0.2' to a higher number like '0.5'.

_lightleft setLightBrightness 0.2;

Have fun changing your lights & I hope this helped!

 

Let me know if you need further assistance!

- Scalings

Edited by Scalings // Mr. Whale

Share this post


Link to post
Share on other sites

How would I add extra vehicles say that don't currently have lights on them for the ems , police 

would i just add it to this ?

{
    case "C_Offroad_01_F":
    {
        _lightleft lightAttachObject [_vehicle, [-0.37, 0.0, 0.56]];
    };

    case "B_MRAP_01_F":
    {
        _lightleft lightAttachObject [_vehicle, [-0.37, -1.9, 0.7]];
    };

    case "C_SUV_01_F":
    {
        _lightleft lightAttachObject [_vehicle, [-0.37,-1.2,0.42]];
    };

    case "C_Hatchback_01_F":
    {
        _lightleft lightAttachObject [_vehicle, [-0.35,-0.2,0.25]];
    };
    
    case "C_Hatchback_01_sport_F":
    {
        _lightleft lightAttachObject [_vehicle, [-0.35,-0.2,0.25]];
    };

    case "B_Heli_Light_01_F":
    {
        _lightleft lightAttachObject [_vehicle,[-0.37, 0.0, -0.80]];
    };

    case "B_Heli_Transport_01_F":
    {
        _lightleft lightAttachObject [_vehicle, [-0.5, 0.0, 0.81]];
     };
};

 

Share this post


Link to post
Share on other sites

Yes add the class name to your case statement to add an additional vehicle. You'll need to figure out the positions but it won't take too long.

Also worth noting, you can't just change the variable from _lightBlue to _lightPink without first creating another variable above it called _lightPink and assigning it an RGB color.

Share this post


Link to post
Share on other sites
5 hours ago, iamepic161 said:

How would I add extra vehicles say that don't currently have lights on them for the ems , police 

would i just add it to this ?

{
    case "C_Offroad_01_F":
    {
        _lightleft lightAttachObject [_vehicle, [-0.37, 0.0, 0.56]];
    };

    case "B_MRAP_01_F":
    {
        _lightleft lightAttachObject [_vehicle, [-0.37, -1.9, 0.7]];
    };

    case "C_SUV_01_F":
    {
        _lightleft lightAttachObject [_vehicle, [-0.37,-1.2,0.42]];
    };

    case "C_Hatchback_01_F":
    {
        _lightleft lightAttachObject [_vehicle, [-0.35,-0.2,0.25]];
    };
    
    case "C_Hatchback_01_sport_F":
    {
        _lightleft lightAttachObject [_vehicle, [-0.35,-0.2,0.25]];
    };

    case "B_Heli_Light_01_F":
    {
        _lightleft lightAttachObject [_vehicle,[-0.37, 0.0, -0.80]];
    };

    case "B_Heli_Transport_01_F":
    {
        _lightleft lightAttachObject [_vehicle, [-0.5, 0.0, 0.81]];
     };
};

 

4

Hi,

switch (typeOf _vehicle) do
{
    case "C_Offroad_01_F":
    {
        _lightleft lightAttachObject [_vehicle, [-0.37, 0.0, 0.56]];
    };

You change your case, in this instance, "C_Offroad_01_F", it's your vehicle's class name. The lights position will vary but can be edited by changing the values. In this case, you would be changing [-0.37, 0.0, 0.56].

Edited by Scalings // Mr. Whale

Share this post


Link to post
Share on other sites
5 hours ago, Scalings // Mr. Whale said:

Hi,

switch (typeOf _vehicle) do
{
    case "C_Offroad_01_F":
    {
        _lightleft lightAttachObject [_vehicle, [-0.37, 0.0, 0.56]];
    };

You change your case, in this instance, "C_Offroad_01_F", it's your vehicle's class name. The lights position will vary but can be edited by changing the values. In this case, you would be changing [-0.37, 0.0, 0.56].

You could use this to help you get that relative offset

http://www.armaholic.com/page.php?id=31072

Share this post


Link to post
Share on other sites
2 hours ago, BitDr0p_ said:

How can I add 2 Lights at one side - I want to let the new DLC Van have a light on every siren

Find where _lightleft is defined and make your own for _lightright? And use that offset tool to guide you......?????? Cmon man think about this lol. It's called lightLEFT

Share this post


Link to post
Share on other sites
36 minutes ago, Deadlesszombie said:

Find where _lightleft is defined and make your own for _lightright? And use that offset tool to guide you......?????? Cmon man think about this lol. It's called lightLEFT

You think i´m Stubid?

If you could read right,, i want du have light in the front siren and the back siren.... 

Just think

  • Sad 1

Share this post


Link to post
Share on other sites

the standard script is only able to handle ONE on the left and right side... if you want to have two you need to re-do the whole script

 

if (vehicle is vehicle where you want to have 2 lights on every side) then {blablabla...};

then you can add 2 lightpoints on every side...

Share this post


Link to post
Share on other sites
49 minutes ago, Gagi2 said:

the standard script is only able to handle ONE on the left and right side... if you want to have two you need to re-do the whole script

 

if (vehicle is vehicle where you want to have 2 lights on every side) then {blablabla...};

then you can add 2 lightpoints on every side...

He could foreach{_light}blah blah for the light effects in the file and just simply declare the _light

Share this post


Link to post
Share on other sites

hello i am trying to move  the cop lights to new positions in front and the back  of the SUV but i dont know the positions on the Lamps market on the pictures can someone tell me please???

20180905152250_1.jpg

20180905151456_1.jpg

Share this post


Link to post
Share on other sites

 

49 minutes ago, ToxicFFS said:

hello i am trying to move  the cop lights to new positions in front and the back  of the SUV but i dont know the positions on the Lamps market on the pictures can someone tell me please???

Just use trial and error or a mod/mission that helps, such as the one recommended by @Deadlesszombie:

On 9/23/2017 at 8:42 AM, Deadlesszombie said:

You could use this to help you get that relative offset

http://www.armaholic.com/page.php?id=31072

 

Share this post


Link to post
Share on other sites

now i cant get the light on the back of the SUV to work  here is my fn_copLight.sqf file        what is wrong???

 

/*
    File: fn_copLights.sqf
    Author: mindstorm, modified by Adanteh
    Link: http://forums.bistudio.com/showthread.php?157474-Offroad-Police-sirens-lights-and-underglow

    Description:
    Adds the light effect to cop vehicles, specifically the offroad.
*/
Private ["_vehicle","_lightBlue","_lightBlue","_lightleft","_lightright","_lightleft1","_lightright1","_leftBlue"];
_vehicle = _this select 0;

if (isNil "_vehicle" || isNull _vehicle || !(_vehicle getVariable "lights")) exitWith {};
_lightBlue = [20, 0.1, 0.1];
_lightBlue = [0.1, 0.1, 20];

_lightleft = "#lightpoint" createVehicle getPos _vehicle;
sleep 0.2;
_lightleft setLightColor _lightBlue;
_lightleft setLightBrightness 5.0;
_lightleft setLightAmbient [0.1,0.1,1];

_lightleft1 = "#lightpoint" createVehicle getPos _vehicle;
sleep 0.2;
_lightleft1 setLightColor _lightBlue;
_lightleft1 setLightBrightness 5.0;
_lightleft1 setLightAmbient [0.1,0.1,1];

switch (typeOf _vehicle) do
{
    case "C_Offroad_01_F":
    {
        _lightleft lightAttachObject [_vehicle, [-0.37, 0.0, 0.56]];
    };

    case "B_MRAP_01_F":
    {
        _lightleft lightAttachObject [_vehicle, [-0.37, -1.9, 0.7]];
    };

    case "C_SUV_01_F":
    {
        _lightleft lightAttachObject [_vehicle, [-0.4,2.299,-0.473]];
        _lightleft1 lightAttachObject [_vehicle, [0.5,-2.901,-0.173]];
    };

    case "C_Hatchback_01_sport_F":
    {
        _lightleft lightAttachObject [_vehicle, [-0.35,-0.2,0.25]];
    };

    case "B_Heli_Light_01_F":
    {
        _lightleft lightAttachObject [_vehicle,[-0.37, 0.0, -0.80]];
    };

    case "B_Heli_Transport_01_F":
    {
        _lightleft lightAttachObject [_vehicle, [-0.5, 0.0, 0.81]];
     };
};

_lightleft setLightAttenuation [0.181, 0, 1000, 130];
_lightleft setLightIntensity 10;
_lightleft setLightFlareSize 0.38;
_lightleft setLightFlareMaxDistance 150;
_lightleft setLightUseFlare true;

_lightleft1 setLightAttenuation [0.181, 0, 1000, 130];
_lightleft1 setLightIntensity 10;
_lightleft1 setLightFlareSize 0.38;
_lightleft1 setLightFlareMaxDistance 150;
_lightleft1 setLightUseFlare true;

_lightright = "#lightpoint" createVehicle getPos _vehicle;
sleep 0.2;
_lightright setLightColor _lightBlue;
_lightright setLightBrightness 5.0;
_lightright setLightAmbient [0.1,0.1,1];

_lightright1 = "#lightpoint" createVehicle getPos _vehicle;
sleep 0.2;
_lightright1 setLightColor _lightBlue;
_lightright1 setLightBrightness 5.0;
_lightright1 setLightAmbient [0.1,0.1,1];

switch (typeOf _vehicle) do
{
    case "C_Offroad_01_F":
    {
        _lightright lightAttachObject [_vehicle, [0.37, 0.0, 0.56]];
    };

    case "B_MRAP_01_F":
    {
        _lightright lightAttachObject [_vehicle, [0.37, -1.9, 0.7]];
    };

    case "C_SUV_01_F":
    {
        _lightright lightAttachObject [_vehicle, [0.4,2.299,-0.473]];
        _lightright1 lightAttachObject [_vehicle, [-0.5,-2.901,-0.173]];
    };

    case "C_Hatchback_01_sport_F":
    {
        _lightright lightAttachObject [_vehicle, [0.35,-0.2,0.25]];
    };

    case "B_Heli_Light_01_F":
    {
        _lightright lightAttachObject [_vehicle,[0.37, 0.0, -0.80]];
    };

    case "B_Heli_Transport_01_F":
    {
        _lightright lightAttachObject [_vehicle, [0.5, 0.0, 0.81]];
     };
};

_lightright setLightAttenuation [0.181, 0, 1000, 130];
_lightright setLightIntensity 10;
_lightright setLightFlareSize 0.38;
_lightright setLightFlareMaxDistance 150;
_lightright setLightUseFlare true;

_lightright1 setLightAttenuation [0.181, 0, 1000, 130];
_lightright1 setLightIntensity 10;
_lightright1 setLightFlareSize 0.38;
_lightright1 setLightFlareMaxDistance 150;
_lightright1 setLightUseFlare true;

//ARE YOU ALL HAPPY?!?!?!?!?!?!?!?!?%#[email protected]?TGD?BN?ZDHBFD?GA
_lightleft setLightDayLight true;
_lightleft1 setLightDayLight true;
_lightright setLightDayLight true;
_lightright1 setLightDayLight true;

_leftRed = true;
while{ (alive _vehicle)} do
{
    if (!(_vehicle getVariable "lights")) exitWith {};
    if (_leftRed) then
    {
        _leftRed = false;
        _lightright setLightBrightness 0.0;
        sleep 0.05;
        _lightleft setLightBrightness 6;
    }
        else
    {
        _leftRed = true;
        _lightleft setLightBrightness 0.0;
        sleep 0.05;
        _lightright setLightBrightness 6;
    };
    sleep (_this select 1);
};
deleteVehicle _lightleft;
deleteVehicle _lightright;

Share this post


Link to post
Share on other sites
2 minutes ago, ToxicFFS said:

now i cant get the light on the back of the SUV to work  here is my fn_copLight.sqf file        what is wrong???

 

/*
    File: fn_copLights.sqf
    Author: mindstorm, modified by Adanteh
    Link: http://forums.bistudio.com/showthread.php?157474-Offroad-Police-sirens-lights-and-underglow

    Description:
    Adds the light effect to cop vehicles, specifically the offroad.
*/
Private ["_vehicle","_lightBlue","_lightBlue","_lightleft","_lightright","_lightleft1","_lightright1","_leftBlue"];
_vehicle = _this select 0;

if (isNil "_vehicle" || isNull _vehicle || !(_vehicle getVariable "lights")) exitWith {};
_lightBlue = [20, 0.1, 0.1];
_lightBlue = [0.1, 0.1, 20];

_lightleft = "#lightpoint" createVehicle getPos _vehicle;
sleep 0.2;
_lightleft setLightColor _lightBlue;
_lightleft setLightBrightness 5.0;
_lightleft setLightAmbient [0.1,0.1,1];

_lightleft1 = "#lightpoint" createVehicle getPos _vehicle;
sleep 0.2;
_lightleft1 setLightColor _lightBlue;
_lightleft1 setLightBrightness 5.0;
_lightleft1 setLightAmbient [0.1,0.1,1];

switch (typeOf _vehicle) do
{
    case "C_Offroad_01_F":
    {
        _lightleft lightAttachObject [_vehicle, [-0.37, 0.0, 0.56]];
    };

    case "B_MRAP_01_F":
    {
        _lightleft lightAttachObject [_vehicle, [-0.37, -1.9, 0.7]];
    };

    case "C_SUV_01_F":
    {
        _lightleft lightAttachObject [_vehicle, [-0.4,2.299,-0.473]];
        _lightleft1 lightAttachObject [_vehicle, [0.5,-2.901,-0.173]];
    };

    case "C_Hatchback_01_sport_F":
    {
        _lightleft lightAttachObject [_vehicle, [-0.35,-0.2,0.25]];
    };

    case "B_Heli_Light_01_F":
    {
        _lightleft lightAttachObject [_vehicle,[-0.37, 0.0, -0.80]];
    };

    case "B_Heli_Transport_01_F":
    {
        _lightleft lightAttachObject [_vehicle, [-0.5, 0.0, 0.81]];
     };
};

_lightleft setLightAttenuation [0.181, 0, 1000, 130];
_lightleft setLightIntensity 10;
_lightleft setLightFlareSize 0.38;
_lightleft setLightFlareMaxDistance 150;
_lightleft setLightUseFlare true;

_lightleft1 setLightAttenuation [0.181, 0, 1000, 130];
_lightleft1 setLightIntensity 10;
_lightleft1 setLightFlareSize 0.38;
_lightleft1 setLightFlareMaxDistance 150;
_lightleft1 setLightUseFlare true;

_lightright = "#lightpoint" createVehicle getPos _vehicle;
sleep 0.2;
_lightright setLightColor _lightBlue;
_lightright setLightBrightness 5.0;
_lightright setLightAmbient [0.1,0.1,1];

_lightright1 = "#lightpoint" createVehicle getPos _vehicle;
sleep 0.2;
_lightright1 setLightColor _lightBlue;
_lightright1 setLightBrightness 5.0;
_lightright1 setLightAmbient [0.1,0.1,1];

switch (typeOf _vehicle) do
{
    case "C_Offroad_01_F":
    {
        _lightright lightAttachObject [_vehicle, [0.37, 0.0, 0.56]];
    };

    case "B_MRAP_01_F":
    {
        _lightright lightAttachObject [_vehicle, [0.37, -1.9, 0.7]];
    };

    case "C_SUV_01_F":
    {
        _lightright lightAttachObject [_vehicle, [0.4,2.299,-0.473]];
        _lightright1 lightAttachObject [_vehicle, [-0.5,-2.901,-0.173]];
    };

    case "C_Hatchback_01_sport_F":
    {
        _lightright lightAttachObject [_vehicle, [0.35,-0.2,0.25]];
    };

    case "B_Heli_Light_01_F":
    {
        _lightright lightAttachObject [_vehicle,[0.37, 0.0, -0.80]];
    };

    case "B_Heli_Transport_01_F":
    {
        _lightright lightAttachObject [_vehicle, [0.5, 0.0, 0.81]];
     };
};

_lightright setLightAttenuation [0.181, 0, 1000, 130];
_lightright setLightIntensity 10;
_lightright setLightFlareSize 0.38;
_lightright setLightFlareMaxDistance 150;
_lightright setLightUseFlare true;

_lightright1 setLightAttenuation [0.181, 0, 1000, 130];
_lightright1 setLightIntensity 10;
_lightright1 setLightFlareSize 0.38;
_lightright1 setLightFlareMaxDistance 150;
_lightright1 setLightUseFlare true;

//ARE YOU ALL HAPPY?!?!?!?!?!?!?!?!?%#[email protected]?TGD?BN?ZDHBFD?GA
_lightleft setLightDayLight true;
_lightleft1 setLightDayLight true;
_lightright setLightDayLight true;
_lightright1 setLightDayLight true;

_leftRed = true;
while{ (alive _vehicle)} do
{
    if (!(_vehicle getVariable "lights")) exitWith {};
    if (_leftRed) then
    {
        _leftRed = false;
        _lightright setLightBrightness 0.0;
        sleep 0.05;
        _lightleft setLightBrightness 6;
    }
        else
    {
        _leftRed = true;
        _lightleft setLightBrightness 0.0;
        sleep 0.05;
        _lightright setLightBrightness 6;
    };
    sleep (_this select 1);
};
deleteVehicle _lightleft;
deleteVehicle _lightright;

lightleft1 isnt having a light set at the bottom of the script

Share this post


Link to post
Share on other sites
20 minutes ago, ToxicFFS said:

like this???

3bdb28a7cff2be7e4855e5708468123c.png

no, you are just adding pointless brackets, man, please read your code "if (_leftRed) then { x y z happens, else xyz happens, you are just adding pointless brackets, add the _lightright1 and _lightleft1 where you see _lightRed and _Lightleft, trial and error with that

Share this post


Link to post
Share on other sites
7 minutes ago, Deadlesszombie said:

no, you are just adding pointless brackets, man, please read your code "if (_leftRed) then { x y z happens, else xyz happens, you are just adding pointless brackets, add the _lightright1 and _lightleft1 where you see _lightRed and _Lightleft, trial and error with that

you mean Like this?  im trying my bests to understand

f55b6a4844b407d2cc28efc55af75415.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×