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.

Start the story battle with that id for the avatar's party. adventure "" = the only adventure the avatar plays on this region. The outcome arrives as a battle|av|adv|battle|won or lost event (wolfAdventureListen). The adventure's owner's scripts, a god's, or its trusted scripts.

[adventure, session, party, act, scene, beat, objective] for the adventure the avatar plays on this region, or [] when none.

Bind this object as the adventure's chest with that id on this region (TRUE), or unbind it (FALSE): the story gives inventory rewards and rezzes props from it. The object's owner must be the adventure's owner; everything in it (but scripts) must be copyable.

The story character with that id joins the avatar's party as a companion (TRUE) or leaves it (FALSE). adventure "" = the only adventure the avatar plays on this region. Heard as companion|av|adv|character|joined or left. The adventure's owner's scripts, a god's, or its trusted scripts.

Fire a script trigger of a Wolf Adventure on the avatar's party's current beat. adventure "" = the only adventure the avatar plays on this region; data (at most 240 bytes) is kept with the event in the session log. TRUE when the trigger existed and fired. The adventure's owner's scripts, a god's, or the adventure's trusted scripts.

A Wolf Adventure flag's value as text ("1"/"0" for a yes/no flag) for that avatar - player, party or world scope. Only flags marked scriptRead; "" and wolfGetLastError() otherwise.

Move the avatar's party to the story box with that id, as a story step would. adventure "" = the only adventure the avatar plays on this region. TRUE when the story took the step. The adventure's owner's scripts, a god's, or the adventure's trusted scripts.

list wolfAdventureInfo() Wolf Territories

[adventure, title, revision, ...] (stride 3) for every Wolf Adventure enabled on this region. No web call.

Story events to this object as chat on the channel (from the adventure's title and key): start|av|adv|party, beat|av|adv|act|scene|beat, choose|av|adv|decision|option, flag|av|adv|flag|value, reward|av|adv|parcel, end|av|adv|ending, leave|av|adv, signal|av|adv|name|data, battle|av|adv|battle|won or lost, companion|av|adv|character|joined or left. 0 stops. Heard by the adventure owner's scripts, its trusted scripts and the region holder's; a worn object hears only its wearer's events.

Inside a look pad's touch_start: the toucher gives the pad's story character their look (as clicking the pad does). The region writes this call into the pad's own script when the pad is placed; outside a touch event it is refused.

TRUE when the avatar is in a session of a Wolf Adventure enabled on this region. No web call.

Give the avatar the story reward with that id. adventure "" = the only adventure the avatar plays on this region. TRUE when given. The adventure's owner's scripts, a god's, or its trusted scripts.

The story character with that id says the text (at most 1000 bytes) on this region. Name the adventure. TRUE when said. The adventure's owner's scripts, a god's, or its trusted scripts.

Set a Wolf Adventure flag marked scriptWrite: "1"/"0"/"true"/"false" for a yes/no flag, a whole number for a counter, text up to the flag's length. TRUE when set; the story's flag triggers run.

The adventure's owner names a script in this object (by its asset - an edited copy is not) as one of the adventure's own (TRUE) or takes that back (FALSE). Its own scripts get the larger request budget and hear its events.

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.

From a worn script (a HUD or an attachment): its wearer breathes WOLF_BREATH_FIRE or WOLF_BREATH_ICE for `seconds` (0.5 to 20; 0 = 3), or WOLF_BREATH_STOP stops a breath. The stream comes from the object the script is in when it is worn on the body, else from the wearer's attachment with "[wolfBreath]" in its description (a WolfAvatars dragon's breath object, worn at the mouth); every viewer sees it, with a sound. In the region's game, players in the breath (WOLF_BREATH_REACH metres from WOLF_BREATH_ORIGIN along the wearer's facing) lose health (ice also slows them) when the wearer is playing too; never on safe land, never anyone not playing. A 4 s rest after each breath. options: [WOLF_BREATH_ORIGIN, vector, WOLF_BREATH_REACH, float]. Returns 1, or 0 with wolfGetLastError saying why. Defined on Wolf_Api.wolfBreath / WolfBreath.

Calls the Wolf plugin function `name` with `args` and returns its answer as a list. Returns an empty list with wolfGetLastError saying why when there is no such plugin function on this region, the plugin refused, ran too long or failed. Defined on Wolf_Api.wolfCall / IWolfPluginCalls.

Like wolfCall, but the answer comes later as dataserver(query, data), where query is the key this returns. For plugin functions that take time (out-of-process services are always asynchronous). Returns NULL_KEY with wolfGetLastError saying why when refused (no dataserver event then). Defined on Wolf_Api.wolfCallAsync / IWolfPluginCalls.

Breaks the build this script is in into its separate prims in one go (like llBreakAllLinks, no script in every prim), lets them fall as temporary physical rubble with an optional outward blast (force in m/s at blast_centre, region coordinates; 0 = they just fall), and after restore_after seconds (10 to 3600) removes the rubble and puts the build back exactly as it was (its scripts start again from state_entry). Needs PERMISSION_CHANGE_LINKS from the owner; every prim must be copy and modify and every item in it copy for the owner; the owner must be allowed to build there. At most 128 pieces fall (the rest stay where they are), started over a few seconds. A build made of one mesh only topples as one piece. Returns 1, or 0 with wolfGetLastError saying why. Defined on Wolf_Api.wolfCollapse / WolfWreck.

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, the stage braking now), dsc_speed (km/h, downhill speed control's set speed), cruise, drive_time (seconds), odo (km), warnings ("engine,oil,abs,retarder..."), 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; bits 19+ the truck retarder: stalk = (buttons >> WOLF_DRIVE_RETARDER_SHIFT) & WOLF_DRIVE_RETARDER_MASK, WOLF_DRIVE_BTN_RETARDER_DSC / _AUT / _DSC_UP / _DSC_DOWN), age in seconds] - always exactly 7 items. 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.

The Wolf Environment document of this region (WOLF_ENV_REGION) or of the parcel this object is over (WOLF_ENV_PARCEL), as JSON (read it with llJsonGetValue), or "" when there is none. "" with wolfGetLastError set when it could not be read.

Remove the region's or this parcel's Wolf Environment: the region goes back to its own sky, the parcel to the region's. Same owner rights as wolfEnvironmentSet. Returns "" when done (also when there was none), otherwise the reason.

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.

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.

The country the avatar `agent` (root or child presence in this region) is connected from, as an upper-case ISO 3166-1 alpha-2 code ("GB", "DE") from the region's local IP-to-country database - never the address. "" for a non-avatar key, an NPC, a region without the database, an avatar on a WolfStorm proxy host, or an address with no country in the database (wolfGetLastError says which). Defined on Wolf_Api.wolfGetAgentCountry / WolfGeoCountry.

A fingerprint of the address the avatar `agent` (root or child presence in this region) is connected from: 32 lowercase hex characters, HMAC-SHA256 under a grid secret of "wolf-iphash-v1\n" + the script owner's UUID + "\n" + the address. The same for the same address in all of this owner's objects on every region; unrelated to any other owner's values; never the address. "" for a non-avatar key, an NPC or a region without the secret (wolfGetLastError says which). Defined on Wolf_Api.AgentIPHash.

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.

Controls the WolfNPC this script is in (a resident's own NPC made with the WolfNPC window: a WolfAvatars body brought to life by the region). command is one of AI, BEHAVIOUR, WANDER, GOTO, FOLLOW, SAY, ANIM, ANIM_LOOP, ANIM_STOP, SOUND, HOME, STOP, PAUSE, NAME, SPECIES, TAG, TAGS, PACK, LEADER, GROUP, INDOORS, SHY, VISITORS, SPEED, HUNTABLE, HEALTH, RESPAWN, HUNT, SIGHT, DAMAGE, ATTACK_COOLDOWN, GIVE_UP, CHASE_SPEED, JOB, ROUTINE, PLACE, SIT, VOICE, DAILY_LIMIT, NPC_TALK, WHEN, UNWHEN, DRIVE, ROUTE, PARK, EXIT, PASSENGER; value is its setting as text, e.g. wolfNPC("AI", "I am a wolf who likes to bite people...") or wolfNPC("WHEN", "near|name:Luke Coda|10|anim:dance;sound:luke tune;once=visit"). AI talk and voice use the NPC owner's Wolf Credits. Only works from a script inside the NPC. Returns 1, or 0 with wolfGetLastError saying why. Defined on Wolf_Api.wolfNPC / WolfNPCModule.

Reads the WolfNPC this script is in: "STATE" (intention|awake or asleep|alive or dead|health/max), "CFG" (its settings as JSON) or "INTENT" (what it is doing now). Returns "" with wolfGetLastError saying why when it cannot. Defined on Wolf_Api.wolfNPCInfo / WolfNPCModule.

integer wolfRestoreBoat() Wolf Territories

Raises the boat this script is in, sunk (or still sinking) by wolfSink, back to exactly where and how it was before: position, rotation, physics and particles; any timed restore, return or delete is cancelled. The owner must still be allowed to build where it was. Returns 1, or 0 with wolfGetLastError saying why. Defined on Wolf_Api.wolfRestoreBoat / WolfWreck.

From a script in any piece of a build brought down by wolfCollapse: put the build back now, exactly as it was. Returns 1, or 0 with wolfGetLastError saying why. Defined on Wolf_Api.wolfRestoreBuilding / WolfWreck.

Roll a Wolf viewer's camera about its line of sight: degrees -180..180 (+ right, - left), seconds 0..30 to get there; it stays rolled until the next call, 0 levels it. NULL_KEY: everyone within 96 m on land the object's owner controls. Same avatars and limits as wolfShakeCamera. 1 when sent (or nobody to roll), 0 when refused.

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.

Sinks the boat this script is in: it floods and lists, goes down bow first (WOLF_SINK_BOW), stern first (WOLF_SINK_STERN) or on an even keel (WOLF_SINK_LEVEL) over `seconds` (5 to 120; 0 = 20) and settles on the seabed. Everyone sitting on it is stood up and left floating at the surface. Then, `after_seconds` (10 to 3600) later: WOLF_SINK_STAY (stays a wreck until wolfRestoreBoat), WOLF_SINK_RESTORE (back afloat as it was), WOLF_SINK_RETURN (back to the owner's inventory) or WOLF_SINK_DELETE (gone). effects: WOLF_SINK_BUBBLES and/or WOLF_SINK_DEBRIS particles. It must be over water and the owner allowed to build there. Returns 1, or 0 with wolfGetLastError saying why. Defined on Wolf_Api.wolfSink / WolfWreck.

enable TRUE marks this object (the one the script is in) as a visitor vehicle: while an avatar is seated on it, a region it crosses into judges parcel entry as if that avatar owned it (bans on the avatar, the owner's estate ban, scripts and auto-return still apply; an empty vehicle crosses by the usual rules). Only an object whose owner is the estate owner or an estate manager of the region it is in may be marked. The mark lasts over crossings and restarts, and is lost when the object changes owner or is copied or taken. FALSE takes the mark off. Returns 1, or 0 with wolfGetLastError saying why. Defined on Wolf_Api.wolfVisitorObject / WolfVisitorVehicle.