Jump to content
Sign in to follow this  
progamer

Offroad Police sirens, lights and underglow?

Recommended Posts

How would I add police sirens, lights and optional underglow to a Offroad?

Share this post


Link to post
Share on other sites

Maybe there's a way to use attachto on the effect version of the glowstick, I'll play around with it and post the results if someone much smarter doesn't answer this for you :p

As for the sirens I'm thinking that may need additional content.

Yeah that's not working, unfortunately. I don't know how/if you can find the classname for something like an activated glowstick unfortunately. I'm sure someone could easily add such an item thogh.

Edited by MordeaniisChaos

Share this post


Link to post
Share on other sites

People have made completely working police offroads already, it is possible.

Share this post


Link to post
Share on other sites

in the init:

this animate ["HidePolice", 0];

Other possible ones:

this animate ["HideServices", 1]; 
this animate ["HideBackpacks", 1]; 
this animate ["HideBumper1", 1]; 
this animate ["HideBumper2", 1]; 
this animate ["HideConstruction", 1]; 
this animate ["HideDoor1", 1];  
this animate ["HideDoor2", 1]; 
this animate ["HideDoor3", 1]; 
this animate ["HideGlass2", 1];

And textures:

_textures = ["\A3\soft_F\Offroad\Data\offroad_ext_co.paa",  //red
"\A3\soft_F\Offroad\Data\Offroad_ext_BASE01_CO.paa", //yellow 
"\A3\soft_F\Offroad\Data\Offroad_ext_BASE02_CO.paa",  //white
"\A3\soft_F\Offroad\Data\Offroad_ext_BASE03_CO.paa",  //blue
"\A3\soft_F\Offroad\Data\Offroad_ext_BASE04_CO.paa",  //darkred
"\A3\soft_F\Offroad\Data\Offroad_ext_BASE05_CO.paa"]; //darkblue

this setObjectTexture [0, _textures select 0]; //Set color texture
this setObjectTexture [1, _textures select 0]; //Set texture of rims/iron bars and other stuff 

Share this post


Link to post
Share on other sites

You would have to attack custom light objects to the vehicle.

Something like this. You will need to change to lightAttachObject so the lights are correctly positioned. You will probably also need to test around with the ambient and colors to get the precise color you like.

Init:

_vehicle = this;
_lightleft = "#lightpoint" createVehicle getpos _vehicle; 
_lightleft setLightColor [255, 0, 0]; //red
_lightleft setLightBrightness 1;
_lightleft setLightAmbient [0,0,0.5];
_lightleft lightAttachObject [_vehicle, [0, 1, 1]];

_lightright = "#lightpoint" createVehicle getpos _vehicle; 
_lightright setLightColor [0, 0, 255]; //Blue
_lightright setLightBrightness 0.1;
_lightright setLightAmbient [0.5,0,0];
_lightright lightAttachObject [_vehicle, [0, 1, 1]];

_leftRed = true;
while{ (alive _vehicle)} do
{
 if(_leftRed) then
{
   _leftRed = false;
   _lightleft setLightColor [0, 0, 255];
   _lightright setLightColor [255, 0, 0];
}
else
{
   _leftRed = true;
   _lightleft setLightColor [255, 0, 0];
   _lightright setLightColor [0, 0, 255];
};
 sleep 1;
};

Share this post


Link to post
Share on other sites

Thanks a lot for the start from that. Lighting changed a bit though, so I used this to make it look pretty decent

_vehicle = _this select 0; 
_lightRed = [5, 0.5, 0.5];
_lightBlue = [0.5, 0.5, 5];

lightleft = "#lightpoint" createVehicle getpos _vehicle;  
lightleft setLightColor _lightRed;
lightleft setLightBrightness 0.4; 
lightleft setLightAmbient _lightRed;
lightleft lightAttachObject [_vehicle, [-3, 0.8, 0]]; 
lightleft setLightAttenuation [3, 0, 0, 0.6];

lightright = "#lightpoint" createVehicle getpos _vehicle;  
lightright setLightColor _lightBlue;
lightright setLightBrightness 0.4; 
lightright setLightAmbient _lightBlue;
lightright lightAttachObject [_vehicle, [3, 0.8, 0]]; 
lightright setLightAttenuation [3, 0, 0, 0.6];

// playSound "AlarmCar";	
_leftRed = true; 
while{ (alive _vehicle)} do 
{ 
  if(_leftRed) then 
 { 
	_leftRed = false; 
	lightleft setLightColor _lightRed;
	lightleft setLightAmbient _lightRed;
	lightright setLightColor _lightBlue;
	lightright setLightAmbient _lightBlue;
	playSound "AlarmCar";
 } 
 else 
 { 
	_leftRed = true; 
	lightleft setLightColor _lightBlue;
	lightleft setLightAmbient _lightBlue;
	lightright setLightColor _lightRed;
	lightright setLightAmbient _lightRed;
 }; 
  sleep 1; 
}; 

Does anyone know how you can turn the light into a cone instead?

Share this post


Link to post
Share on other sites

Digging up this topic, I was hoping someone could help me. I would like to place "strobe lights" if you will into the corner of the vehicle, 2 headlights 2 tail lights. Nothing too bright but something with a similar effect to the one in the script here. How would I go about doing this, could I use the lights name position for where to place it or would I need something else?

Thanks

Edit: As of right now I am working with the off road, and if you could an example to point me in the right direction would be awesome.

Edited by SandMan2012

Share this post


Link to post
Share on other sites

Stuck straight away. If i put the code in somewhere, I'm guessing in the init file, what do I call the offroad?

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

How can i set the  lightAttachObject  coordinate's ?

 

Either by reading the wiki or looking at the code in this very thread.  Have you tried either?

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  

×