<?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%2FBullet</id>
		<title>User:Allen Kerensky/Myriad Lite Preview 5/Bullet - 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%2FBullet"/>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=User:Allen_Kerensky/Myriad_Lite_Preview_5/Bullet&amp;action=history"/>
		<updated>2026-05-15T08:58:26Z</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/Bullet&amp;diff=27321&amp;oldid=prev</id>
		<title>Allen Kerensky: moved User:Allen Kerensky:Myriad Lite Preview 5:Bullet to User:Allen Kerensky/Myriad Lite Preview 5/Bullet: move into subsite</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=User:Allen_Kerensky/Myriad_Lite_Preview_5/Bullet&amp;diff=27321&amp;oldid=prev"/>
				<updated>2012-02-06T22:33:05Z</updated>
		
		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/wiki/User:Allen_Kerensky:Myriad_Lite_Preview_5:Bullet&quot; class=&quot;mw-redirect&quot; title=&quot;User:Allen Kerensky:Myriad Lite Preview 5:Bullet&quot;&gt;User:Allen Kerensky:Myriad Lite Preview 5:Bullet&lt;/a&gt; to &lt;a href=&quot;/wiki/User:Allen_Kerensky/Myriad_Lite_Preview_5/Bullet&quot; title=&quot;User:Allen Kerensky/Myriad Lite Preview 5/Bullet&quot;&gt;User:Allen Kerensky/Myriad Lite Preview 5/Bullet&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 22:33, 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/Bullet&amp;diff=27194&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/Bullet&amp;diff=27194&amp;oldid=prev"/>
				<updated>2012-02-06T16:53:23Z</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 Bullet =&lt;br /&gt;
&lt;br /&gt;
Because of the skill-based nature of Myriad Lite, simple kinetic bullets are not enough.&lt;br /&gt;
&lt;br /&gt;
Myriad Lite bullets can implement one of multiple damage values.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
# Find a sandbox with Scripts disabled. If scripts run when you create the bullet, it WILL set the bullet physical, temp-on-rez, and run the cleanup timer which causes the bullet to die within 20 seconds&lt;br /&gt;
# Create an object to represent the bullet itself, such as a yellow, glowing, 0.050m sized sphere.&lt;br /&gt;
# While in the script-disabled area, Drag and Drop the bullet script from inventory into the bullet. ?&lt;br /&gt;
# Drop in a &amp;quot;puff of smoke&amp;quot; texture of your choice.&lt;br /&gt;
# Change the texture name in the bullet script.&lt;br /&gt;
# Set the bullet object to &amp;quot;Physical&amp;quot; and &amp;quot;Temp On Rez&amp;quot;&lt;br /&gt;
# Quickly take your bullet into inventory before the temp on rez deletes it.&lt;br /&gt;
&lt;br /&gt;
== Myriad_Lite_Bullet-v0.0.4-20120130.lsl ==&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
//============================================================================&lt;br /&gt;
// Myriad_Lite_Bullet-v0.0.4-20120130.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;
// Davada Gallant (John Girard), WWIIOLers&lt;br /&gt;
// Retrieved 2011-04-30 from http://wiki.secondlife.com/wiki/Bullet&lt;br /&gt;
// Copyright (c) 2009 Linden Research, Inc. Licensed under Creative Commons Attribution-Share Alike 3.0 (CC-BY-SA 3.0)&lt;br /&gt;
// Adapted to OSSL by Allen Kerensky (SL/OSG)&lt;br /&gt;
// Includes Keknehv's Particle Script v1.2&lt;br /&gt;
&lt;br /&gt;
//============================================================================&lt;br /&gt;
// MESSAGE FORMAT REFERENCE&lt;br /&gt;
//============================================================================&lt;br /&gt;
// CHANMYRIAD IN - RPEVENT|str event message&lt;br /&gt;
// CHANPLAYER OUT - DEPRECATED - TOHIT|str attackdice|key who/whatwashit|key bulletowner|str bulletname&lt;br /&gt;
// CHANPLAYER OUT - RANGEDCOMBAT|str attackdice|key who/whatwashit|key bulletowner|str bulletname&lt;br /&gt;
&lt;br /&gt;
//============================================================================&lt;br /&gt;
// Bullet Configuration&lt;br /&gt;
//============================================================================&lt;br /&gt;
string RICOCHET = &amp;quot;nebs_smoke_particle_01&amp;quot;;  // puff-of-smoke texture to show on bullet hits/ricochets - put this texture in bullet prim&lt;br /&gt;
float  BOUYANCY = 1.0;      // how buoyant is the bullet for physics&lt;br /&gt;
float  TIMEOUT  = 20.0;     // control timer to force bullet to die&lt;br /&gt;
&lt;br /&gt;
// Myriad config&lt;br /&gt;
integer MINDAMAGE = 1; // minimum valid damage value for weapon&lt;br /&gt;
integer MAXDAMAGE = 5; // maximum valid damage value for weapon&lt;br /&gt;
integer DAMAGE = 1; // default how much damage do you want this weapon to cause? can be overriden on rez!&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;
&lt;br /&gt;
//============================================================================&lt;br /&gt;
// GLOBAL SETUP()&lt;br /&gt;
//============================================================================&lt;br /&gt;
SETUP(integer type) {&lt;br /&gt;
    if ( llGetStatus(STATUS_PHYSICS) == FALSE ) { // is the bullet a physics object?&lt;br /&gt;
        llSetStatus(STATUS_PHYSICS, TRUE); // if not, make it one&lt;br /&gt;
    }&lt;br /&gt;
    llSetStatus(STATUS_DIE_AT_EDGE, TRUE); // set bullet to die if it crosses a region edge&lt;br /&gt;
    llSetPrimitiveParams([PRIM_TEMP_ON_REZ,TRUE]); // set bullet to be temp-on-rez to cleanup and not count against prim limits&lt;br /&gt;
    llSetBuoyancy(BOUYANCY); // make bullet float so it flies&lt;br /&gt;
    if ( type &amp;gt;= MINDAMAGE &amp;amp;&amp;amp; type &amp;lt;= MAXDAMAGE ) { // is the damage value passed on rez valid?&lt;br /&gt;
        DAMAGE = type; // yes it is, override bullet default&lt;br /&gt;
    }&lt;br /&gt;
    llSetDamage((float)DAMAGE); // set the Linden Lab Combat System damage value to the same as Myriad damage class&lt;br /&gt;
    llSetTimerEvent(TIMEOUT); // start the timeout timer to try to force bullet to die too&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//============================================================================&lt;br /&gt;
// Keknehv's Particle Script v1.2&lt;br /&gt;
//============================================================================&lt;br /&gt;
// Retrieved 2011-04-30 from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryKeknehvParticles&lt;br /&gt;
// 1.0 -- 5/30/05&lt;br /&gt;
// 1.1 -- 6/17/05&lt;br /&gt;
// 1.2 -- 9/22/05 (Forgot PSYS_SRC_MAX_AGE)&lt;br /&gt;
//     This script may be used in anything you choose, including and not limited to commercial products. &lt;br /&gt;
//     Just copy the MakeParticles() function; it will function without any other variables in a different script&lt;br /&gt;
//         ( You can, of course, rename MakeParticles() to something else, such as StartFlames() )&lt;br /&gt;
MAKEPARTICLES(string texture) {&lt;br /&gt;
    if ( texture == &amp;quot;&amp;quot; || texture == NULL_KEY ) { // no texture set, no reason to show particles&lt;br /&gt;
        llParticleSystem([ ]); // shut off any particles that were somehow running&lt;br /&gt;
        return; // exit early since we're not going to show more particles without a texture to show&lt;br /&gt;
    }&lt;br /&gt;
    // This is the function that actually starts the particle system.    &lt;br /&gt;
    llParticleSystem([                   //KPSv1.0  &lt;br /&gt;
    PSYS_PART_FLAGS , 0 //Comment out any of the following masks to deactivate them&lt;br /&gt;
    //| PSYS_PART_BOUNCE_MASK           //Bounce on object's z-axis&lt;br /&gt;
    | PSYS_PART_WIND_MASK             //Particles are moved by wind&lt;br /&gt;
    | PSYS_PART_INTERP_COLOR_MASK       //Colors fade from start to end&lt;br /&gt;
    | PSYS_PART_INTERP_SCALE_MASK       //Scale fades from beginning to end&lt;br /&gt;
    //| PSYS_PART_FOLLOW_SRC_MASK         //Particles follow the emitter&lt;br /&gt;
    //| PSYS_PART_FOLLOW_VELOCITY_MASK    //Particles are created at the velocity of the emitter&lt;br /&gt;
    //| PSYS_PART_TARGET_POS_MASK       //Particles follow the target&lt;br /&gt;
    | PSYS_PART_EMISSIVE_MASK           //Particles are self-lit (glow)&lt;br /&gt;
    //| PSYS_PART_TARGET_LINEAR_MASK    //Undocumented--Sends particles in straight line?&lt;br /&gt;
    //,PSYS_SRC_TARGET_KEY , NULL_KEY,   //Key of the target for the particles to head towards&lt;br /&gt;
    //Choose one of these as a pattern:&lt;br /&gt;
    //PSYS_SRC_PATTERN_DROP                 Particles start at emitter with no velocity&lt;br /&gt;
    //PSYS_SRC_PATTERN_EXPLODE              Particles explode from the emitter&lt;br /&gt;
    //PSYS_SRC_PATTERN_ANGLE                Particles are emitted in a 2-D angle&lt;br /&gt;
    //PSYS_SRC_PATTERN_ANGLE_CONE           Particles are emitted in a 3-D cone&lt;br /&gt;
    //PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY     Particles are emitted everywhere except for a 3-D cone&lt;br /&gt;
    ,PSYS_SRC_PATTERN,           PSYS_SRC_PATTERN_EXPLODE&lt;br /&gt;
    ,PSYS_SRC_TEXTURE,           texture            //UUID of the desired particle texture, or inventory name&lt;br /&gt;
    ,PSYS_SRC_MAX_AGE,           1.0                //Time, in seconds, for particles to be emitted. 0 = forever&lt;br /&gt;
    ,PSYS_PART_MAX_AGE,          5.0                //Lifetime, in seconds, that a particle lasts&lt;br /&gt;
    ,PSYS_SRC_BURST_RATE,        0.02               //How long, in seconds, between each emission&lt;br /&gt;
    ,PSYS_SRC_BURST_PART_COUNT,  1                  //Number of particles per emission&lt;br /&gt;
    ,PSYS_SRC_BURST_RADIUS,      0.01                //Radius of emission&lt;br /&gt;
    ,PSYS_SRC_BURST_SPEED_MIN,   0.01                //Minimum speed of an emitted particle&lt;br /&gt;
    ,PSYS_SRC_BURST_SPEED_MAX,   1.0                //Maximum speed of an emitted particle&lt;br /&gt;
    ,PSYS_SRC_ACCEL,             &amp;lt;0.05,0.05,0.05&amp;gt;     //Acceleration of particles each second&lt;br /&gt;
    ,PSYS_PART_START_COLOR,      &amp;lt;1.0,1.0,1.0&amp;gt;      //Starting RGB color&lt;br /&gt;
    ,PSYS_PART_END_COLOR,        &amp;lt;0.5,0.5,0.5&amp;gt;      //Ending RGB color, if INTERP_COLOR_MASK is on &lt;br /&gt;
    ,PSYS_PART_START_ALPHA,      0.9                //Starting transparency, 1 is opaque, 0 is transparent.&lt;br /&gt;
    ,PSYS_PART_END_ALPHA,        0.0                //Ending transparency&lt;br /&gt;
    ,PSYS_PART_START_SCALE,      &amp;lt;0.5,0.5,0.0&amp;gt;      //Starting particle size&lt;br /&gt;
    ,PSYS_PART_END_SCALE,        &amp;lt;1.0,1.0,0.0&amp;gt;      //Ending particle size, if INTERP_SCALE_MASK is on&lt;br /&gt;
    ,PSYS_SRC_ANGLE_BEGIN,       PI                 //Inner angle for ANGLE patterns&lt;br /&gt;
    ,PSYS_SRC_ANGLE_END,         PI                 //Outer angle for ANGLE patterns&lt;br /&gt;
    ,PSYS_SRC_OMEGA,             &amp;lt;0.0,0.0,0.0&amp;gt;       //Rotation of ANGLE patterns, similar to llTargetOmega()&lt;br /&gt;
    ]);&lt;br /&gt;
}&lt;br /&gt;
//============================================================================&lt;br /&gt;
// GLOBAL DIE()&lt;br /&gt;
// This kludge is to try very hard to force bullets to eventually die on OpenSims.&lt;br /&gt;
// Requested by Lani Global (OSgrid)&lt;br /&gt;
//============================================================================&lt;br /&gt;
DIE() {&lt;br /&gt;
    while ( TRUE == TRUE ) { // this will always be true, forming an infinite loop&lt;br /&gt;
        llDie(); // just keep trying to die, forever... one will eventually work!&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//============================================================================&lt;br /&gt;
// STATE DEFAULT - where the program starts&lt;br /&gt;
//============================================================================&lt;br /&gt;
default {&lt;br /&gt;
    //------------------------------------------------------------------------&lt;br /&gt;
    // STATE_ENTRY - called if bullet rezzed onto the ground&lt;br /&gt;
    //------------------------------------------------------------------------&lt;br /&gt;
    state_entry() {&lt;br /&gt;
        SETUP(DAMAGE); // sets default damage value - may be overridden on rez&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    //------------------------------------------------------------------------&lt;br /&gt;
    // ON_REZ - called when bullet is rezzed by firearm&lt;br /&gt;
    //------------------------------------------------------------------------&lt;br /&gt;
    on_rez(integer start_param) {&lt;br /&gt;
        SETUP(start_param); // pass any start param to setup as a request to set a custom damage value, if valid, it will be used&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    //------------------------------------------------------------------------&lt;br /&gt;
    // COLLISION_START - we just hit an object or avatar&lt;br /&gt;
    //------------------------------------------------------------------------&lt;br /&gt;
    collision_start(integer collisions) {&lt;br /&gt;
        while(collisions--) { // step through each collision event counting down&lt;br /&gt;
            // calculate the dynamic channel of who/what we hit&lt;br /&gt;
            integer dynchan = (integer)(&amp;quot;0x&amp;quot;+llGetSubString((string)llGetOwner(),0,6));&lt;br /&gt;
            // send a ranged combat check to the HUD of the shooter&lt;br /&gt;
            // hitting with a bullet is not an automatic &amp;quot;you hit for damage&amp;quot;&lt;br /&gt;
            // instead it triggers the shooter to make a ranged combat skill check against their victim&lt;br /&gt;
            // if the skill check succeeds, THEN the shot is applied against the victim's armor &lt;br /&gt;
            llRegionSay(dynchan,&amp;quot;RANGEDCOMBAT&amp;quot;+DIV+(string)DAMAGE+DIV+(string)llDetectedKey(collisions)+DIV+(string)llGetOwner()+DIV+llGetObjectName());&lt;br /&gt;
            &lt;br /&gt;
            key who = llDetectedKey(collisions); // get the key of what or who we hit&lt;br /&gt;
            // llGetObjectDetails returns avatar key as &amp;quot;owner&amp;quot; of the avatar itself&lt;br /&gt;
            // so if key of what we hit matches owner's key, we hit an avatar themselves rather than someone's object&lt;br /&gt;
            key owner = llList2Key(llGetObjectDetails(who,[OBJECT_OWNER]),0); // get the owner of the key of what we hit&lt;br /&gt;
&lt;br /&gt;
            if ( who == owner ) { // so, did we hit an actual avatar?&lt;br /&gt;
                // yes, so as a basic anti-cheat, let's announce to the region that someone is being shot at by someone else&lt;br /&gt;
                llRegionSay(CHANMYRIAD,&amp;quot;RPEVENT&amp;quot;+DIV+llKey2Name(llGetOwner())+&amp;quot; shot at &amp;quot;+llDetectedName(collisions)+&amp;quot;!&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        // TODO Shrapnel?&lt;br /&gt;
        // TODO Through and through?&lt;br /&gt;
        MAKEPARTICLES(RICOCHET); // show the bullet impact&lt;br /&gt;
        DIE(); // jump to infinite die loop to cleanup this bullet&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    //------------------------------------------------------------------------&lt;br /&gt;
    // LAND_COLLISION - what to do if bullet hits the ground&lt;br /&gt;
    //------------------------------------------------------------------------&lt;br /&gt;
    land_collision_start( vector collisions) {&lt;br /&gt;
        collisions = &amp;lt;0,0,0&amp;gt;; // LSLINT&lt;br /&gt;
        MAKEPARTICLES(RICOCHET); // show the poof of smoke from the ricochet, movie style&lt;br /&gt;
        DIE(); // jump to the infinite die loop to clean up this bullet&lt;br /&gt;
    }    &lt;br /&gt;
    &lt;br /&gt;
    //------------------------------------------------------------------------&lt;br /&gt;
    // TIMER - trigger bullet to die after a given time, if all else fails&lt;br /&gt;
    //------------------------------------------------------------------------&lt;br /&gt;
    timer() {&lt;br /&gt;
        DIE(); // timer expired, jump to infinite die loop to cleanup this bullet&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
//============================================================================&lt;br /&gt;
// END&lt;br /&gt;
//============================================================================&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>Allen Kerensky</name></author>	</entry>

	</feed>