<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://opensimulator.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://opensimulator.org/index.php?action=history&amp;feed=atom&amp;title=User%3AAllen_Kerensky%2FMyriad_Lite%2FMyriad_Lite_Narrator-Preview6.lsl</id>
		<title>User:Allen Kerensky/Myriad Lite/Myriad Lite Narrator-Preview6.lsl - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://opensimulator.org/index.php?action=history&amp;feed=atom&amp;title=User%3AAllen_Kerensky%2FMyriad_Lite%2FMyriad_Lite_Narrator-Preview6.lsl"/>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=User:Allen_Kerensky/Myriad_Lite/Myriad_Lite_Narrator-Preview6.lsl&amp;action=history"/>
		<updated>2026-06-13T20:09:06Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.9</generator>

	<entry>
		<id>http://opensimulator.org/index.php?title=User:Allen_Kerensky/Myriad_Lite/Myriad_Lite_Narrator-Preview6.lsl&amp;diff=30378&amp;oldid=prev</id>
		<title>Allen Kerensky: Myriad_Lite_Narrator-Preview6.lsl</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=User:Allen_Kerensky/Myriad_Lite/Myriad_Lite_Narrator-Preview6.lsl&amp;diff=30378&amp;oldid=prev"/>
				<updated>2012-08-12T15:56:08Z</updated>
		
		<summary type="html">&lt;p&gt;Myriad_Lite_Narrator-Preview6.lsl&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Myriad_Lite_Narrator-Preview6.lsl =&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;lsl&amp;quot;&amp;gt;&lt;br /&gt;
// Myriad_Lite_Narrator-Preview6.lsl&lt;br /&gt;
// Copyright (c) 2012 by Allen Kerensky (OSG/SL) All Rights Reserved.&lt;br /&gt;
// This work is dual-licensed under&lt;br /&gt;
// Creative Commons Attribution (CC BY) 3.0 Unported&lt;br /&gt;
// http://creativecommons.org/licenses/by/3.0/&lt;br /&gt;
// - or -&lt;br /&gt;
// Modified BSD License (3-clause)&lt;br /&gt;
// Redistribution and use in source and binary forms, with or without&lt;br /&gt;
// modification, are permitted provided that the following conditions are met:&lt;br /&gt;
// * Redistributions of source code must retain the above copyright notice, &lt;br /&gt;
//   this list of conditions and the following disclaimer.&lt;br /&gt;
// * Redistributions in binary form must reproduce the above copyright notice,&lt;br /&gt;
//   this list of conditions and the following disclaimer in the documentation&lt;br /&gt;
//   and/or other materials provided with the distribution.&lt;br /&gt;
// * Neither the name of Myriad Lite nor the names of its contributors may be&lt;br /&gt;
//   used to endorse or promote products derived from this software without&lt;br /&gt;
//   specific prior written permission.&lt;br /&gt;
//&lt;br /&gt;
// THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR&lt;br /&gt;
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES&lt;br /&gt;
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN&lt;br /&gt;
// NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,&lt;br /&gt;
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT&lt;br /&gt;
// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,&lt;br /&gt;
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY&lt;br /&gt;
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT&lt;br /&gt;
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF&lt;br /&gt;
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.&lt;br /&gt;
//&lt;br /&gt;
// The Myriad RPG System was designed, written, and illustrated by Ashok Desai&lt;br /&gt;
// Myriad RPG System licensed under:&lt;br /&gt;
// Creative Commons Attribution (CC BY) 2.0 UK: England and Wales&lt;br /&gt;
// http://creativecommons.org/licenses/by/2.0/uk/&lt;br /&gt;
&lt;br /&gt;
string  VERSION = &amp;quot;0.0.9&amp;quot;; // version number&lt;br /&gt;
string  VERDATE = &amp;quot;20120704&amp;quot;; // version date&lt;br /&gt;
&lt;br /&gt;
// GLOBALS - CUSTOMIZE THESE IN SETUP() FUNCTION&lt;br /&gt;
string MESSAGE; // the description&lt;br /&gt;
integer BECOME_PHANTOM; // become phantom, such as an area detect, or stay non-phantom such as when used in floor prim?&lt;br /&gt;
integer IGNORE_OBJECTS; // do not send narration to objects (like bullets!) which blunder in&lt;br /&gt;
integer RPEVENT_FLAG; // send as Myriad Lite RP event, or as play Say into local chat? HINT - make secrets just for HUD users and public tour stuff for everyone&lt;br /&gt;
&lt;br /&gt;
// GLOBAL RUNTIME variables which change as the script runs&lt;br /&gt;
list agents; // list of UUIDs active in sim&lt;br /&gt;
key agent_key; // key of who we're narrating to&lt;br /&gt;
integer dynachan; // temporary place to calculate the player dynamic channel&lt;br /&gt;
&lt;br /&gt;
// MYRIAD LITE MESSAGE REFERENCE&lt;br /&gt;
// CHANPLAYER - OUT - RPEVENT|narrationtext&lt;br /&gt;
&lt;br /&gt;
integer CHAN_REGION = -999;&lt;br /&gt;
integer HAND_RUMOR;&lt;br /&gt;
integer CHAN_RUMOR;&lt;br /&gt;
string  API_RUMOR_FIND = &amp;quot;RUMOR_SERVER_FIND&amp;quot;;&lt;br /&gt;
string  API_RUMOR_FOUND = &amp;quot;RUMOR_SERVER_FOUND&amp;quot;;&lt;br /&gt;
string  API_RUMOR_PUT = &amp;quot;RUMOR_PUT&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
integer FLAG_DEBUG;&lt;br /&gt;
string CHAN_PREFIX          = &amp;quot;0x&amp;quot;; // channel prefix for calculating dynamic channel numbers&lt;br /&gt;
string API_DIVIDER          = &amp;quot;|&amp;quot;; // The field divider within BAM messages&lt;br /&gt;
string  RUMOR_VISITED; // sent as rumor suffix&lt;br /&gt;
&lt;br /&gt;
//============================================================================&lt;br /&gt;
// DEBUG&lt;br /&gt;
//============================================================================&lt;br /&gt;
DEBUG(string debugmsg) {&lt;br /&gt;
    if ( FLAG_DEBUG == TRUE ) llInstantMessage(llGetOwnerKey(llGetKey()),&amp;quot;DEBUG: &amp;quot;+debugmsg);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//============================================================================&lt;br /&gt;
// DEFAULT STATE&lt;br /&gt;
//============================================================================&lt;br /&gt;
default {&lt;br /&gt;
    //------------------------------------------------------------------------&lt;br /&gt;
    // COLLISION_START EVENT&lt;br /&gt;
    //------------------------------------------------------------------------    &lt;br /&gt;
    collision_start(integer detected) {        &lt;br /&gt;
        while ( detected-- ) {&lt;br /&gt;
            agent_key = llDetectedKey(detected); // who hit us?&lt;br /&gt;
            if ( IGNORE_OBJECTS == TRUE &amp;amp;&amp;amp; llGetOwnerKey(agent_key) != agent_key ) return; // ignoring objects&lt;br /&gt;
            if ( llListFindList(agents,[agent_key]) == -1 ) { // does this key already appear in agents list?&lt;br /&gt;
                if ( llGetFreeMemory() &amp;lt;= 256 ) { // is memory low?&lt;br /&gt;
                    agents = []; // free some memory by emptying agents list&lt;br /&gt;
                }&lt;br /&gt;
                agents = [agent_key] + agents; // add this agent&lt;br /&gt;
                if ( RPEVENT_FLAG == TRUE ) { // say as Myriad Lite RP event, or plain local chat say?&lt;br /&gt;
                    dynachan = (integer)(&amp;quot;0x&amp;quot;+llGetSubString(agent_key,0,6)); // calculate avatar's dynamic HUD channel&lt;br /&gt;
                    llSay(dynachan,&amp;quot;RPEVENT|&amp;quot;+MESSAGE); // send them the narration as an RP event&lt;br /&gt;
                } else {&lt;br /&gt;
                    llSay(PUBLIC_CHANNEL,MESSAGE); // say to anyone, HUD or not&lt;br /&gt;
                }&lt;br /&gt;
                // Send a rumor that the player progressed in the quest&lt;br /&gt;
                if ( CHAN_RUMOR != 0 ) {&lt;br /&gt;
                    string who = llKey2Name(agent_key);&lt;br /&gt;
                    string rumor = API_RUMOR_PUT+API_DIVIDER+who+API_DIVIDER+who+RUMOR_VISITED;&lt;br /&gt;
                    llRegionSay(CHAN_RUMOR,rumor);&lt;br /&gt;
                }                &lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //------------------------------------------------------------------------&lt;br /&gt;
    // LISTEN EVENT&lt;br /&gt;
    //------------------------------------------------------------------------&lt;br /&gt;
    listen(integer channel,string name,key id,string message) {&lt;br /&gt;
        channel = 0; // LSLINT&lt;br /&gt;
        name = &amp;quot;&amp;quot;; // LSLINT        &lt;br /&gt;
        // Rumor server found, save its channel number&lt;br /&gt;
        if ( message == API_RUMOR_FOUND ) {&lt;br /&gt;
            CHAN_RUMOR = (integer)(CHAN_PREFIX + llGetSubString((string)id,0,6));&lt;br /&gt;
            return;&lt;br /&gt;
        }        &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    //------------------------------------------------------------------------&lt;br /&gt;
    // ON_REZ EVENT&lt;br /&gt;
    //------------------------------------------------------------------------&lt;br /&gt;
    on_rez(integer params) {&lt;br /&gt;
        params = 0; // LSLINT&lt;br /&gt;
        llResetScript(); // on rez, reset the script from the top&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //------------------------------------------------------------------------&lt;br /&gt;
    // STATE_ENTRY EVENT&lt;br /&gt;
    //------------------------------------------------------------------------&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        // EDIT ME TO SAY The SHORT NAME and LONG DESCRIPTION of this area&lt;br /&gt;
        // Be sure to mention what is seen to the north, east, south, west, above, below, and any RP clues for this area&lt;br /&gt;
        MESSAGE = &amp;quot;(Myriad Lite Central Example BAM Area) An example of the Myriad Lite implementation of Baroun's Adventure Machine (BAM) for implementing roleplaying quests. Wear a Myriad Lite HUD with BAM Module, and click the BAM Adventure Giver NPC. To the east is the Myriad_Future example region. To the north is the tabletop roleplaying area with Myriad_Modern example region beyond it. To the northwest is the example combat and healing area. To the west is the Myriad Lite character builder area and Myriad_Medieval region beyond it. To the south is the Myriad Combat region.&amp;quot;;&lt;br /&gt;
        // EDIT ME TO SAY a rumor that the person visited this area&lt;br /&gt;
        RUMOR_VISITED=&amp;quot; visited the Myriad_Central example BAM area.&amp;quot;;&lt;br /&gt;
        // DONE EDITING&lt;br /&gt;
        BECOME_PHANTOM = TRUE; // become phantom, such as an area detect, or stay non-phantom such as when used in floor prim?&lt;br /&gt;
        IGNORE_OBJECTS = TRUE; // do not send narration to objects (like bullets!) which blunder in&lt;br /&gt;
        RPEVENT_FLAG = TRUE; // send as Myriad Lite RP event, or as play Say into local chat? HINT - make secrets just for HUD users and         &lt;br /&gt;
        agents = []; // start with an empty list of who we've shown the narration to&lt;br /&gt;
        if ( BECOME_PHANTOM == TRUE ) { //if we're not in a floor prim&lt;br /&gt;
            llVolumeDetect(TRUE); // set us up to detect collisions with the prim volume&lt;br /&gt;
        } else {&lt;br /&gt;
            llVolumeDetect(FALSE); // only detect collisions when run into, rather than through&lt;br /&gt;
        }&lt;br /&gt;
        if ( HAND_RUMOR != 0 ) llListenRemove(HAND_RUMOR);&lt;br /&gt;
        CHAN_RUMOR = (integer)(CHAN_PREFIX + llGetSubString((string)llGetKey(),0,6));&lt;br /&gt;
        HAND_RUMOR = llListen(CHAN_RUMOR,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        llRegionSay(CHAN_REGION,API_RUMOR_FIND); // send request for rumor server channel&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Allen Kerensky</name></author>	</entry>

	</feed>