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

wolfGetRegionWeather

Wolf Territories
list wolfGetRegionWeather()

This region's stored weather as key/value pairs, or an empty list.

Reads the region's weather as the same key/value list the setter takes, so a script can read it, change one value and hand the whole list straight back. Returns an empty list when the region has no weather record. The list always starts with "kind" and "on"; the integer keys follow, then "colour", "sound", "amb" and "near" when they are stored.

Takes no parameters.

The rules list

Key/value pairs in any order. Every value is an integer percent except move, which is hundredths of a metre per second. An unknown key or an out-of-range value is refused, and wolfGetLastError says which.

KeyTypeValuesMeaning
kind string clear, rain or snow What falls. Required by both setters. "clear" on a parcel means no weather THERE even when the region is raining — a cave, a covered market.
level integer 1 – 4 How heavy: 1 light, 2 moderate, 3 heavy, 4 torrential rain / blizzard. The level sets the base particle count and fall speed the other percentages scale.
bright integer 0 – 200 (%) Brightness of the precipitation's lit colour. 100 is neutral.
colour string #rrggbb The tint colour ("color" is accepted too). Rain's neutral is #aaccff, snow's is #ffffff.
tint integer 0 – 100 (%) How far from the kind's neutral colour towards the tint colour.
move integer 0 – 300 (hundredths m/s) Sideways drift the weather leans on. 60 = 0.60 m/s. The direction turns slowly on its own.
density integer 10 – 300 (%) Particle count as a percentage of the level's own figure.
velocity integer 10 – 300 (%) Fall speed as a percentage of the level's own figure.
size integer 10 – 400 (%) Particle size as a percentage of the kind's own width.
sound integer 0 or 1 Whether the weather makes any sound at all.
vol integer 0 – 100 (%) Weather sound volume.
amb string none, thunder, steady, wind, distant The ambience bed. "thunder" and "distant" are storms: they fork lightning and roll thunder in both viewers.
near string none, soft, heavy, leaves, water The near layer — the sound of rain on what is around you.
on integer 0 or 1 Region only. Whether the region weather is switched on. A script that sets a kind turns it on unless it says otherwise.

Example

default
{
    touch_start(integer n)
    {
        list w = wolfGetRegionWeather();
        llOwnerSay("Weather now: " + llDumpList2String(w, " "));

        // Make it one level heavier, keeping everything else as it is.
        integer i = llListFindList(w, ["level"]);
        if (i != -1)
        {
            integer level = llList2Integer(w, i + 1);
            if (level < 4) w = llListReplaceList(w, [level + 1], i + 1, i + 1);
            wolfSetRegionWeather(w);
        }
    }
}
Energy 10

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

More in Wolf Territories