setSky()

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

setSky()

Set the sky image, rotation speed and scale...

 

Syntax

var success = setSky(texturePage, windSpeed, skyboxScale);

Parameters

Parameter

Type

Mandatory

Notes

Warzone Version

Parameter

Type

Mandatory

Notes

Warzone Version

texturePage

String

Sets the sky image.

Can reference either an existing page name as defined in the WRF system, or a filename of a PNG file located in the existing texture paths.

PNG files must be multiples of 128 pixels high/wide.

Default: "page-25" (which will auto-select between urban and arizona skybox).

3.2

windSpeed

Number

The speed of the wind, which determines the rate at which the skybox auto-rotates.

A speed of 0 will stop the skybox from rotating. Negative values cause the skybox to rotate anti-clockwise, positive values cause it to rotate clockwise.

For best results use values between -2.0 → +2.0, anything faster will be too fast and look unrealistic.

Default: 0.5

3.2

skyboxScale

Number

The size of the skybox. Bigger values push the skybox further away from the map and increase the height and width of the skybox sides, smaller values do the opposite.

For best results use values between 4000.0 (small & close) → 20000.0 (big & far). Anything less than 4000 will likely result in the top of the skybox becoming visible when the camera is horizontal. When doing scripted camera views, large values enable the camera to be tilted upwards slightly.

Default: 10000.0

3.2

Return value

Value

Type

Notes

Game Version

Value

Type

Notes

Game Version

true

Boolean

The sky was changed successfully

3.2

false

Boolean

There was a problem changing the sky.

3.2

<error>

Error

Invalid parameters.

3.2

Example

Default skybox image, moderate anti-clockwise motion, huge and far sky...
setSky("page-25", -0.7, 20000.0);

Video

By changing the sky texture every 100ms you can create animated skies: