wolfEnvironmentSet
Wolf Territoriesstring 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
| Type | Name | 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.
| Key | Type | Values | Meaning |
|---|---|---|---|
| WOLF_ENV_MODE | string | wolf, on-top, off | wolf: 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_PRESET | string | earth, alien, sunset-world, twin-suns, toxic, underwater, void | A whole sky at once - atmosphere, suns, moons, stars, clouds, fog and light - as picking it in the window does. |
| WOLF_ENV_PLACE_KIND | string | real, fictional, none | real: 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_NAME | string | up to 200 letters | The place's name, as shown in the viewers. |
| WOLF_ENV_PLACE_LAT | float | -90 – 90 | Latitude: sets how high the sun climbs. |
| WOLF_ENV_PLACE_LON | float | -180 – 180 | Longitude of a real place. |
| WOLF_ENV_TIME_MODE | string | real, grid, zone, fixed, cycle | real: 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_HOUR | float | 0 – 23.99 | Always this time of day (18.5 is 18:30). Puts the time in "fixed" mode. |
| WOLF_ENV_DAY_HOURS | float | 4 – 168 | A sped-up day: one whole day every this many hours. Puts the time in "cycle" mode. |
| WOLF_ENV_TIME_ZONE | string | a time zone, such as "Europe/London" | The clock of that zone. Puts the time in "zone" mode. |
| WOLF_ENV_WEATHER_SOURCE | string | live, pattern, fixed | live: the real place's real weather (needs a real place). pattern and fixed are set by the next two keys. |
| WOLF_ENV_WEATHER_TYPE | string | clear, fair, cloudy, overcast, rain, storm, snow, fog | This weather, all the time. Makes the weather "fixed". |
| WOLF_ENV_WEATHER_PATTERN | string | settled, changeable, unsettled, stormy, wintry | Weather that changes by itself in that character. Makes the weather follow the "pattern". |
| WOLF_ENV_CLOUDS | integer | 0 – 100, or -1 | Cloud cover in percent; -1 is automatic (as the weather has it). |
| WOLF_ENV_HAZE | integer | 0 – 100 | Extra haze on top of the weather's; 0 adds none. |
| WOLF_ENV_MOOD_TINT | string | neutral, warm, cool, custom | A colour mood over everything. custom uses WOLF_ENV_MOOD_COLOR. |
| WOLF_ENV_MOOD_COLOR | string or vector | "#rrggbb", or <r, g, b> each 0 – 1 | The custom mood colour. A vector part outside 0 – 1 is refused, not clamped. |
| WOLF_ENV_MOOD_STRENGTH | integer | 0 – 100 | How strong the colour mood is. |
| WOLF_ENV_WATER | string | natural, calm, choppy, stormy | The water. natural: the waves follow the wind. |
| WOLF_ENV_SKY | string (JSON) | a JSON object | Merged 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_ZONES | string (JSON) | a JSON list, at most 16 | Replaces 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]);
Ours alone. Grid features you will not find on any other OpenSimulator grid.