Difference between revisions of "Arma 3: Lights"

From Bohemia Interactive Community
Jump to navigation Jump to search
(Collision Lights)
(Headlights)
Line 5: Line 5:
 
=== Headlights ===
 
=== Headlights ===
 
If a vehicle has headlights, they are usually available for the driver of the vehicle and if the driver is a human player, the headlights could be operated via keyboard binding (normally <tt>L</tt>) or scroll action menu. If the driver is AI, it will operate the headlights depending on some preset condition. For example it will turn the lights at night and turn them off in the day time. The exact time when AI may decide to use the lights can be obtained via the following formula ((!) current formula but [[Talk:Arma_3_Lights#Previous_lights_on_randomization_formula | could change]]):
 
If a vehicle has headlights, they are usually available for the driver of the vehicle and if the driver is a human player, the headlights could be operated via keyboard binding (normally <tt>L</tt>) or scroll action menu. If the driver is AI, it will operate the headlights depending on some preset condition. For example it will turn the lights at night and turn them off in the day time. The exact time when AI may decide to use the lights can be obtained via the following formula ((!) current formula but [[Talk:Arma_3_Lights#Previous_lights_on_randomization_formula | could change]]):
<code>[[private]] _isLightsOnTime = [0,0,0] [[getEnvSoundController]] "night" > 0.7;</code>
+
[[private]] _isLightsOnTime = [0,0,0] [[getEnvSoundController]] "night" > 0.7;
  
 
From scripts the headlights could be operated via either the script command [[setPilotLight]] or the [[action]]s <tt>"LightOn"</tt> and <tt>"LightOff"</tt>. If a human player is the driver/pilot, the commands will work unconditionally. However if AI is driving or piloting, then it might resist lights status change.
 
From scripts the headlights could be operated via either the script command [[setPilotLight]] or the [[action]]s <tt>"LightOn"</tt> and <tt>"LightOff"</tt>. If a human player is the driver/pilot, the commands will work unconditionally. However if AI is driving or piloting, then it might resist lights status change.

Revision as of 09:29, 28 February 2019

Template:wip

Vehicle Lights

Overview

Headlights

If a vehicle has headlights, they are usually available for the driver of the vehicle and if the driver is a human player, the headlights could be operated via keyboard binding (normally L) or scroll action menu. If the driver is AI, it will operate the headlights depending on some preset condition. For example it will turn the lights at night and turn them off in the day time. The exact time when AI may decide to use the lights can be obtained via the following formula ((!) current formula but could change):

private _isLightsOnTime = [0,0,0] getEnvSoundController "night" > 0.7;

From scripts the headlights could be operated via either the script command setPilotLight or the actions "LightOn" and "LightOff". If a human player is the driver/pilot, the commands will work unconditionally. However if AI is driving or piloting, then it might resist lights status change.

Overriding

Config Related

It is possible to set initial state of the headlights in a vehicle config, so that when vehicle is spawned it has headlights either on or off.

class CfgVehicles
{
	...
	class MyVehicle
	{
		...
		pilotLight = true; // true - spawn with headlights on, false - spawn with headlights off. Default: false; 
		...
	};
	...
};

Collision Lights

Collision lights on the Speedboat

Normally used in air and naval vehicles.

Overriding

Config Related

It is possible to set initial state of the collision lights in a vehicle config, so that when vehicle is spawned it has collision lights either on or off.

class CfgVehicles
{
	...
	class MyVehicle
	{
		...
		collisionLight = true; // true - spawn with collision lights on, false - spawn with collision lights off. Default: false; 
		...
	};
	...
};

Search Light

WY-55 Hellcat with the search light activated

At the moment, the WY-55 Hellcat helicopter is the only vehicle in vanilla Arma 3 game that has the search light implemented on the observer turret. This light could only be operated manually either by human player via the scroll action menu or via scripted actions "SearchLightOn" and "SearchLightOff", in which case it could also be switched on/off with AI on the observer turret. There is currently no way of telling if the search light is on or off via script.

_heli turretUnit [0] action ["SearchLightOn", _heli];
_heli turretUnit [0] action ["SearchLightOff", _heli];

The turret could be rotated and the search light elevated. To get the orientation of the search light beam:

private _searchLightRotation = deg (_heli animationSourcePhase "obsTurret");
private _searchLightElevation = deg (_heli animationSourcePhase "obsGun");

The search light is model's VolumeLight proxy that is revealed or hidden by the engine, following user action.

Other Light Sources

Examples

Unit Lights

Overview

Flashlight

Enabling/Disabling

IR Laser

Enabling/Disabling

Examples

Street Lights

Particle Light Sources