Forgot? Join

Scripting

LSL Guide

Every script function this grid actually runs, read straight from the region software rather than copied from a wiki — including the wolf* functions that exist only here.

Functions · Constants

wolfEnvironmentSet

Wolf Territories
string wolfEnvironmentSet(integer scope, list rules)

Change parts of the region's (WOLF_ENV_REGION) or this parcel's (WOLF_ENV_PARCEL) Wolf Environment with WOLF_ENV_* key/value rules; what is not named stays as it is. Checked by the same rules as the Wolf Environment window. The object's owner must hold the region (region) or own the parcel (parcel). Returns "" when done, otherwise the reason.

Changes the Wolf Environment of the whole region, or of the parcel this object is over, from a script: day or night, a storm, snow or fog, an alien sky, a sped-up day. Name only what you want changed; everything else stays as it is. If there was no Wolf Environment yet, the change starts from the same default the window starts from (London's real sky and weather). Every change is checked by the grid with exactly the rules of the Wolf Environment window, so a script can set nothing the window could not - a bad value is refused and the answer says which. The script acts for the object's owner. For the region the owner must be the estate owner, an estate manager or a grid god. For a parcel the owner must own it (or have the group's "change environment" power on a group parcel, or deed the object to that group), or run the region; the estate must allow parcel environments, and the region must allow parcels their own weather. Changes take effect in a few seconds, for every viewer. An object may make 3 changes and then one every 10 seconds; all of one owner's objects on a region 6 and then one every 15 seconds; a region 10 and then one every 10 seconds. The same settings twice count as done without making the region redraw its sky. Returns "" when done, otherwise the reason (also in wolfGetLastError).

Parameters

TypeName What it does
integer scope WOLF_ENV_REGION for the whole region, or WOLF_ENV_PARCEL for the parcel under this object.
list rules WOLF_ENV_* key / value pairs, in any order, each key once; every key is in the table below. At most 32 pairs.

The rules list

Key/value pairs in any order, each key once. The keys are constants, so a misspelt key does not compile. A value the window would not accept is refused rather than changed, and the answer (and wolfGetLastError) says which.

KeyTypeValuesMeaning
WOLF_ENV_MODEstringwolf, on-top, offwolf: the Wolf Environment draws the whole sky. on-top: your own EEP stays and the weather, cloud, haze, light and colour go on top. off: the region's or parcel's own EEP exactly as set by hand (the settings are kept for later).
WOLF_ENV_PRESETstringearth, alien, sunset-world, twin-suns, toxic, underwater, voidA whole sky at once - atmosphere, suns, moons, stars, clouds, fog and light - as picking it in the window does.
WOLF_ENV_PLACE_KINDstringreal, fictional, nonereal: a place on Earth (name, latitude, longitude) whose sun, moon and weather are used. fictional: a name and a latitude for the sun's path. none: the equator's sun path.
WOLF_ENV_PLACE_NAMEstringup to 200 lettersThe place's name, as shown in the viewers.
WOLF_ENV_PLACE_LATfloat-90 – 90Latitude: sets how high the sun climbs.
WOLF_ENV_PLACE_LONfloat-180 – 180Longitude of a real place.
WOLF_ENV_TIME_MODEstringreal, grid, zone, fixed, cyclereal: the place's own local time (needs a real place). grid: the grid's clock. zone, fixed and cycle are set by the next three keys.
WOLF_ENV_TIME_HOURfloat0 – 23.99Always this time of day (18.5 is 18:30). Puts the time in "fixed" mode.
WOLF_ENV_DAY_HOURSfloat4 – 168A sped-up day: one whole day every this many hours. Puts the time in "cycle" mode.
WOLF_ENV_TIME_ZONEstringa time zone, such as "Europe/London"The clock of that zone. Puts the time in "zone" mode.
WOLF_ENV_WEATHER_SOURCEstringlive, pattern, fixedlive: the real place's real weather (needs a real place). pattern and fixed are set by the next two keys.
WOLF_ENV_WEATHER_TYPEstringclear, fair, cloudy, overcast, rain, storm, snow, fogThis weather, all the time. Makes the weather "fixed".
WOLF_ENV_WEATHER_PATTERNstringsettled, changeable, unsettled, stormy, wintryWeather that changes by itself in that character. Makes the weather follow the "pattern".
WOLF_ENV_CLOUDSinteger0 – 100, or -1Cloud cover in percent; -1 is automatic (as the weather has it).
WOLF_ENV_HAZEinteger0 – 100Extra haze on top of the weather's; 0 adds none.
WOLF_ENV_MOOD_TINTstringneutral, warm, cool, customA colour mood over everything. custom uses WOLF_ENV_MOOD_COLOR.
WOLF_ENV_MOOD_COLORstring or vector"#rrggbb", or <r, g, b> each 0 – 1The custom mood colour. A vector part outside 0 – 1 is refused, not clamped.
WOLF_ENV_MOOD_STRENGTHinteger0 – 100How strong the colour mood is.
WOLF_ENV_WATERstringnatural, calm, choppy, stormyThe water. natural: the waves follow the wind.
WOLF_ENV_SKYstring (JSON)a JSON objectMerged into the sky block (atmosphere, suns, moons, night, clouds, fog, light - the same keys the window's advanced section saves); what you leave out stays. The sky's label becomes "custom".
WOLF_ENV_ZONESstring (JSON)a JSON list, at most 16Replaces the zones: areas or heights with their own weather, haze, fog and light (circle, rect or above).

Example

default
{
    touch_start(integer n)
    {
        if (llDetectedKey(0) != llGetOwner()) return;   // it acts with YOUR rights
        // Night, a thunderstorm, and rough water.
        string why = wolfEnvironmentSet(WOLF_ENV_REGION, [
            WOLF_ENV_TIME_HOUR, 23.0,
            WOLF_ENV_WEATHER_TYPE, "storm",
            WOLF_ENV_WATER, "stormy"
        ]);
        if (why != "") llOwnerSay("Refused: " + why);
    }
}

The real sky of a real place, with its real weather

wolfEnvironmentSet(WOLF_ENV_REGION, [WOLF_ENV_PLACE_KIND, "real",
    WOLF_ENV_PLACE_NAME, "Reykjavik", WOLF_ENV_PLACE_LAT, 64.15, WOLF_ENV_PLACE_LON, -21.94,
    WOLF_ENV_TIME_MODE, "real", WOLF_ENV_WEATHER_SOURCE, "live"]);

An alien world, with a warm green cast

wolfEnvironmentSet(WOLF_ENV_REGION, [WOLF_ENV_PRESET, "alien",
    WOLF_ENV_MOOD_TINT, "custom", WOLF_ENV_MOOD_COLOR, <0.4, 1.0, 0.7>, WOLF_ENV_MOOD_STRENGTH, 25]);

A whole day every 4 hours, weather that changes by itself

wolfEnvironmentSet(WOLF_ENV_REGION, [WOLF_ENV_DAY_HOURS, 4.0, WOLF_ENV_WEATHER_PATTERN, "changeable"]);

Fog on your own parcel only

wolfEnvironmentSet(WOLF_ENV_PARCEL, [WOLF_ENV_WEATHER_TYPE, "fog", WOLF_ENV_HAZE, 60]);

More stars and a red sun (part of the sky block, as JSON)

wolfEnvironmentSet(WOLF_ENV_REGION, [WOLF_ENV_SKY,
    "{\"night\":{\"stars\":250},\"suns\":[{\"id\":\"sun\",\"color\":\"#ff6040\",\"size\":180}]}"]);

Back to the weather's own cloud cover

wolfEnvironmentSet(WOLF_ENV_REGION, [WOLF_ENV_CLOUDS, -1]);
Energy 10

Ours alone. Grid features you will not find on any other OpenSimulator grid.

More in Wolf Territories