setLightColor: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Some wiki formatting)
 
(55 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma |= Game name
|game1= ofpe
|version1= 1.00


|1.00|= Game version
|game2= arma1
|version2= 1.00


|arg= local |=
|game3= arma2
|eff= local |= Effects in MP
|version3= 1.00
____________________________________________________________________________________________


| Set diffuse color of light. |= Description
|game4= arma2oa
____________________________________________________________________________________________
|version4= 1.50


| light '''setLightColor''' [r, g, b] |= Syntax
|game5= tkoh
|version5= 1.00


|p1= light: [[Object]] |= Parameter 1
|game6= arma3
|version6= 0.50


|p2= [r, g, b]: [[Array]] |= Parameter 2
|gr1= Lights


| [[Nothing]] |= Return value
|arg= local
____________________________________________________________________________________________


| [[setLightAmbient]], [[setLightBrightness]], [[lightAttachObject]], [[setLightIntensity]], [[setLightAttenuation]], [[setLightUseFlare]], [[setLightFlareSize]], [[setLightFlareMaxDistance]], [[setLightDayLight]] |= See also
|eff= local


|descr= Set diffuse color of light. Illuminates surfaces that are facing the light.
|s1= light [[setLightColor]] [r, g, b]
|p1= light: [[Object]]
|p2= r: [[Number]] - red value in range 0..1
|p3= g: [[Number]] - green value in range 0..1
|p4= b: [[Number]] - blue value in range 0..1
|r1= [[Nothing]]
|x1= <sqf>myLight setLightColor [0.5,0,0]; // produces red</sqf>
|seealso= [[setLightAmbient]] [[setLightBrightness]] [[lightAttachObject]] [[lightDetachObject]] [[setLightIntensity]] [[setLightAttenuation]] [[setLightUseFlare]] [[setLightFlareSize]] [[setLightFlareMaxDistance]] [[setLightDayLight]] [[setLightIR]]
}}
}}


<h3 style="display:none">Notes</h3>
{{Note
<dl class="command_description">
|user= Feersum
<!-- Note Section BEGIN -->
|timestamp= 20061201164200
<dt class="note">'''[[User:ColonelSandersLite|ColonelSandersLite]]'''<dd class="note"><br>
|text= Light can be created with command [[createVehicleLocal]] with special vehicle class {{hl|"#lightpoint"}}<br>
To clarify:<br>
for example:
setLightAmbient - Terrain and surrounding objects are bathed in this colour.<br>
<sqf>
setLightColor - Controls the "haze" seen around the lightsource (ex flares).<br>
_light = "#lightpoint" createVehicleLocal pos;
<dd class="notedate">Posted on Dec 1, 2006 - 16:42
_light setLightBrightness 1.0;
<dt class="note">'''[[User:Feersum|Feersum]]'''<dd class="note">
_light setLightAmbient [0.0, 1.0, 0.0];
Light can be created with command [[createVehicleLocal]] with special vehicle class "#lightpoint"
_light setLightColor [0.0, 1.0, 0.0];
_light lightAttachObject [_object, [0,0,0]];
</sqf>
}}


<br>for example:
{{Note
<code>_light = "#lightpoint" [[createVehicleLocal]] pos;
|user= ColonelSandersLite
_light [[setLightBrightness]] 1.0;
|timestamp= 20170817071500
_light [[setLightAmbient]] [0.0, 1.0, 0.0];
|text= To clarify:
_light [[setLightColor]] [0.0, 1.0, 0.0];
* [[setLightAmbient]] - Terrain and surrounding objects are bathed in this colour.
_light [[lightAttachObject]] [_object, [0,0,0]];
* [[setLightColor]] - Controls the "haze" seen around the lightsource (ex flares).
</code>
}}
<!-- Note Section END -->
</dl>


<h3 style="display:none">Bottom Section</h3>
{{Note
[[Category:Scripting Commands|SETLIGHTCOLOR]]
|user= ffur2007slx2_5
[[Category:Scripting Commands OFP Elite |SETLIGHTCOLOR]]
|timestamp= 20140324235800
[[Category:Scripting Commands ArmA|SETLIGHTCOLOR]]
|text= 1. In {{arma3}} ver 1.14 [[setLightColor]] will also change the color of the flare when [[setLightUseFlare]], [[setLightFlareSize]] and [[setLightFlareMaxDistance]] were used on the same light source. For example:
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
<sqf>
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
_light setLightUseFlare true;
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
_light setLightFlareSize 2;
_light setLightFlareMaxDistance 60;
_light setLightColor [1, 1, 1];
</sqf><br>
2. When both [[setLightAmbient]] and [[setLightColor]] are [0,0,0], there won’t be any visual presentation on the light source.
}}

Latest revision as of 12:42, 25 April 2022

Hover & click on the images for description

Description

Description:
Set diffuse color of light. Illuminates surfaces that are facing the light.
Groups:
Lights

Syntax

Syntax:
light setLightColor [r, g, b]
Parameters:
light: Object
r: Number - red value in range 0..1
g: Number - green value in range 0..1
b: Number - blue value in range 0..1
Return Value:
Nothing

Examples

Example 1:
myLight setLightColor [0.5,0,0]; // produces red

Additional Information

See also:
setLightAmbient setLightBrightness lightAttachObject lightDetachObject setLightIntensity setLightAttenuation setLightUseFlare setLightFlareSize setLightFlareMaxDistance setLightDayLight setLightIR

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Feersum - c
Posted on Dec 01, 2006 - 16:42 (UTC)
Light can be created with command createVehicleLocal with special vehicle class "#lightpoint"
for example:
_light = "#lightpoint" createVehicleLocal pos; _light setLightBrightness 1.0; _light setLightAmbient [0.0, 1.0, 0.0]; _light setLightColor [0.0, 1.0, 0.0]; _light lightAttachObject [_object, [0,0,0]];
ColonelSandersLite - c
Posted on Aug 17, 2017 - 07:15 (UTC)
To clarify:
  • setLightAmbient - Terrain and surrounding objects are bathed in this colour.
  • setLightColor - Controls the "haze" seen around the lightsource (ex flares).
ffur2007slx2_5 - c
Posted on Mar 24, 2014 - 23:58 (UTC)
1. In Arma 3 ver 1.14 setLightColor will also change the color of the flare when setLightUseFlare, setLightFlareSize and setLightFlareMaxDistance were used on the same light source. For example:
_light setLightUseFlare true; _light setLightFlareSize 2; _light setLightFlareMaxDistance 60; _light setLightColor [1, 1, 1];

2. When both setLightAmbient and setLightColor are [0,0,0], there won’t be any visual presentation on the light source.