<?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_Preview_5%2FMyriad_Compatible_Trap</id>
		<title>User:Allen Kerensky/Myriad Lite Preview 5/Myriad Compatible Trap - 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_Preview_5%2FMyriad_Compatible_Trap"/>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=User:Allen_Kerensky/Myriad_Lite_Preview_5/Myriad_Compatible_Trap&amp;action=history"/>
		<updated>2026-05-15T11:39:34Z</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_Preview_5/Myriad_Compatible_Trap&amp;diff=27529&amp;oldid=prev</id>
		<title>Allen Kerensky: moved User:Allen Kerensky:Myriad Lite Preview 5:Myriad Compatible Trap to User:Allen Kerensky/Myriad Lite Preview 5/Myriad Compatible Trap: move into subsite</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=User:Allen_Kerensky/Myriad_Lite_Preview_5/Myriad_Compatible_Trap&amp;diff=27529&amp;oldid=prev"/>
				<updated>2012-02-06T23:29:10Z</updated>
		
		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/wiki/User:Allen_Kerensky:Myriad_Lite_Preview_5:Myriad_Compatible_Trap&quot; class=&quot;mw-redirect&quot; title=&quot;User:Allen Kerensky:Myriad Lite Preview 5:Myriad Compatible Trap&quot;&gt;User:Allen Kerensky:Myriad Lite Preview 5:Myriad Compatible Trap&lt;/a&gt; to &lt;a href=&quot;/wiki/User:Allen_Kerensky/Myriad_Lite_Preview_5/Myriad_Compatible_Trap&quot; title=&quot;User:Allen Kerensky/Myriad Lite Preview 5/Myriad Compatible Trap&quot;&gt;User:Allen Kerensky/Myriad Lite Preview 5/Myriad Compatible Trap&lt;/a&gt;: move into subsite&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='1' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='1' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 23:29, 6 February 2012&lt;/td&gt;
			&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Allen Kerensky</name></author>	</entry>

	<entry>
		<id>http://opensimulator.org/index.php?title=User:Allen_Kerensky/Myriad_Lite_Preview_5/Myriad_Compatible_Trap&amp;diff=27206&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_Preview_5/Myriad_Compatible_Trap&amp;diff=27206&amp;oldid=prev"/>
				<updated>2012-02-06T17:54:41Z</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 Compatible Trap =&lt;br /&gt;
&lt;br /&gt;
This Myriad Compatible Trap script, when used in a prim, causes Myriad damage and does other things, if avatar touches or collides with it. &lt;br /&gt;
&lt;br /&gt;
It is normally used by the region owner or builders to add the element of risk to players walking or flying around in a sim RP game environment. &lt;br /&gt;
&lt;br /&gt;
== Instructions ==&lt;br /&gt;
# Choose a location for the trap to exist within your sim/region game environment. &lt;br /&gt;
# Edit a prim to the size and area desired for your trap. &lt;br /&gt;
# In the prim contents, add a sound file you desire to be played when the trap interacts with a player.&lt;br /&gt;
# In the prim contents, add the script: Myriad Compatible Trap v0.5.1c.&lt;br /&gt;
# Edit the script in the prim: &lt;br /&gt;
## change the SOUNDNAME: (default = &amp;quot;zap&amp;quot;) to the exact name of the sound you added. Alternatively, you may rename the sound to &amp;quot;zap&amp;quot;.&lt;br /&gt;
## change the TRAPNAME: (default = &amp;quot;BIG TRAP&amp;quot;) to your desired name for your new trap.&lt;br /&gt;
## change the MYRIADTRAPNAME: (default = &amp;quot;TRAP1&amp;quot;) to your desired Myriad RP Event name for your new trap &lt;br /&gt;
## change the COLLISIONMESSAGE (default = &amp;quot;tried to trap you! &amp;quot;) message directly sent to the avatar at the time of interaction with the trap.&lt;br /&gt;
## change the MYRIADMESSAGE (default = &amp;quot;tried to trap &amp;quot;) message sent via Myriad RP Event&lt;br /&gt;
## change the HOVERTEXT: (default &amp;quot;TRAP&amp;quot;) to your desired warning floating text above your new trap. (no text = &amp;quot; &amp;quot;)  &lt;br /&gt;
## change the HTEXTALPHA alpha of hovertext: (default = 0.5)  (opaque = 1.0) (transparent = 0.0)&lt;br /&gt;
## change the PUSHPOWER vector direction/power  (default = &amp;lt;200,200,200&amp;gt;) to push the avi away at the time of interaction with the trap. &amp;lt;x,y,z&amp;gt;&lt;br /&gt;
# Place the trap in the position desired for interaction with avatars.&lt;br /&gt;
# For full interaction with the trap, the avatar must wear a Myriad compatible HUD and Meter.&lt;br /&gt;
#  Note! The trap will not damage its owner, so please test the trap using an alt avatar, or a volunteer.&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
# To turn any existing object into a trap: Make the trap prim a cylinder or sphere, place it at the same position as the existing object, but make the trap prim slightly larger diameter. Then make the trap prim 100% transparent.&lt;br /&gt;
# The push power should be just enough push in a good direction to cause the avatar to be pushed away when they walk or fly into it. However, it can also orbit the avatar if too much Z axis power is set.&lt;br /&gt;
&lt;br /&gt;
== Myriad_Compatible_Trap-v0.5.4-20120202.lsl ==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
// Myriad_Compatible_Trap-v0.5.4-20120202.lsl&lt;br /&gt;
// Myriad Compatible Trap script (c)2012 LANI GLOBAL SYSTEMS and Allen Kerensky&lt;br /&gt;
// Creative Commons Attribution-Share Alike-Non-Commercial 3.0 Unported&lt;br /&gt;
// This trap causes Myriad damage if avatar touches or collides with it.&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 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;
// Myriad config below this line&lt;br /&gt;
//==========================&lt;br /&gt;
integer MINDAMAGE = 1; // minimum allowed trap damage&lt;br /&gt;
integer MAXDAMAGE = 5; // maximum allowed trap damage&lt;br /&gt;
integer DAMAGE = 2; // default how much damage do you want this weapon to cause? can be overriden on rez!&lt;br /&gt;
string  CHAN_PREFIX = &amp;quot;0x&amp;quot;; // used to convert key to hexadecimal channel number&lt;br /&gt;
string  DIV = &amp;quot;|&amp;quot;; // divider between parts of Myriad API messages&lt;br /&gt;
integer CHANMYRIAD = -999; // channel to send Myriad RP events to&lt;br /&gt;
string  MYRIADTRAPNAME = &amp;quot;TRAP1&amp;quot;; //name of the trap&lt;br /&gt;
string  TOUCHMESSAGE = &amp;quot;do not touch this!&amp;quot;; // touch damage message sent to avi via IM direct&lt;br /&gt;
string  COLLISIONMESSAGE = &amp;quot;tried to trap you!&amp;quot;; //collision damage message sent to avi via IM direct&lt;br /&gt;
string  MYRIADMESSAGE = &amp;quot;tried to trap&amp;quot;; //RP attempted damage message sent via Myriad hud&lt;br /&gt;
string  SOUNDNAME = &amp;quot;zap&amp;quot;; // name of the sound to play when trap springs&lt;br /&gt;
string  HOVERTEXT = &amp;quot;TRAP&amp;quot;; //floating text&lt;br /&gt;
vector  HTEXTCOLOR = &amp;lt;1,0.0,0&amp;gt;; // &amp;lt;R,G,B&amp;gt; color of the hovertext&lt;br /&gt;
float   HTEXTALPHA = 0.5; //alpha level of the hovertext &lt;br /&gt;
vector  PUSHPOWER = &amp;lt;200,200,200&amp;gt;; // vector to push the damaged avi away  &lt;br /&gt;
&lt;br /&gt;
ATTACK(key victim,string victimname,string attackmessage) {&lt;br /&gt;
    llPlaySound(SOUNDNAME, 1.0); // play sound if touched&lt;br /&gt;
    llPushObject(victim,PUSHPOWER, ZERO_VECTOR, FALSE); // push avatar away if touch&lt;br /&gt;
    llInstantMessage(victim,&amp;quot; sorry &amp;quot;+llDetectedName(0)+ &amp;quot;, &amp;quot;+attackmessage); //tell avi something  &lt;br /&gt;
    // calculate the dynamic channel of who/what we hit &lt;br /&gt;
    integer dynchan = (integer)(CHAN_PREFIX+llGetSubString((string)llGetOwner(),0,6)); // owner of trap becomes attacker&lt;br /&gt;
    llRegionSay(dynchan,&amp;quot;CLOSECOMBAT&amp;quot;+DIV+(string)DAMAGE+DIV+(string)victim+DIV+(string)llGetOwner()+DIV+llGetObjectName()); //myriad damage regionsay&lt;br /&gt;
    llRegionSay(CHANMYRIAD,&amp;quot;RPEVENT&amp;quot;+DIV+MYRIADTRAPNAME+&amp;quot; &amp;quot;+MYRIADMESSAGE+&amp;quot; &amp;quot;+victimname+&amp;quot;!&amp;quot;); //myriad rp event regionsay&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default {&lt;br /&gt;
    on_rez(integer rez_damage) { &lt;br /&gt;
        if ( rez_damage &amp;gt;= MINDAMAGE &amp;amp;&amp;amp; rez_damage &amp;lt;= MAXDAMAGE ) {&lt;br /&gt;
            DAMAGE = rez_damage; // allow rez param to override scripted in damage&lt;br /&gt;
        }&lt;br /&gt;
        llSetStatus(STATUS_PHANTOM, TRUE); // toggle phantom status&lt;br /&gt;
        llSleep(0.2); // sleep for a moment to give toggle a chance to settle&lt;br /&gt;
        llSetStatus(STATUS_PHANTOM, FALSE); // make sure trap is not phantom&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    state_entry() {&lt;br /&gt;
        llSetText(HOVERTEXT,HTEXTCOLOR,HTEXTALPHA); // set the hovertext&lt;br /&gt;
        llSetSitText(&amp;quot;--&amp;quot;); // set the sit text&lt;br /&gt;
        llSetTouchText(&amp;quot;BAD&amp;quot;); // set the touch text&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer total_number) {&lt;br /&gt;
        while (total_number--) { // loop through all people who touched, not just first this frame&lt;br /&gt;
            ATTACK(llDetectedKey(total_number),llDetectedName(total_number),TOUCHMESSAGE);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
     collision_start(integer total_number) {&lt;br /&gt;
        while (total_number--) { // loop through all people who touched, not just first this frame&lt;br /&gt;
            ATTACK(llDetectedKey(total_number),llDetectedName(total_number),COLLISIONMESSAGE);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Allen Kerensky</name></author>	</entry>

	</feed>