<?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_Dev%2FMyriad_Lite_Narrator-v0.0.9-20120704.lsl</id>
		<title>User:Allen Kerensky/Myriad Lite Dev/Myriad Lite Narrator-v0.0.9-20120704.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_Dev%2FMyriad_Lite_Narrator-v0.0.9-20120704.lsl"/>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=User:Allen_Kerensky/Myriad_Lite_Dev/Myriad_Lite_Narrator-v0.0.9-20120704.lsl&amp;action=history"/>
		<updated>2026-06-13T22:48:24Z</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_Dev/Myriad_Lite_Narrator-v0.0.9-20120704.lsl&amp;diff=30048&amp;oldid=prev</id>
		<title>Allen Kerensky: created</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=User:Allen_Kerensky/Myriad_Lite_Dev/Myriad_Lite_Narrator-v0.0.9-20120704.lsl&amp;diff=30048&amp;oldid=prev"/>
				<updated>2012-07-05T02:53:07Z</updated>
		
		<summary type="html">&lt;p&gt;created&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Myriad_Lite_Narrator-v0.0.9-20120704.lsl =&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;lsl&amp;quot;&amp;gt;&lt;br /&gt;
// Myriad_Lite_Narrator-v0.0.9-20120704.lsl&lt;br /&gt;
// Copyright (c) 2012 By Allen Kerensky (OSG/SL)&lt;br /&gt;
// The Myriad RPG System was designed, written, and illustrated by Ashok Desai&lt;br /&gt;
// Myriad RPG licensed under the Creative Commons Attribution 2.0 UK: England and Wales&lt;br /&gt;
// http://creativecommons.org/licenses/by/2.0/uk/&lt;br /&gt;
// Myriad Lite software Copyright (c) 2011-2012 by Allen Kerensky (OSG/SL)&lt;br /&gt;
// Baroun's Adventure Machine Copyright (c) 2008-2011 by Baroun Tardis (SL)&lt;br /&gt;
// Myriad Lite and Baroun's Adventure Machine licensed under the&lt;br /&gt;
// Creative Commons Attribution-Share Alike-Non-Commercial 3.0 Unported&lt;br /&gt;
// http://creativecommons.org/licenses/by-nc-sa/3.0/&lt;br /&gt;
// You must agree to the terms of this license before making any use of this software.&lt;br /&gt;
// If you do not agree to this license, simply delete these materials.&lt;br /&gt;
// There is no warranty, express or implied, for your use of these materials.&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>