(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

ParameterTypeMandatoryNotesWarzone Version
texturePageString(error)

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.

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

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

3.2
windSpeedNumber(error)

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
skyboxScaleNumber(error)

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

ValueTypeNotesGame Version
trueBooleanThe sky was changed successfully3.2
falseBooleanThere was a problem changing the sky.3.2
<error>ErrorInvalid 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:

Availability 3.2+

Requires:

  • Warzone 3.2 or above
Contents

Jump to:

See also

Related articles: