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

wolfEffect

Wolf Territories
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.

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.

Parameters

TypeName What it does
string effect explosion, fireball, smoke, sparks, fire, fireworks, dust or shockwave.
vector pos Where, in region coordinates (metres).
list rules Key/value pairs, any order, may be empty for the defaults. Every key is in the table below. At most 16 pairs.

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

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 ]);
Energy 10

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

More in Wolf Territories