I Got It

From Second Life Wiki
Jump to: navigation, search

Created by Kira Komarov based on an idea from Stephen Xootfly.

Introduction

During lectures or talks, it is most helpful if students or listeners are able to provide some sort of feedback. Inspired by an original idea from Stephen Xootfly, comes the implementation of [WaS-K]-[BIO:SE-SX] I Got It!

This device consists of a HUD and a worn object. When you click the HUD, a lightbulb particle appears above your head.

Setup

To create your own, simply put the [WaS-K]-[BIO:SE-SX] I Got It! - HUD script in a HUD and the [WaS-K]-[BIO:SE-SX] I Got It! - Nose script, in a primitive and then attach that primitive to your nose (newer viewers also support Add, so you can have multiple objects on the same attachment point).

Marketplace

The product is also available on the marketplace, full permission and free, of course.

Thanks

Except the mentioned authors, some thanks should go to Jopsy Pendragon from the particle laboratory since the lightbulb emission is based on the smoke particle template.

[WaS-K]-[BIO:SE-SX] I Got It! - HUD

//////////////////////////////////////////////////////////
// [K] Kira Komarov - 2011, License: GPLv3              //
// License at: http://www.gnu.org/licenses/gpl.html     //
//////////////////////////////////////////////////////////
 
key _owner = NULL_KEY;
integer comChannel;
 
default
{
 
    state_entry() {
        _owner = llGetOwner();
        comChannel = ((integer)("0x"+llGetSubString(_owner,-8,-1)) & 0x3FFFFFFF) ^ 0xBFFFFFFF;
    }
 
    touch_start(integer num) {
        llRegionSay(comChannel, "igotit");
    }
 
    changed(integer change) {
        if(change & CHANGED_OWNER)
            _owner = llGetOwner();
    }
    on_rez(integer num) {
        _owner = llGetOwner();
    }
}

[WaS-K]-[BIO:SE-SX] I Got It! - Nose

//////////////////////////////////////////////////////////
// [K] Kira Komarov - 2011, License: GPLv3              //
// License at: http://www.gnu.org/licenses/gpl.html     //
//////////////////////////////////////////////////////////
 
key _owner = NULL_KEY;
 
default
{
 
    state_entry() {
        _owner = llGetOwner();
        integer comChannel = ((integer)("0x"+llGetSubString(_owner,-8,-1)) & 0x3FFFFFFF) ^ 0xBFFFFFFF;
        llListen(comChannel, "", "", "igotit");
    }
 
    listen(integer channel, string name, key id, string message) {
 
        if(llGetOwnerKey(id) != _owner) return;
 
        llParticleSystem([  // start of particle settings
           // Texture Parameters:
           PSYS_SRC_TEXTURE, "b9e24686-abb8-1d3a-e268-0dcb20e74f5c", 
           PSYS_PART_START_SCALE, <0.05, .05, FALSE>, PSYS_PART_END_SCALE, <1.0, 1.0, FALSE>, 
           PSYS_PART_START_COLOR, <1,1,1>,    PSYS_PART_END_COLOR, <1,1,1>, 
           PSYS_PART_START_ALPHA,  (float)1,            PSYS_PART_END_ALPHA, (float)0.1,   
 
           // Production Parameters:
           PSYS_SRC_BURST_PART_COUNT, (integer)1, 
           PSYS_SRC_BURST_RATE, (float) 1,  
           PSYS_PART_MAX_AGE, (float)6.0, 
           PSYS_SRC_MAX_AGE,(float) 0.0,  
 
           // Placement Parameters:
           PSYS_SRC_PATTERN, (integer)8, // 1=DROP, 2=EXPLODE, 4=ANGLE, 8=ANGLE_CONE,
 
           // Placement Parameters (for any non-DROP pattern):
           PSYS_SRC_BURST_SPEED_MIN, (float)0.0,   PSYS_SRC_BURST_SPEED_MAX, (float)0.0, 
           PSYS_SRC_BURST_RADIUS, 0.15,
 
           // Placement Parameters (only for ANGLE & CONE patterns):
           PSYS_SRC_ANGLE_BEGIN, (float) TWO_PI,    PSYS_SRC_ANGLE_END, (float)TWO_PI,  
        // PSYS_SRC_OMEGA, <0,0,0>, 
 
           // After-Effect & Influence Parameters:
           PSYS_SRC_ACCEL, <0.0,0.0, 0.1 >,  
        // PSYS_SRC_TARGET_KEY,      llGetLinkKey(llGetLinkNumber() + 1),       
 
           PSYS_PART_FLAGS, (integer)( 0         // Texture Options:     
                                | PSYS_PART_INTERP_COLOR_MASK   
                                | PSYS_PART_INTERP_SCALE_MASK   
                             // | PSYS_PART_EMISSIVE_MASK   
                                | PSYS_PART_FOLLOW_VELOCITY_MASK
                                                  // After-effect & Influence Options:
                             //   | PSYS_PART_WIND_MASK            
                                | PSYS_PART_BOUNCE_MASK          
                             // | PSYS_PART_FOLLOW_SRC_MASK     
                             // | PSYS_PART_TARGET_POS_MASK     
                             // | PSYS_PART_TARGET_LINEAR_MASK   
                            ) 
            //end of particle settings                     
        ]);
        llSetTimerEvent(1);
    }
 
    timer() {
        llSetTimerEvent(0);
        llParticleSystem([]);
    }
 
    changed(integer change) {
        if(change & CHANGED_OWNER)
            _owner = llGetOwner();
    }
    on_rez(integer num) {
        _owner = llGetOwner();
    }
}