Introduction

Glow.

Glow is a digital Second Life companion that follows you around and supports module addons to extend the basic movement functionality. Compared to other pets, Glow has the ability to follow the avatar around as well as crossing simulators while following the avatar.

Video

Version History

1 June 2013

  • Added the "calculate" command. You can have Glow calculate expressions. For example, by saying: Glow evaluate 2^2+2*ln(17) on the local chat. This plugin was designed using the Wizardry and Steamworks Shunting Yard Calculator.
  • Added the "vanish" command to make Glow disappear.
  • Changed the beacon script to toggle rezzing Glow on and off.

17 October 2012

  • Inga bugfix for state transition nova→order.

October 2012

  • Initial Release.

Exports

Setup

  1. Put Glow and the Glow Beacon script in any attachment that you are wearing (can be a necklace, bracelet, glasses, etc…)
  2. Right-click the attachment and select Tools→Reset Scripts in Selection….
  3. After 30 seconds, Glow should appear and you can issue commands on the main chat.

Features

  • [CORE] Free wandering based on wanderer while following the avatar.
  • [CORE] Uses the jumpdrive crossdrive technology to teleport across great distances in the current simulator.
  • [CORE] Using the WSAD keys to move Glow around.
  • [PLUGIN] Attack mode, using artillery, in which Glow hurls projectile at a named avatar.
  • [PLUGIN] Evaluates mathematical expressions using the expression calculator.

Command Reference

Module Syntax Description Example
CORE Glow free Lets Glow roam freely. Glow free
CORE Glow stay Makes Glow stay at her current location. Glow stay
CORE Glow move Asks for control permissions and then allows you to move Glow using the WSAD keys. Glow move
PLUGIN nova <Avatar Username> Hurls the [K] Plugin:Nova - Bomb object at the named avatar (usernames must be supplied, not display names). Glow nova Morgan LeFay
PLUGIN evaluate <expression> Evaluates expressions. Glow evaluate 2^sin(10)

Automata

Glow automaton.

Glow transits between several states, the state order being the primary state that processes all command line parameters. A plugin uses a default state and a state named after the plugin name. The communication between the core and the plugins is done via link messages.

Plugin Protocol

Writing plugins for Glow does not require altering the core. All commands that are not to be found in the core, will be sent as a link message to the current object where, hopefully some plugin will pick the command up. If no command is registered (registering a command just implies adding the plugin in the Glow object and listening for a keyword), then after $1+(1-\text{Time Dilation})$ seconds, Glow commutes back to the wander state.

The meaning of $1+(1-\text{Time Dilation})$ seconds is one second plus the amount of lag currently experienced by the simulator (the actual scale is reversed, where 1 represents a simulator with no lag and any value in the range $[0,1)$ represents a lagging simulator). This gives the plugin a chance to answer back and turn the core off if it so wishes.

Protocol Overview

    core
   |state   |time              |time
   |        |                  |
   |        |     Command      |
   |     +------+   CSV    +--------+
 state   | CORE |--------->| PLUGIN |
 wander  +------+          +--------+
   |        |                  | 1 + (1-Time Dilation) seconds
   |        |  glow:MAIN:HALT  |
   |        |<-----------------+
 state      |                  |
 order      |                  | plugin executes...
   |        |  glow:MAIN:CONT  |
 state      |<-----------------+
 wander     |                  | plugin goes to default state
   |        |                  |
   |        |                  |

Protocol Description

  • Whenever a command is issued, preceded by the keyword Glow, Glow commutes to the order state and does pattern matching to determine the command. If the command is not amongst the core modules, then the entire chat line is sent as a CSV to the current object.
    • A plugin in the current object has $1+(1-\text{Time Dilation})$ seconds to give the response glow:MAIN:HALT to Glow. If that time is exceeded, Glow goes back to the wander state.
    • After the plugin has finished execution, if the plugin has previously sent the glow:MAIN:HALT response to Glow, then upon termination the plugin has to send glow:MAIN:CONT to Glow.
  • For the core in state order, if either the $1+(1-\text{Time Dilation})$ seconds time has been exceeded, or the glow:MAIN:CONT message has been received, Glow commutes to the state wander.

LSL Glow Plugin Template

The template below creates a dummy plugin called sample_plugin. It is advisable to keep the PLUGIN START REGION and PLUGIN END REGION symmetrical in terms of initialization and cleanup. More descriptively, suppose that a plugin wants to turn physics off. It can do so in the sample_plugin state in the state_entry event handler. However, it must remember to turn them back on in the PLUGIN END REGION before the plugin commutes to the default state.

For example, the Nova plugin involves rotating Glow to face an avatar, however upon termination, the script uses llSetRot(llEuler2Rot(<0,90,0> * DEG_TO_RAD)); to rotate the object back to its initial position. Otherwise, Glow's rotation will be displaced by the last angle induced by the llLookAt function.

// AUTHOR AND COPYRIGHT
// Name: sample_plugin
// Description: ...
 
list cmd = [];
 
default {
    link_message(integer sender_num, integer num, string str, key id) {
        cmd = llCSV2List(str);
        if(llList2String(cmd,1) != "sample_plugin") return;
        llMessageLinked(LINK_THIS, 0, "glow:MAIN:HALT", NULL_KEY);
        state sample_plugin;
    }
}
 
state sample_plugin {
    state_entry() {
        // PLUGIN START REGION
    }
    link_message(integer sender_num, integer num, string str, key id) {
        if(str != "glow:PLUG:HALT") return;
        // PLUGIN END REGION
        llMessageLinked(LINK_THIS, 0, "glow:MAIN:CONT", NULL_KEY);
        state default;
    }
    // ...
}

Index


secondlife/glow.txt · Last modified: 2022/11/24 07:46 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.