SetSkyBox(int, object)

Changes the sky that is displayed in the specified area.

void SetSkyBox(
    int nSkyBox,
    object oArea = OBJECT_INVALID
);

Parameters

nSkyBox

A SKYBOX_* constant (associated with skyboxes.2da)

oArea

The area the skybox needs changing in (Default: OBJECT_INVALID)


Description

Changes the sky that is displayed in the specified area, to one of the SKYBOX_ constants (associated with skyboxes.2da).

If no valid area (or object) is specified, it uses the area of caller.

If an object other than an area is specified, will use the area that the object is currently in (noting Modules cannot be in area's).



Remarks

This simply will change it to one of the other skybox's, instantly. There can be no transition.

To change a skybox to a newly added one, you of course must reference a skyboxes.2da line in the nSkyBox parameter.

This is best used to change a skybox according to the weather, or an other really evil or really good things going on (a skybox depicting hell might be useful if your evil demon lord decides to invade your nice city). Normally, you just want to change the skybox according to the weather however. Used in conjunction with SetWeather(), you can change both at once.


Version

1.64

Example

// Change the weather in OBJECT_SELF's area to stormy, and
// change the skybox to SKYBOX_GRASS_STORM.

void main()
{
    // Define us, the area to change (perhaps using the On Enter event)
    object oArea = OBJECT_SELF;

    // Change the weather.
    SetWeather(oArea, WEATHER_RAIN);

    // Set the skybox.
    SetSkyBox(SKYBOX_GRASS_STORM, oArea);
}

See Also

categories: Area Functions
constants: SKYBOX_* Constants


 author: Jasperre, additional contributor(s): Jasperre
 Send comments on this topic.