(info) Other great resources: Official JS API docs, Scripting Forum

setSunIntensity()

Change the lighting effects applied to game objects...

 

Syntax

setSunIntensity(aR, aG, aB, dR, dG, dB, sR, sG, sB);

Properties

PropertyTypeMandatoryNotesGame Version
aRNumber(tick)

Ambient Red light.

Game default: 0.5

3.2
aGNumber(tick)

Ambient Green light.

Game default: 0.5

3.2
aBNumber(tick)

Ambient Blue light.

Game default: 0.5

3.2
dRNumber(tick)

Diffuse Red light.

Game default: 0.5

3.2
dGNumber(tick)

Diffuse Green light.

Game default: 0.5

3.2
dBNumber(tick)

Diffuse Blue light.

Game default: 0.5

3.2
sRNumber(tick)

Specular Red light.

Game default: 0.8

3.2
sGNumber(tick)

Specular Green light.

Game default: 0.8

3.2
sBNumber(tick)

Specular Blue light.

Game default: 0.8

3.2

Return value

Does not return anything. Does not seem to throw any errors either, even if completely invalid values are passed in.

Notes

This video explains ambient, diffuse and specular lighting:

Currently this function only affects lighting applied to the PIE models of Game objects. It does not affect map terrain or base structure foundations.

To illustrate, an aR value of 100 was used to make all affected items bright red:

Example

// set default lighting levels
setSunIntensity(
	0.5. 0.5, 0.5, // ambient
	0.5, 0.5, 0.5, // diffuse
	0.8, 0.8, 0.8  // specular
);
Availability 3.2+

Requires:

  • Warzone 3.2 or above
Contents

Jump to:

See also

Related articles:

Â