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

Wolf Territories functions

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

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).

list wolfAttachInfo() Wolf Territories

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.

Remove a named hitch point from this object.

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.

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.

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.

integer wolfDetach() Wolf Territories

Uncouple this object and forget its wolfAttach request.

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.

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.

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.

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

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

Remove a marker ("" removes them all).

Close the page opened by wolfGameShowWeb.

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 "".

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

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.

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

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.

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.

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.

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.

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

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

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.

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.

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.

list wolfGameGet() Wolf Territories

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

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

A value stored with wolfGameSetData, or "".

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

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

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

Give game currency to a player.

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

Remove a bar shown with wolfGameShowStat.

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

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

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

How many of an item the player holds.

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

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

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.

string wolfGameKey() Wolf Territories

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

Kill the player now.

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

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.

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

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

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

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.

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

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.

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

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

Let the pet go: its record is deleted.

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

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

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

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

list wolfGamePlayers() Wolf Territories

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

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

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.

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

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

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

Remove a pet type no pet still has.

Remove a stat from a pet type.

Remove a stat from this region's game.

Every stat back to its start value.

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

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

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.

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.

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.

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

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

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

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.

Show a level and XP bar on the player's screen.

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

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

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

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

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

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

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.

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.

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

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

list wolfGameStats() Wolf Territories

The names of this region's game stats.

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

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

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.

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

integer wolfGameUnregister() Wolf Territories

Stop running a game on this region.

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

string wolfGetLastError() Wolf Territories

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

list wolfGetRegionWeather() Wolf Territories

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

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).

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.

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.