Jump to content
Sign in to follow this  
chaseh27

Setting Color of Offroad?

Recommended Posts

_truck setObjectTexture [0, "\A3\soft_F\Offroad_01\Data\Offroad_01_ext_BASE04_CO.paa"];

nice , thanks again :thumbsup:

Share this post


Link to post
Share on other sites

[deleted]

found out my problem:

if you are seeing weird glitchy colors on the light bar, make sure you don't have both the "HideServices" and "HidePolice" set to 0, because the yellow service lightbar will show through the police one.

Cheers!

Share this post


Link to post
Share on other sites
Here's how to do the Police Offroad:

Init of the Offroad:

_police = this execVM "policeOffroad.sqf";

policeOffroad.sqf:

/*
File: policeOffroad.sqf
Author: Adapted from code by pettka

Description:
Sets proxies for the car to police, adds actions for sirens.

Parameter(s):
None

Returns:
Nothing
*/

if (isServer) then {
_this animate ["HidePolice", 0];
_this animate ["HideServices", 1];
_this animate ["HideBackpacks", 1];
_this animate ["HideBumper1", 1];
_this animate ["HideBumper2", 0];
_this animate ["HideConstruction", 0];
};

_this setObjectTexture [0, "\A3\soft_F\Offroad_01\Data\Offroad_01_ext_BASE02_CO.paa"];

_this setObjectTexture [1, "\A3\soft_F\Offroad_01\Data\Offroad_01_ext_BASE02_CO.paa"];

_this addAction ["Beacons On",{(_this select 0) animate ["BeaconsStart",1]},[],50,false,true,"","_target animationPhase 'BeaconsStart' < 0.5 AND Alive(_target) AND driver _target == _this"];
_this addAction ["Beacons Off",{(_this select 0) animate ["BeaconsStart",0]},[],51,false,true,"","_target animationPhase 'BeaconsStart' > 0.5 AND Alive(_target) AND driver _target == _this"];

Found this to be the best way. Works all the time. Thanks!

Share this post


Link to post
Share on other sites
OMG, thats ugly.

I made a few changes, thats make it more real-looklike

Blue Coplights BlingBling:

fnCJ_PoliceBlink = {
Private ["_vehicle","_lightRed","_lightBlue","_lightleft","_lightright","_leftRed"];
// _this select 0 : objVehicle
// _this select 1 : blingspeed
//[_carobj,0.25] spawn fnCJ_PoliceBlink;

   _vehicle = _this select 0;  
   _lightRed = [0.1, 0.1, 20]; 		//color left
   _lightBlue = [0.1, 0.1, 20]; 		//color right

   _lightleft = "#lightpoint" createVehicle getpos _vehicle;   
   sleep 0.2;
   _lightleft setLightColor _lightRed; 
   _lightleft setLightBrightness 0.2;  
   _lightleft setLightAmbient [0.1,0.1,1]; 
   _lightleft lightAttachObject [_vehicle, [-0.37, 0.0, 0.54]];  //exact position of leftlight
   //helperSphere1 attachTo [_vehicle, [-0.37, 0.0, 0.54]];	 //positiontest with 10cm helpersphere
   _lightleft setLightAttenuation [0.181, 0, 1000, 130]; 
   _lightleft setLightIntensity 10;
   _lightleft setLightFlareSize 0.38;
   _lightleft setLightFlareMaxDistance 150;
   _lightleft setLightUseFlare true;

   _lightright = "#lightpoint" createVehicle getpos _vehicle;   
   sleep 0.2;
   _lightright setLightColor _lightBlue; 
   _lightright setLightBrightness 0.2;  
   _lightright setLightAmbient [0.1,0.1,1]; 
   _lightright lightAttachObject [_vehicle, [0.37, 0.0, 0.54]];  //exact position of rightlight
   //helperSphere1_1 attachTo [_vehicle, [0.37, 0.0, 0.54]]; //positiontest with 10cm helpersphere
   _lightright setLightAttenuation [0.181, 0, 1000, 130]; 
   _lightright setLightIntensity 10;
   _lightright setLightFlareSize 0.38;
   _lightright setLightFlareMaxDistance 150;
   _lightright setLightUseFlare true;

   _leftRed = true;  
   while{ (alive _vehicle)} do  
   {  
     if(_leftRed) then  
    {  
       _leftRed = false;  
_lightright setLightBrightness 0.0;  
sleep 0.05;
_lightleft setLightBrightness 2;  
    }  
    else  
    {  
       _leftRed = true;  
_lightleft setLightBrightness 0.0;  
sleep 0.05;
_lightright setLightBrightness 2;  
    };  
     sleep (_this select 1);  
   };  
   deleteVehicle _lightleft;
   deleteVehicle _lightright;
};

best viewed @ Night

Picture: //steamcommunity.com/sharedfiles/filedetails/?id=166301461

http://cloud-3.steampowered.com/ugc/902129724264540042/D17B5159899E4D2D4B74A56CE1EC2A269668A6A8/1024x544.resizedimage

happy fun,

C.Joke

Hi, how do i use this code? I have tried making it into a sqf file and executing it, but i cant figure out how to get it to work. I managed to get Mindstorm's script (above the quoted post) to work just fine, but i just cant figure out yours. Could you help me with this? Cheers

Share this post


Link to post
Share on other sites

Before you loose your mind why the custom textures are not working, add this line first to the vehicle:

_this setVariable ["BIS_enableRandomization",false];

With it you disable the randomization "feature" that overrides your custom settings.

Share this post


Link to post
Share on other sites

The codes given in this thread brought more enjoyment in my game, when I added them in my folder.

Share this post


Link to post
Share on other sites

I've set up the sirens and the lights. Does anyone know how to set up the sirens sound I'd appreciete if someone would have the script for it, and if someone would explain how to set up CJoke's script properly, would be apprecieted.

Share this post


Link to post
Share on other sites

How can i set the  lightAttachObject  coordinate's ?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×