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

859
Functions
964
Constants
103
Wolf Territories only

The wolf* functions

Written for this grid and available nowhere else. A script may only do what the object’s owner could do by hand, so region weather needs the estate and parcel weather needs the parcel, and a trailer only couples to a truck with the same owner.

How players use the driving dashboard, Wolf Roleplay, Flight Mode and Sailing Mode, with full examples: Driving, Wolf Roleplay, Flight Mode and Sailing Mode.

Weather (3 functions)
integer wolfSetRegionWeather(list rules)

Set this region's weather. The script's OWNER must hold the region. Key/value pairs: see Wolf_Api.WeatherRulesToJson. TRUE when the grid accepted it, FALSE otherwise.

list wolfGetRegionWeather()

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

integer wolfSetParcelWeather(list rules)

Force the weather on the parcel this prim stands in, by writing the keyword form into THIS prim's description — the mechanism the viewers already read. The script's owner must own the parcel (or hold the region).

Errors (1 function)
string wolfGetLastError()

The last error from a wolf* call on this script, or an empty string.

Vehicle couplings (6 functions)
integer wolfCouplerSetKey(string key)

Give this object a coupler key, the name a rear object uses to find it with wolfAttach. Not a UUID, so it survives rezzing, restarts and region crossings. "" removes the key.

integer wolfCouplerSetPoint(string name, vector localPos)

Name a hitch point on this object, in its root prim's frame (+X forward, +Y left, +Z up), for a rear object to couple to. Up to 8 points; setting a name again moves it.

integer wolfCouplerRemovePoint(string name)

Remove a named hitch point from this object.

integer wolfAttach(string frontKey, string pointName, vector myPoint, integer type, list options)

Couple this object (the rear) to the object with coupler key frontKey, joining myPoint (root prim frame) to its hitch point pointName. Both must have the same owner and be physical. The joint is made as soon as the points are within reach, and is kept through restarts and region crossings until wolfDetach. Type is WOLF_JOINT_BALL, WOLF_JOINT_FIFTHWHEEL or WOLF_JOINT_COUPLER; options are "yaw", "pitch" (degrees), "reach" and "break" (metres).

integer wolfDetach()

Uncouple this object and forget its wolfAttach request.

list wolfAttachInfo()

This object's coupling: [status, front key, point name, front object key]. Status is WOLF_ATTACH_NONE, WOLF_ATTACH_WAITING, WOLF_ATTACH_COUPLED or WOLF_ATTACH_BROKEN.

Driving: wheel, pedals and dashboard (2 functions)
list wolfDriveInput(string avatar)

The exact wheel and pedals of a driver sitting on this object (the script needs PERMISSION_TAKE_CONTROLS from them, as control() does), from their Wolf viewer: [steer -1..1 (right +), throttle 0..1, brake 0..1, clutch 0..1, gear (WOLF_DRIVE_GEAR_P/R/N/D or 1..18), buttons (WOLF_DRIVE_BTN_* bits), age in seconds]. Sent on change and once a second, so an age over ~2 s means the viewer has gone. An empty list from any other viewer: keep a control() event for those.

integer wolfDashboard(string avatar, list rules)

Drive the Wolf dashboard of a driver sitting on this object: key/value pairs - type ("car", "truck", "bike", "speedboat", "spaceship", "submarine"), units ("kmh", "mph", "kn"), rpm, max_rpm, redline, max_speed, gear ("P", "R", "N", "D", "1".."18"), fuel, adblue (percent), temp (C), air1, air2 (bar), indicators (0 off, 1 left, 2 right, 3 hazard), lights (0, 1 dipped, 2 main), handbrake, retarder (0-5), cruise, drive_time (seconds), odo (km), warnings ("engine,oil,abs..."), clear; speedboat/spaceship/submarine: throttle (-100..100), trim (-5..5), anchor, engine, mode ("ship", "rocket"), stage, stages (0-9), boost, shield, hull, heat (percent), assist, landing_gear, ballast (0-100), max_depth (m), oxygen, battery (percent), planes (-100..100), periscope. The speed is measured by the viewer. At most 5 a second. TRUE when sent.

Effects: explosions, fire, smoke and camera shake (2 functions)
integer wolfEffect(string effect, vector pos, list rules)

A script effect drawn by Wolf viewers, e.g. wolfEffect("explosion", llGetPos() + <0,0,1>, ["size", 6, "shake", 0.8]). Effects: explosion, fireball, smoke, sparks, fire, fireworks, dust, shockwave. Keys: size (metres), colour, colour2 (vectors 0..1), duration (seconds), intensity (0.1..2), shake (0..1), shake_radius (metres), sound (TRUE/FALSE), volume (0..1), direction (vector). In this region, within 96 m of the object; an object may start 5 at once then 2 a second. 1 when sent, 0 (wolfGetLastError says why) when refused.

integer wolfShakeCamera(string avatar, float strength, float seconds)

Shake a Wolf viewer's camera: strength 0..1, seconds 0.05..10. NULL_KEY: everyone within 96 m on land the object's owner controls. Only the object's owner, someone sitting on or wearing it, or someone on land the owner controls. 1 when sent (or nobody to shake), 0 when refused.

Roleplay: the game (11 functions)
integer wolfGameCreate(list rules)

Make a Wolf Roleplay game for this region, owned by the script's owner, who must hold the region. Rules: name (unique), kind (managed|external), theme (wolves|plain), description, website, rules, logo, currency, symbol, currencyicon (the currency's picture, a texture key), start, playerpay, death (spawn|home|stay), respawn (seconds), spawn (vector - defaults to this object), webhook, webhooksecret, starter (items a player's first join gives, e.g. "meat=3,water=2"). Register the game's own scripts with wolfGameTrustScript. TRUE when created.

integer wolfGameSet(list rules)

Change this region's game (same rules as wolfGameCreate). Only the game's owner.

list wolfGameGet()

This region's game as key/value pairs, or an empty list. Includes "forced" (1 when the region forces Game Mode on).

integer wolfGameDefineStat(string name, list rules)

Add or change a stat: label, min, max, start, rate (per minute, + regenerates, - decays), zero (none|die|slow|drain), target and amount (for drain), colour, icon (a texture key; or a short text glyph), visible, order, health (1 = tied to the avatar's health), keep (1 = kept through a respawn: xp, gold). At most 16 stats.

integer wolfGameRemoveStat(string name)

Remove a stat from this region's game.

list wolfGameStats()

The names of this region's game stats.

integer wolfGameRegister(string gameKey)

Run an existing game (one you own, or the Wolf Territories default game) on this region.

integer wolfGameUnregister()

Stop running a game on this region.

string wolfGameKey()

This region's game key, or "" when it runs none.

integer wolfGameSetSpawn(vector pos)

Where this game's players respawn, on this region.

integer wolfGameListen(integer channel)

Receive game events on this channel as chat (from the game's name and key; check the av field - a game script hears every player): join|av, arrive|av (playing on this region now - set up their action bar), leave|av, death|av|killer|cause, respawn|av, zero|av|stat, pay|from|to|amount, item|av|item|+n, equip|av|slot|item, unequip|av|slot|item, target|av|key, buffend|av|id. 0 stops. The region's holder and the game's own scripts hear everyone; a WORN object hears only its own wearer's events.

Roleplay: players, stats and money (20 functions)
integer wolfGameJoin(string avatar)

Join an avatar to this region's game. The region's holder, the avatar's own worn object, or a game-made item the avatar owns. On a forced region an avatar whose own switch is off is read in as on arrival (playing a moment later) - never re-joined to a game they left.

integer wolfGameLeave(string avatar)

Take an avatar out of this region's game (their wallet stays).

integer wolfGameIsPlaying(string avatar)

TRUE when the avatar plays this region's game and is here.

list wolfGamePlayers()

The keys of everyone playing this region's game here.

integer wolfGameResetPlayer(string avatar)

Every stat back to its start value.

integer wolfGameGetStat(string avatar, string stat)

One stat's value. 0 and wolfGetLastError() set when it cannot be read.

integer wolfGameSetStat(string avatar, string stat, integer value)

Set a stat (held to its min and max). Reaching the minimum runs the stat's zero action.

integer wolfGameAddStat(string avatar, string stat, integer delta)

Add to a stat (negative takes away) - eating, drinking, a stamina drink.

integer wolfGameSetStatMax(string avatar, string stat, integer max)

This player's own maximum for a stat - a skill that raises max stamina.

list wolfGameGetStats(string avatar)

[name, value, max, ...] for every stat.

integer wolfGameDamage(string avatar, integer amount, string cause)

Take health away. At 0 the player dies and the game respawns them.

integer wolfGameHeal(string avatar, integer amount)

Give health back (not to the dead - wolfGameRespawn does that).

integer wolfGameRespawn(string avatar)

Bring a dead player back now instead of after the game's respawn time.

integer wolfGameBalance(string avatar)

The avatar's balance of this game's currency.

integer wolfGameTake(string avatar, integer amount, string reason)

Take game currency from a player; refused when they have too little.

integer wolfGamePay(string from, string to, integer amount, string reason)

Move game currency from one player to another. The payer's own object, when the game allows players to pay; or the region's holder.

integer wolfGameSetData(string avatar, string key, string value)

Store a value for this player in this game (class, race, quest step...). "" removes it.

string wolfGameGetData(string avatar, string key)

A value stored with wolfGameSetData, or "".

Roleplay: the player's screen (17 functions)
integer wolfGameShowStat(string avatar, string name, integer value, integer max, string colour, string icon)

Show a bar on the player's Wolf viewer: name, value, max, colour (#rrggbb), icon (a texture key; or a short text glyph). For games that keep their own stats.

integer wolfGameHideStat(string avatar, string name)

Remove a bar shown with wolfGameShowStat.

integer wolfGameSetCurrencyDisplay(string avatar, string symbol, integer amount)

Show a balance from your own system on the player's screen ("KR$", 1500). "" hides it.

integer wolfGameNotify(string avatar, string title, string text, string type)

A notice on the player's screen. Type: info, success, warning or danger.

integer wolfGameDialog(string avatar, string title, string text, list buttons, integer channel)

A dialog on the player's Wolf viewer. The button pressed comes back on the channel as chat from the avatar, like llDialog.

integer wolfGameSetButtons(string avatar, list idLabelPairs, integer channel)

Buttons in the player's Roleplay panel: [id, label, id, label...]. A press comes back on the channel as chat from the avatar: the id.

integer wolfGameEffect(string avatar, string effect, integer strength, float seconds)

A screen effect: flash, pulse, blur, blackout, desaturate, shake or clear. Strength 0-100, seconds 0-600.

integer wolfGameSetDowned(string avatar, integer on, string text, integer seconds)

Down (TRUE) or up (FALSE): an overlay on the player's screen, and the region holds them still.

integer wolfGameSetSpeed(string avatar, float factor)

Walking/running speed, 0.1 to 2.0 (1.0 is normal). The region enforces it.

integer wolfGameShowWeb(string avatar, string url, string mode, integer width, integer height)

Your own https:// page in the player's viewer: mode panel, overlay or window; width and height 0 for automatic.

integer wolfGameCloseWeb(string avatar)

Close the page opened by wolfGameShowWeb.

integer wolfGameSound(string avatar, string sound, float volume)

Play a sound that only this player hears (name in this object, or a sound key). Volume 0.0-1.0.

integer wolfGameMarker(string avatar, string id, string region, vector pos, string label, string colour, float seconds)

A marker on the player's screen, minimap and world map: id, region ("" = this one), position, label, colour, seconds (0 = until cleared).

integer wolfGameClearMarker(string avatar, string id)

Remove a marker ("" removes them all).

integer wolfGameSetTag(string avatar, string text, string colour)

A line under the avatar's name tag, seen by everyone using a Wolf viewer. "" removes it.

integer wolfGameSetPanel(string avatar, string title, list labelValuePairs)

An information panel in the player's Roleplay floater: title, [label, value, ...].

Roleplay: items and pets (21 functions)
integer wolfGameDefineItem(string name, list rules)

Define a game item (seeds, wheat, bread, lockpicks, a sword): label, icon (a texture key; or a short text glyph), max (per player, 0 = no limit), order; kind ("" | weapon | armour | spell | consumable | material); for weapons and armour a slot (weapons: main, off, ranged; armour: off, head, body, hands, legs, feet, neck, ring) and display stats - damage, range, firemode, magazine, ammo (its ammunition item), twohand (main only), defence. Only the game's owner.

integer wolfGameRemoveItem(string name)

Remove an item's definition (players keep what they hold).

integer wolfGameItemAdd(string avatar, string item, integer qty, string reason)

Give a player some of an item. The game's owner or the game's own no-modify items only.

integer wolfGameItemTake(string avatar, string item, integer qty, string reason)

Take some of an item from a player; refused when they have too few.

integer wolfGameItemCount(string avatar, string item)

How many of an item the player holds.

list wolfGameItems(string avatar)

[item, quantity, ...] for everything the player holds.

integer wolfGameExchange(string avatar, list take, list give, string reason)

One atomic swap: take [name, qty, ...] and give [name, qty, ...] - "$" is the game's money. Selling 10 wheat for 50 coins, planting a seed. All or nothing.

integer wolfGameDefinePet(string type, list rules)

Define a pet type (wolf_pup, pony): label, icon (a texture key; or a short text glyph), max (per player, 0 = no limit), order. Only the game's owner.

integer wolfGameRemovePet(string type)

Remove a pet type no pet still has.

integer wolfGameDefinePetStat(string type, string stat, list rules)

A pet type's stat: label, min, max, start, rate (per minute, keeps running while the pet is in inventory), zero (none|die), colour, icon (a texture key; or a short text glyph), order.

string wolfGamePetCreate(string owner, string type, string name, list data)

A new pet for a player (a pet shop, a hatchery, breeding): owner, type, name, [data key, value, ...]. Returns the pet's key - keep it in the pet object (linkset data). "" when refused.

list wolfGamePetGet(string pet)

[type, name, owner, alive, age seconds, stat, value, max, ...] - stats as they are NOW, aged by real time.

string wolfGamePetGetData(string pet, string key)

A value stored with the pet (genes, colour, tricks), or "".

integer wolfGamePetSetStat(string pet, string stat, integer value)

Set a pet stat. The pet owner's own game items, or the game's own items on the game's land.

integer wolfGamePetAddStat(string pet, string stat, integer delta)

Add to a pet stat - feeding, playing, grooming.

integer wolfGamePetSetData(string pet, string key, string value)

Store a value with the pet. "" removes it.

integer wolfGamePetTransfer(string pet, string to)

Give or sell the pet to another player of the game.

integer wolfGamePetRelease(string pet)

Let the pet go: its record is deleted.

list wolfGamePets(string owner)

[pet key, type, name, alive, ...] for an avatar's pets in this game.

Roleplay: trusted scripts and forced Game Mode (3 functions)
integer wolfGameTrustScript(string scriptName)

Register a script in this object as one of the game's OWN scripts (by its asset - an edited copy is not). Only the game's owner. The game's own scripts are the only ones that may change players, money, items and pets.

integer wolfGameUntrustScript(string scriptName)

Take a script in this object off the game's own list.

integer wolfGameForceMode(integer on)

TRUE keeps Game Mode ON for everyone on this region (they cannot switch it off or leave the game here - "so people dont turn it off to avoid getting killed"); FALSE gives them their own choice back. Never changes anyone's own saved switch. The region's holder or a grid god.

Roleplay: combat (17 functions)
integer wolfGameEquip(string avatar, string item)

Put an item the player holds into its slot (a weapon or armour item - see wolfGameDefineItem). Kept per player per game. The game's own scripts; players equip from their viewer.

integer wolfGameUnequip(string avatar, string slot)

Empty an equipment slot: main, off, ranged, head, body, hands, legs, feet, neck or ring.

list wolfGameLoadout(string avatar)

[slot, item, ...] - what the player has equipped.

integer wolfGameSetAbility(string avatar, string id, list rules)

Add or change a button on the player's action bar: label, icon, cooldown (s), cast (s), cost (a stat) and amount, key (hint), enabled, group (shared cooldown), weapon (a slot whose ammo it uses), ammo (rounds per use), target (1 = refused with "No target" when the player has none), order, channel. A press is checked by the region (cooldown, cast, ammo; the cost is TAKEN when the game's own script set it and it is a stat of the game - never down to the minimum of a stat whose emptiness does something, such as health) and comes back on the channel from the avatar's key under the name "#wolfgame" (listen with llListen(channel, "#wolfgame", avatar, "") - no viewer can chat under that name): cast|id|target, use|id|target, interrupted|id. At most 12.

integer wolfGameRemoveAbility(string avatar, string id)

Remove an action-bar button ("" removes them all).

integer wolfGameCooldown(string avatar, string id, float seconds)

Start an ability's cooldown for this many seconds (0 ends it).

integer wolfGameInterrupt(string avatar)

Stop the player's cast in progress (a stun, a hit). Its script hears interrupted|id.

integer wolfGameSetGear(string avatar, string slot, list rules)

What an equipment slot shows on the player's weapons panel (for games that keep their own weapons): label, icon, damage, range, firemode, defence, ammoname, magazine, ammo, reserve, channel (reload requests come back as reload|slot, from the avatar under the name "#wolfgame"). [] clears it.

integer wolfGameSetAmmo(string avatar, string slot, integer ammo, integer reserve)

A slot's ammo: rounds in the magazine and in reserve (-1 = not shown). Ends a reload. The region takes the rounds an ability uses by itself.

integer wolfGameReload(string avatar, string slot, float seconds)

Show a reload on a weapon slot for this many seconds (0 stops it); its abilities cannot fire meanwhile. Call wolfGameSetAmmo when it is done.

list wolfGameGetAmmo(string avatar, string slot)

[ammo, magazine, reserve, reloading] for a slot.

integer wolfGameSetTarget(string avatar, string target, list rules)

The player's target frame: target key ("" clears), then name, health, max, level, hostility (hostile|neutral|friendly), icon, text (subtitle), dead. With no health, a player of this game shows their live health.

string wolfGameGetTarget(string avatar)

The player's current target, or NULL_KEY. Players pick targets in their viewer; you hear target|av|key.

integer wolfGameTargetHealth(string target, integer health, integer max)

Update the health bar on the target frame of everyone targeting this key (a monster taking hits).

integer wolfGameAddBuff(string avatar, string id, list rules)

A buff or debuff on the player's screen: label, icon, seconds (0 = until removed; given again it restarts), stacks, type (buff|debuff), text. At most 20. You hear buffend|av|id when it runs out.

integer wolfGameRemoveBuff(string avatar, string id)

Remove a buff or debuff ("" removes them all).

integer wolfGameCombatText(string avatar, string at, integer amount, string kind, string colour)

A floating combat number: over the target `at` (damage dealt, with a hit marker) or over the player (at = the player or "": damage taken). Kind: hit, crit, heal, miss, dodge, block, immune, absorb. Colour #rrggbb or "".

The rules list, shared by both setters

Key/value pairs in any order; kind is required. 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 rather than ignored, 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 – 1000 (hundredths m/s) Sideways drift the weather leans on. 60 = 0.60 m/s. The direction turns slowly on its own.
density integer 10 – 4000 (%) Particle count as a percentage of the level's own figure. Source: Wolf_Api.cs WEATHER_RANGES, the Weather tab's own range since 2026-09-18.
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.
fog integer 0 – 100 (%) Thick air, 0 = none. Independent of the kind: fog with rain, with snow, or on its own under "clear". The number is a visibility: 2000 m × 0.02^(fog/100), so 50 is about 280 m and 100 is 40 m.
aurora integer 0 – 100 (%) The northern lights, 0 = none. Night only: the viewers fade it in after dusk and out at dawn, so a script may leave it set all winter. 35 is a faint arc, 70 bright curtains, 100 a storm overhead.
acol string green, red, purple, blue, pink, multi The aurora's colour. "multi" cycles through them.
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.

wolfSetRegionWeather

Sets the weather for the whole region: what falls, how heavily, its colour, movement, density, size and sound, plus fog and the northern lights. Returns 1 when the grid accepted it and 0 when it refused; wolfGetLastError says why. The script's owner must hold the region (estate owner or manager), exactly as the About Land > Weather tab requires, because a script may only do what its owner could do by hand.

Example

default
{
    touch_start(integer n)
    {
        // A heavy thunderstorm: dense rain, leaning on a 1.8 m/s wind, loud.
        if (!wolfSetRegionWeather([ "kind", "rain", "level", 3,
                                    "density", 140, "move", 180,
                                    "amb", "thunder", "near", "heavy", "vol", 85 ]))
        {
            llOwnerSay("Weather refused: " + wolfGetLastError());
        }
    }
}

A snowy night, quiet

wolfSetRegionWeather([ "kind", "snow", "level", 2, "colour", "#e6f0ff",
                       "tint", 60, "velocity", 80, "amb", "wind", "vol", 40 ]);

Clear skies again

wolfSetRegionWeather([ "kind", "clear" ]);

A clear winter night under the northern lights (they only show after dark)

wolfSetRegionWeather([ "kind", "clear", "aurora", 60, "acol", "green" ]);

Fog on its own, about 280 m of visibility

wolfSetRegionWeather([ "kind", "clear", "fog", 50 ]);

Switch the region weather off without forgetting the settings

wolfSetRegionWeather([ "kind", "rain", "on", FALSE ]);

wolfGetRegionWeather

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 (including "fog" and "aurora"), then "colour", "sound", "amb", "near" and "acol" when they are stored.

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);
        }
    }
}

wolfSetParcelWeather

Weather for ONE parcel, carried by the prim the script is in: the function writes the weather keyword into the prim's description (the same "wolfrain3 dens=170 amb=thunder" form a builder can type by hand) and the viewers read it from there. The prim must stand on a parcel the script's owner owns (or the owner must hold the region). Parcel weather beats region weather; "clear" on a parcel keeps a region storm out of a cave or a covered market. Returns 1 or 0, and refuses rather than truncates when the options would not fit a 127-character description.

Example

// Put this in a prim on your parcel. The prim can be anything — a rock, a sign,
// an invisible cube — it only needs to sit on the parcel.
default
{
    state_entry()
    {
        // Light rain with leaves rustling nearby, only on this parcel.
        if (!wolfSetParcelWeather([ "kind", "rain", "level", 1,
                                    "near", "leaves", "vol", 50 ]))
        {
            llOwnerSay("Parcel weather refused: " + wolfGetLastError());
        }
    }

    touch_start(integer n)
    {
        // Touch to make this parcel a dry spot even when the region is raining.
        wolfSetParcelWeather([ "kind", "clear" ]);
    }
}

Turn it off again

llSetObjectDesc("");   // no keyword, no parcel weather — the region's weather returns

wolfGetLastError

Why the last wolf* call returned 0: the region refused it (the owner does not hold the region or the parcel, a bad key or value, the weather service could not be reached, or the functions are not enabled on this region). Empty after a call that succeeded.

Example

default
{
    touch_start(integer n)
    {
        // A deliberate mistake: 5 is out of range (1 - 4), so this is refused.
        if (!wolfSetRegionWeather([ "kind", "rain", "level", 5 ]))
        {
            llSay(0, "Refused: " + wolfGetLastError());   // "level must be 1..4"
        }
    }
}

Vehicle couplings

A truck and its trailer, a car and its caravan, a locomotive and its carriages, joined by a real joint in the region’s physics rather than a script chasing the vehicle in front. The front gives itself a key and names its hitch points; the rear asks for “the front with this key, at that point”. Both must belong to the same owner and be physical. The coupling is kept through region restarts, editing and region crossings until the rear calls wolfDetach.

wolfAttach joint types

TypeValueWhat it is
WOLF_JOINT_BALL1A tow ball. Every rotation is free. Car and caravan, a boat trailer.
WOLF_JOINT_FIFTHWHEEL2A semi-trailer fifth wheel. Turns and nods within limits, cannot roll against the tractor unit.
WOLF_JOINT_COUPLER3A railway coupler. Like a fifth wheel with tighter limits. Locomotive and carriages.

The options list

Key/value pairs in any order, or an empty list for the defaults. An unknown key or an out-of-range value is refused rather than ignored, and wolfGetLastError says which.

KeyTypeValuesMeaning
yawfloat or integer0 – 170 (degrees)How far the rear may turn either side of straight. Fifth wheel 90, coupler 35 by default. Not taken by WOLF_JOINT_BALL, which turns freely.
pitchfloat or integer0 – 80 (degrees)How far the rear may nod up or down either side of level. Fifth wheel 20, coupler 15 by default. Not taken by WOLF_JOINT_BALL.
reachfloat or integer0.1 – 10 (metres)The two hitch points join once they are this close, 3 m by default; the rear is then moved the rest of the way. Back the truck up to the trailer and it couples.
breakfloat or integer0.1 – 10 (metres)If a coupled pair is pulled more than this far apart at the hitch, 2 m by default, the coupling breaks and wolfAttachInfo reports WOLF_ATTACH_BROKEN.

wolfCouplerSetKey

Gives this object — the FRONT of a rig: a tractor unit, a car, a locomotive, a carriage with another behind it — a coupler key. A rear object finds its front by this key with wolfAttach. It is your own name for the vehicle, not a UUID, because a UUID changes every time an object is rezzed; the key is stored in the object and survives taking and rezzing, region restarts and region crossings. Only objects with the same owner couple, so your key never clashes with anyone else's. Several identical trucks can share one key: a trailer couples to whichever of them is backed up to its hitch. "" removes the key. Returns 1, or 0 with wolfGetLastError saying why.

Example

// In the tractor unit's root prim, next to its driving script.
default
{
    state_entry()
    {
        wolfCouplerSetKey("wolfhaul");
        // The fifth wheel: 2.8 m behind the root prim's centre, 1.1 m up.
        wolfCouplerSetPoint("fifthwheel", <-2.8, 0.0, 1.1>);
    }
}

Stop anything coupling to this object

wolfCouplerSetKey("");

wolfCouplerSetPoint

Names a hitch point on this object for a rear object to couple to: a fifth wheel, a tow ball, a coupler hook. The position is in the ROOT prim's frame (+X forward, +Y left, +Z up — the vehicle frame), wherever in the linkset the script is. An object can have up to 8 points; setting a name again moves that point. Each point takes one rear. Returns 1, or 0 with wolfGetLastError saying why.

Example

// A locomotive with couplers at both ends.
default
{
    state_entry()
    {
        wolfCouplerSetKey("wolfrail");
        wolfCouplerSetPoint("rear",  <-7.2, 0.0, 0.6>);
        wolfCouplerSetPoint("front", < 7.2, 0.0, 0.6>);
    }
}

Find a point by touch: say where you touched, in root frame

touch_start(integer n) { llOwnerSay((string)((llDetectedTouchPos(0) - llGetRootPosition()) / llGetRootRotation())); }

wolfAttach

Couples this object — the REAR: a trailer, a caravan, a carriage — to the front with coupler key frontKey, joining myPoint on this object to the front's hitch point pointName. This is a real joint in the region's physics (ubODE and BulletSim both), not a script chasing the truck: the trailer swings, tracks and is pulled. Both objects must have the same owner and be physical. The request is stored in the object: the joint is made as soon as the two points are within reach (3 m unless you say otherwise), and it is made again after the region restarts, after either object has been edited, and in the next region after a crossing, until wolfDetach. Returns 1 when the request is accepted — check wolfAttachInfo to see it couple.

Example

// In the semi-trailer's root prim. The trailer should NOT have a vehicle motor of its
// own: VEHICLE_TYPE_NONE, or a car type with its motors at zero, whose sideways friction
// is what makes a trailer follow the tractor unit round a corner.
default
{
    state_entry()
    {
        llSetStatus(STATUS_PHYSICS, TRUE);
        // The kingpin: 5.5 m ahead of this trailer's centre, 1.1 m up.
        if (!wolfAttach("wolfhaul", "fifthwheel", <5.5, 0.0, 1.1>,
                        WOLF_JOINT_FIFTHWHEEL, [ "yaw", 80 ]))
            llOwnerSay("Couple refused: " + wolfGetLastError());
        llSetTimerEvent(1.0);
    }

    timer()
    {
        integer st = llList2Integer(wolfAttachInfo(), 0);
        if (st == WOLF_ATTACH_COUPLED)      llSetText("", ZERO_VECTOR, 0.0);
        else if (st == WOLF_ATTACH_WAITING) llSetText("Back the truck under me", <1, 1, 0>, 1.0);
        else if (st == WOLF_ATTACH_BROKEN)  llSetText("Broke away!", <1, 0, 0>, 1.0);
    }
}

A caravan on a tow ball

wolfAttach("wolfcar", "towball", <3.1, 0.0, 0.45>, WOLF_JOINT_BALL, []);

A railway carriage: the same script in every carriage makes a train of any length — each couples its front to the "rear" of whatever is in front of it

wolfCouplerSetKey("wolfrail");
wolfCouplerSetPoint("rear", <-7.0, 0.0, 0.6>);
wolfAttach("wolfrail", "rear", <7.0, 0.0, 0.6>, WOLF_JOINT_COUPLER, []);

Re-hitch after it broke away

wolfAttach("wolfhaul", "fifthwheel", <5.5, 0.0, 1.1>, WOLF_JOINT_FIFTHWHEEL, []);

wolfAttachInfo

This object's coupling, as [status, front key, point name, front object key]. The status is WOLF_ATTACH_NONE (it asked for none), WOLF_ATTACH_WAITING (asked for, not joined: no front within reach, or one of the two is not physical, is being edited or is crossing a region border), WOLF_ATTACH_COUPLED, or WOLF_ATTACH_BROKEN (pulled apart — it stays broken until wolfAttach or wolfDetach). The front object key is NULL_KEY until a front has been found.

Example

default
{
    touch_start(integer n)
    {
        list info = wolfAttachInfo();
        list names = [ "none", "waiting", "coupled", "broken" ];
        llOwnerSay("Coupling: " + llList2String(names, llList2Integer(info, 0))
                   + " to \"" + llList2String(info, 1) + "\" at \"" + llList2String(info, 2)
                   + "\", object " + llList2String(info, 3));
    }
}

wolfDetach

Uncouples this object and forgets its wolfAttach request, so it will not couple again after a restart or a crossing. Returns 1.

Example

default
{
    touch_start(integer n)
    {
        if (llDetectedKey(0) == llGetOwner())
        {
            wolfDetach();
            llOwnerSay("Uncoupled.");
        }
    }
}

wolfCouplerRemovePoint

Removes a named hitch point. A rear coupled to it is released. Returns 1, or 0 when there is no point by that name.

Example

default
{
    touch_start(integer n)
    {
        if (llDetectedKey(0) == llGetOwner())
            wolfCouplerRemovePoint("towball");   // unhitch the caravan for good
    }
}

Effects: explosions, fire and camera shake

Explosions, fireballs, fire, smoke, sparks, fireworks, dust and shockwaves, drawn as layered particles by WolfViewer and WolfStorm, and a camera shake that fades with distance. The region checks every call: effects only over your own land, shakes only for people your object has a reason to shake, and a limit on how many a second.

wolfEffect effects

EffectSizeLastsWhat it is
explosion4 m1 sA white flash, a fireball cooling from white-hot to dark red, a shock ring along the ground, sparks and dark debris that bounce, and a smoke column. Shakes the view (0.6) and booms by default.
fireball3 m1 sA flash and a fireball with a little smoke: no shock ring, sparks or debris, and no shake unless you ask. Booms by default.
smoke3 m6 sA column that keeps rising and spreading for the duration, grey by default.
sparks1.5 m0.5 sHot sparks streaking out along "direction" and falling, bouncing where they land, for the duration.
fire1.5 m10 sFlames with embers and smoke above them, burning for the duration and leaning along "direction".
fireworks12 m1 sA sphere of streaking stars: two in three are "colour", one in three "colour2". Plays the firework sound by default.
dust3 m1 sA cloud of dust rolling out along the ground.
shockwave6 m1 sA faint flash and a white ring racing out along the ground.

The rules list

Key/value pairs in any order, or an empty list for the defaults. A number outside a key's range is held to it; an unknown key, a key given twice or a value of the wrong type is refused, and wolfGetLastError says which.

KeyTypeValuesMeaning
sizefloat0.2 – 30 (metres)The radius. The default depends on the effect (table above).
durationfloat0.1 – 30 (seconds)How long it lasts. Matters most for fire, smoke and sparks.
intensityfloat0.1 – 2How many particles, 1 = normal.
colourvector<r, g, b>, each 0 – 1The main colour: the fireball, flames, smoke, dust or firework stars. Each effect has its own default (fire orange, smoke grey, dust brown, fireworks red). Sparks are always white-hot to orange and ignore it.
colour2vector<r, g, b>, each 0 – 1The second colour: an explosion's debris and smoke, a fireball's smoke, one firework star in three (yellow by default).
directionvectorany vector but ZERO_VECTORWhich way sparks fly and flames lean. Straight up, <0, 0, 1>, by default.
shakefloat0 – 1How hard the view shakes at the centre, fading to nothing at shake_radius. 0.6 for an explosion, 0 for the rest.
shake_radiusfloat0 – 150 (metres)How far the shake reaches. By default 8 × size, at most 150 m.
soundintegerTRUE or FALSEWhether it makes a sound. On by default for explosion, fireball and fireworks.
volumefloat0 – 1Sound volume, 1 by default.

wolfEffect

Sets off an explosion, fireball, smoke, sparks, fire, fireworks, dust or a shockwave at a point, drawn by WolfViewer and WolfStorm (other viewers hear the sound but see nothing). The point must be in this region, within 96 m of the object, and over the object's own parcel or land its owner controls: no explosions on the neighbours. Numbers outside a key's range are held to it; an unknown effect or key, a key given twice or a value of the wrong type refuses the call. An object may set off 5 effects at once and then 2 a second, all of one owner's objects together 10 and then 3 a second, the region 30 and then 10 a second. Returns 1 when sent, or 0 with wolfGetLastError saying why.

Example

default
{
    touch_start(integer n)
    {
        // A big bang a metre above this object: 6 m across, a strong shake nearby.
        if (!wolfEffect("explosion", llGetPos() + <0, 0, 1>, [ "size", 6, "shake", 0.8 ]))
        {
            llOwnerSay("Effect refused: " + wolfGetLastError());
        }
    }
}

A campfire that burns for half a minute

wolfEffect("fire", llGetPos(), [ "size", 0.8, "duration", 30 ]);

Green and white fireworks 40 m up

wolfEffect("fireworks", llGetPos() + <0, 0, 40>,
           [ "colour", <0.2, 1, 0.3>, "colour2", <1, 1, 1>, "size", 15 ]);

Sparks from a grinder, flying out sideways for 3 seconds

wolfEffect("sparks", llGetPos(), [ "direction", <1, 0, 0.3>, "duration", 3 ]);

Black smoke from a wreck

wolfEffect("smoke", llGetPos(), [ "colour", <0.1, 0.1, 0.1>, "duration", 20, "size", 4 ]);

A quiet explosion that shakes nobody

wolfEffect("explosion", llGetPos(), [ "shake", 0, "sound", FALSE ]);

wolfShakeCamera

Shakes an avatar's view: a rough ride, an earthquake, a hard landing. Only someone the object has a reason to shake: its owner, someone sitting on it or wearing it, or someone standing on land the object's owner controls (owns the parcel, it is deeded to the object's group, or the owner is the estate owner or a manager). NULL_KEY shakes everyone within 96 m of the object who qualifies. Only WolfViewer and WolfStorm users feel it. It counts towards the same limits as wolfEffect. Returns 1 when sent, also when there was nobody to shake or the strength is 0, or 0 with wolfGetLastError saying why.

Example

// In a ride: give whoever sits down a jolt as it sets off.
default
{
    state_entry()
    {
        llSitTarget(<0, 0, 0.5>, ZERO_ROTATION);   // llAvatarOnSitTarget needs a sit target
    }

    changed(integer change)
    {
        if (change & CHANGED_LINK)
        {
            key rider = llAvatarOnSitTarget();
            if (rider != NULL_KEY)
            {
                if (!wolfShakeCamera(rider, 0.7, 1.5))
                    llOwnerSay("Shake refused: " + wolfGetLastError());
            }
        }
    }
}

An earthquake on your own land: everyone within 96 m, gently, for 8 seconds

wolfShakeCamera(NULL_KEY, 0.3, 8.0);

Browse by family

A – Z

By the first letter after the prefix.

A B C D E F G H I J K L M N O P R S T U V W X

This reference is generated from the region software Wolf Territories runs, so it lists what the grid actually implements rather than what a wiki says it should. 181 of them have no written description yet; those say so rather than guessing.