Original creations in Second Life by Oggy Fink.

Tuesday, October 18, 2011

Touch and Glow

Halloween is coming people ! Why not make some creeeeepy objects glow and play scary sounds ?

The following script is able to do just that. Adjust the parameters (written in bold in the script) to match your taste, put it into your prim and you're going !

Some explanations about settings are given as comments in the script, they should be quite easy to follow. If not, feel free to ask for more, either by commenting this post or by sending me an email : oggy.fink(at)gmail.com...


// Touch & Glow by Oggy Fink
// Use this script to make your prim glow when it's touched and play a
// (probably creepy) sound.
// See the parameters below.
// This script is free and full perm, but don't sell it as is. Using it
// into your creations (and selling them) is fine.

string sound="ee186da7-36c5-082a-f6ab-613cc33d3444";    // set this to the
    // name or UUID of the sound to play, or "" to disable sound
float volume=1.0;   // volume for the sound, between 0 (silent) and 1 (full
    // volume)
float maxglow=1.0;  // maximum amount of glow when active (between 0 and 1)

integer steps=25;   // number of steps for the glow. More means smoother and
    // longer transition
float stepdelay=0.1;    // time (in seconds) between each step. More means
    // longer.
float sustainglow=0.0;  // time to remain at full glow

// here are the face numbers that will receive the glow. You can add more but
// you will have to modify the rules (see below)
// you can also set one face to ALL_SIDES
integer facea=1;    // number of first face
integer faceb=3;    // number of second face
// could have used a list and a loop, but efficiency was the priority...

default {
    touch_start(integer total_number) {
        integer i;
        llPlaySound(sound,volume);
        for (i=1;i<=steps;i++) {
// modify the following line if you want to add or remove one face. Just copy
// the PRIM_GLOW,facenumber,i*maxglow/steps for each face
            llSetLinkPrimitiveParamsFast(LINK_SET,[PRIM_GLOW,facea,
                i*maxglow/steps,PRIM_GLOW,faceb,i*maxglow/steps]);
            llSleep(stepdelay);
        }
        if (sustainglow>0.0) llSleep(sustainglow);
        for (i=steps-1;i>=0;i--) {
// same modifications expected here
            llSetLinkPrimitiveParamsFast(LINK_SET,[PRIM_GLOW,facea,
                i*maxglow/steps,PRIM_GLOW,faceb,i*maxglow/steps]);
            llSleep(stepdelay);
        }
    }
}

The following simple script will help you determine a face number. Just put it into your prim and it will tell you which face is touched. Use the number in the Touch&Glow script to achieve exactly the desired effect. This script is called - trumpets, play ! - "Detectface" :)
// This script will tell which face was touched.

default {
    touch_start(integer total_number) {
        llSay(PUBLIC_CHANNEL,"Touched face #"+((string)llDetectedTouchFace(0)));
    }
}
All this is downloadable for free at my marketplace store. Comments, constructive criticism, (good) ratings and donations are welcome :)

Sunday, October 16, 2011

Photo projector 1.0

A new creation is available at Oggy's scripted items : a (nice) photo projector. You can use it whenever you want to display your photographic memories, or to decorate a nice club, or to show off some of your items in your shop...

The displaying of photos is done randomly with an adjustable delay, and switching between two photos is done with a nice crossfade effect. The number of photos you can put into it is virtually unlimited.

This projector has a number of features, among which :
  • A control menu that allows a user (if allowed) to switch the projector on or off, and access to the administrator menu
  • An administrator menu which allows you to adjust the screen size (up to 64 x 64m) and ratio (eg 4/3, 16/9...), the lightbeam length (up to 50m), the beam colors (9 customizable colors and one color-cycling mode)
  • A configuration notecard to set numerous options, like :
    • user policy (open, allow, ban), allowed or banned users,
    • allowed administrators,
    • time each photo lasts on screen,
    • how fast and smooth the crossfade effect is when switching photos,
    • the custom colors for the light beam,
    • how often the lightbeam changes color when in color cycle mode,
    • how fast and smooth the color transition is,
    • default sizes for the screen and the beam.
The projector is copiable and modifiable, the scripts are only copiable. Feel free to ask for enhancements and new features, i'm open to all suggestions and constructive criticism : oggy.fink@gmail.com or send a notecard in world.