Change font size
It is currently Tue May 26, 2020 12:53 pm

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 8 of 8   [ 76 posts ]
Go to page Previous  1 ... 4, 5, 6, 7, 8
Author Message
 Post subject: COUNT DOWN TIMER V 1.6 (Major Update now! )
PostPosted: Tue Nov 01, 2016 3:39 pm 
Furious Typer
User avatar

Joined: Sun Oct 18, 2015 4:09 am
Posts: 86
A COUNT DOWN TIMER FOR OPENSIM AND SECONDLIFE ------MAJOR UPDATE ---- VERSION 1.6 NOW

In this new version, I found one redundant variable and removed it. Also removed some inefficiencies, thanks to my kindest mentor. You can now turn the hover text off too.

Rez two Prims. Link, Paste the script into the root prim.
Touch to operate the Device. As usual kindly no commercial usage.

You can turn the ticking sound to off by changing the "integer sound_on" option to FALSE .
Fixed a bug and added a new Hour:Min:Sec output format as per the request of another friend.



{L_CODE}:

/*
COUNTDOWN TIMER SCRIPT V 1.6 BY Renoobed Radical for OSGrid, dated 1st Nov 2016.
Get the latest update of this script here :
http://forums.osgrid.org/viewtopic.php?f=5&t=5544&start=70

All my scripts are free and strictly for educational, non-commercial and non-profit purpose only.
You can find many of my scripts in my OSGrid Forum thread below:
http://forums.osgrid.org/viewtopic.php?f=5&t=5544
Kindly NO commercial usage. Thank you.

Instruction: Rez two prims and link. Then use this script in the root prim.
----------------------------------------------------------------------------
How to use the Timer:
Touch the device. Select the duration of the timer from the menu. you can set a custom time too.
Watch the chat output and hover text. They are self explanatory.
That's all.
----------------------------------------------------------------------------
If you want a silent timer, set sound_on parameter to FALSE;
*/

integer sound_on = TRUE; //  TRUE or FALSE , Set FALSE to make it silent.
integer hoverTextOn = TRUE; // Set to FALSE to turn off Hover text

string tick_sound = "07fdf7ee-c931-4d6c-87c2-eae12643e255"; // OSGRID UUID
string alarm_end_sound = "2a783921-bf64-4a7c-9aff-5f6a0b47777a"; //OSGRID UUID

float menu_timeout = 20; // how long to wait for user input

integer custom_listen_channel = 123456789;


float time;
integer channel;
integer listen_handle;
list menu;
key toucher;

setText( string t, vector col){llSetText(t, col,1);}
say(string s){ llSay(0,s);}
ppf(float f){llSetLinkPrimitiveParamsFast(2,[PRIM_SIZE,<0.15,0.15,f>]);}
pppf( integer kid, list temp) { llSetLinkPrimitiveParamsFast(kid, temp);}
string twofigures(integer x){if(x<10)return "0"+(string)x;return (string)x;}

setup()
{
    pppf(LINK_SET,[PRIM_TEXTURE, ALL_SIDES, TEXTURE_BLANK, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 0.0]);
    pppf(LINK_THIS,[PRIM_NAME,"Count down Timer  Script v 1.6",PRIM_SIZE,<1.0000,0.5000,0.5000>,PRIM_TYPE,5,48,<0.000000, 1.000000, 0.000000>,0.990000,<0.000000, 0.000000, 0.000000>,<1.000000, 0.350000, 0.000000>,<0.000000, 0.000000, 0.000000>,<0.460000, 0.760000, 0.000000>,<0.000000, 0.000000, 0.000000>,1.000000,0.000000,0.000000, PRIM_COLOR,-1,<1,1,1>,0.5 ]);
    pppf(2,[PRIM_NAME, "Written by Renoobed Radical" ,PRIM_POS_LOCAL,<-0.5,0.0000,0.0000>,PRIM_ROT_LOCAL,<-0.70,0.000,-0.70,0.000>,PRIM_SIZE,<0.1500,0.1500,2.0000>,PRIM_TYPE,1,48,<0.000000, 1.000000, 0.000000>,0.199960,<0.000000, 0.000000, 0.000000>,<1.000000, 1.000000, 0.000000>,<0.000000, 0.000000, 0.000000>,PRIM_SLICE,<0.5000,1.0000,0.0000>]);
    llSetStatus(STATUS_PHANTOM,1);
    if(!hoverTextOn) llSetText("",<1,1,1>,1);
}

colorize( vector col){ llSetLinkColor(2,col,-1);}

float tall = 2;
float length;
float diff;

suspend(){ llSetTimerEvent(0); llListenControl(listen_handle, 0 ); }


default
{
    state_entry()
    {
        setup();
        channel= -(integer)llFrand (20000.0)-(integer)llFrand(2000000000.0);
        say ("channel set to " + (string)channel);
        state ready;
    }
}

state ready
{
    state_entry()
    {       
        menu = ["600", "360", "300"] + menu;
        menu = ["240", "180", "120"] + menu;
        menu = ["60", "45", "30"] + menu;
        menu = ["15", "10", "custom"] + menu ;
       
        if(hoverTextOn)setText("Set \nthe duration \nof \nthe Count Down timer \nin seconds format!", <1,1,0.2>);
               
        listen_handle = llListen( channel, "","","");
        llListenControl(listen_handle, 0 );
        colorize(<1,1,1>);
        length = tall;
        ppf( tall);   
    }
   
    on_rez(integer r){ llResetScript(); }
   
    touch_start( integer t)
    {
        toucher = llDetectedKey(0);
        if(hoverTextOn)setText("Awaiting input \nfrom \n"+ llKey2Name(toucher) +" !", <1,0.1,0.1> );
        llListenControl(listen_handle, 1 );
        llDialog(toucher, "Set the Time now (in seconds format)", menu ,channel);
        llSetTimerEvent(menu_timeout);
    }
   
    listen(integer c, string n, key k, string m)
    {
         if("custom" == m)
         {
             suspend();
             state custom_time;
         }
         else
         {
            time =  (float) m;
            if(hoverTextOn)setText((string) ((integer)time), <1,.7,.7>);
            say("count down timer set to "+  m + " sec");
            suspend();
            state countDown;
        }
    }
   
    timer()
    {
        suspend();
        say("Operation cancelled due to inactive user! Please try again!");
        if(hoverTextOn)setText("Set \nthe duration \nof \nthe Count Down timer \nin seconds format!", <1,1,0.2>);   
    }
}

state custom_time
{
    state_entry()
    {
        llListen(custom_listen_channel, "",toucher, "");
        llTextBox(toucher,"Type your custom time", custom_listen_channel);
        llSetTimerEvent(menu_timeout);
        if(hoverTextOn)setText("Awaiting input \nfrom \n"+ llKey2Name(toucher) +" !", <1,0.1,0.1> );
    }
   
    on_rez(integer r){ llResetScript();}
   
    listen(integer c, string n, key k, string m)
    {
        time = (integer)( llStringTrim(m, 0X03));
        say("Your time has been set to " + (string)((integer)time));
        llSetTimerEvent(0);
        state countDown;
    }
   
    timer()
    {
        menu = [];
        llSetTimerEvent(0);
        say("No input from the user! Operation cancelled");
        state ready;
    }
}
   

state countDown
{
    state_entry()
    {
       diff = length/time;
       colorize(<1,1,0>);
       llSetTimerEvent(1);
    }
   
    on_rez(integer r){ llResetScript();}
   
    timer()
    {
        if( sound_on){llTriggerSound(tick_sound,1);}
       
        --time;
       
        length -= diff;
        ppf(length);     
       
        if( time < 10)
        {
           colorize(<1,0,0>);
        }
       
        if(time <=0)
        {
            if( sound_on ){llTriggerSound(alarm_end_sound,1);}
            time = 0;
            llSetTimerEvent(0);
            say("Timer Stopped! ");
            menu = [];
                   
            state ready;
        }
//      if(hoverTextOn)setText("Time left \n"+ (string) ((integer)time) + "\n sec", <1,0,0>); // Use this  if you want the output only in seconds format

        integer min=(integer)(time/60);
        integer hour=min/60;
        min-=60*hour;
        integer sec = (integer)time % 60;
               
        if(hoverTextOn)setText("Time Left\nH  :   M  :   S \n    "+ twofigures(hour)+"    "+twofigures(min)+"    "+twofigures(sec)+ "    ", <1,0,0.5>);
    }
}



Attachments:
Count Down Timer Photo.png
Count Down Timer Photo.png [ 270.88 KiB | Viewed 11397 times ]

_________________
"The size of your audience doesn't matter. Keep up the good work."
Link to my free scripts and tutorials.
http://forums.osgrid.org/viewtopic.php?f=5&t=5544&start=0
I'll be happy if you find anything useful. Thank you.
Top
 Profile  
 
 Post subject: Re: MY EXPERIMENT WITH OPENSIM AND SOME OF MY FREE SCRIPTS
PostPosted: Thu May 25, 2017 11:39 am 

Joined: Thu May 25, 2017 11:18 am
Posts: 1
Regarding the Clock script.

Thanks for this clock script. Works perfectly.

I wanted to make a Grandfather Clock for my Freebie booth in SL. I have Jeff Heaton's book & Fred - Ferd's Outworldz script pages all in hand, and struggle mightily with what seems a serious lack of documentation how to make the pieces work together. In fact, I will still be looking at much of this to make these pieces work, having a build space filled with broken half working pieces of previous attempted clock-works.

Happily, I found this video demo using this script, and after re-editing it, and following video, bingo I have a working clock. My happiness cannot be fully expressed here.

Truth be told, I currently barely understand how this script does it's magic, and further customizing a clock from this script is all but impossible for me at the moment. What is the relationship between the clock face, and clock hands prims. If I want to customize the clock face, or the hands of clock, for instance, seems unlikely at the moment? Perhaps is possible, perhaps not so much.

If I get a handle on what the script is actually doing, I could make an educated guess. Either way this script leads me down the path I try to follow now. Will try some trial-and-error surgery on script and see what happens. I understand, in theory, the "running" piece of the clock, but how it is rezzed exactly, with the mystery texture, this is all but a magic trick for me.

Again, thanks. I was very frustrated with first attempts, and now have a beautiful Grandfather Clock as a freebie I can offer, while I continue to figure out what makes this clock really tick.

Be well.


Top
 Profile  
 
 Post subject: Re: MY EXPERIMENT WITH OPENSIM AND SOME OF MY FREE SCRIPTS
PostPosted: Sat May 27, 2017 12:13 pm 
Furious Typer
User avatar

Joined: Sun Oct 18, 2015 4:09 am
Posts: 86
Eros Celestalis {L_WROTE}:
Regarding the Clock script.
Thanks for this clock script. Works perfectly......

Thanks a lot for letting me know that you've got a working script. That really made me happy.

In each and every post I try my level best to save a user from any frustration. I test several times, both in OsGrid and in my local standalone, prior to posting anything on the forum thread. So all my scripts should work 100%, out of the box, for anyone who has a fairly good copy-paste skill.
Opensim is my/our passion, our love. :-)

Eros Celestalis {L_WROTE}:
..........Again, thanks. I was very frustrated with first attempts, and now have a beautiful Grandfather Clock as a freebie I can offer, while I continue to figure out what makes this clock really tick.
Be well.


I've got the most amazing mentor/ scripting guru in my "life" by the grace of God and hence, I emphasize on the human readability of the script/code ( for my own future reference too) as much as possible. Your this post inspires me to write a basic scripting tutorial, an introduction to LSL in "my own way".
It might take some time since currently I am acquiring some sound engineering skill ( beside my rigorous RL profession) so that I can build a completely free sound library specially meant for our beloved Opensim.

Last but not the least, thank you really so much once again for your long and inspiring post. It truly touched my heart.
Wish you a wonderful virtual/real life.
Best regards.

_________________
"The size of your audience doesn't matter. Keep up the good work."
Link to my free scripts and tutorials.
http://forums.osgrid.org/viewtopic.php?f=5&t=5544&start=0
I'll be happy if you find anything useful. Thank you.


Top
 Profile  
 
 Post subject: Particle Trail Script for Opensimulator - Get your trail
PostPosted: Wed Sep 06, 2017 9:39 am 
Furious Typer
User avatar

Joined: Sun Oct 18, 2015 4:09 am
Posts: 86
Some magical fun with ribbon Particles.
Rez a prim.
Create a new script.
Paste this script there.
Save it.
Now wear the prim and move around, run or fly and see the trail follows you.

Watch the video below:
https://www.youtube.com/watch?v=sAzuMiBRbdE


{L_CODE}:

/*
Particle Trail maker Script ( Experimental )
Wear it and walk,run or fly.
-------------------------
Original script lesson by Takni
Posted and tested in Opensimulator by Renoobed Radical
This script is strictly for educational, non profit and non-commercial purpose only.
Kindly do not sell it under any circumstances. 
*/
float size=0.25;
float startglow=0.25;
float endglow=.05;
float alpha=0.8;
float burstrate=0.1;
float AGE = 30; // seconds
integer mask;
startparticles()
{
vector startcolor;
vector endcolor;
        startcolor=<1.00000, .5, 0.00000>*llAxisAngle2Rot(<1,1,1>,
7*TWO_PI/ 0xffffff* (integer) (     "0x"+ llGetSubString(llGetOwner(),0,5)));
        endcolor=startcolor/2*llAxisAngle2Rot(<1,1,1>,1);
        llLinkParticleSystem(LINK_THIS,
        [           
                PSYS_SRC_PATTERN,PSYS_SRC_PATTERN_ANGLE,
                PSYS_SRC_BURST_RADIUS,0.000,
                PSYS_SRC_ANGLE_BEGIN,PI/2,
                PSYS_SRC_ANGLE_END,PI/2, 
                PSYS_PART_START_COLOR,startcolor,
                PSYS_PART_END_COLOR,endcolor,
                PSYS_PART_START_ALPHA,alpha,
                PSYS_PART_END_ALPHA,alpha,
                PSYS_PART_START_GLOW,startglow,
                PSYS_PART_END_GLOW,endglow,
                PSYS_PART_BLEND_FUNC_SOURCE,7,
                PSYS_PART_BLEND_FUNC_DEST,9,

                PSYS_PART_START_SCALE,<size, 1.00000, 0.00000>,
                PSYS_PART_END_SCALE,<0,0,0>,
                PSYS_SRC_TEXTURE,"5748decc-f629-461c-9a36-a35a221fe21f",

                PSYS_SRC_MAX_AGE,0,
                PSYS_PART_MAX_AGE,AGE,
                PSYS_SRC_BURST_RATE,burstrate,
                PSYS_SRC_BURST_PART_COUNT,1,
                PSYS_SRC_ACCEL,<0.00000, 0.00000, 0.00000>,
                PSYS_SRC_OMEGA,<0.00000, 0.00000, 0.00000>,
                PSYS_SRC_BURST_SPEED_MIN,.03,
                PSYS_SRC_BURST_SPEED_MAX,.03,
    PSYS_PART_FLAGS,
            PSYS_PART_EMISSIVE_MASK |
                PSYS_PART_RIBBON_MASK |
                PSYS_PART_INTERP_COLOR_MASK |
                PSYS_PART_INTERP_SCALE_MASK |
                 0
        ]);
   

}
integer particleson;
stopparticles()
{
    llParticleSystem([]);
}
default
{
    on_rez(integer x)
    {
        llSetAlpha(1-llGetAttached(),-1);   
        llResetScript();
    }
   
    timer()
    {
        llSetTimerEvent(3);
        if(mask&llGetAgentInfo(llGetOwner()))
        {
            if(!particleson){startparticles();  particleson=6;}
        }
        else
        {
            if(particleson)particleson--; else stopparticles();               
        }
    }
    state_entry() 
    {
        llSetObjectName("Particle Trail maker v1.0");
         
        mask=        (AGENT_IN_AIR|AGENT_WALKING)    ;
        llSetTimerEvent(0.5);
        if(mask&llGetAgentInfo(llGetOwner())){startparticles();    particleson=6;}
    }
}



Attachments:
Particle Trail Script in action in Opensimulator.jpg
Particle Trail Script in action in Opensimulator.jpg [ 114.89 KiB | Viewed 6950 times ]

_________________
"The size of your audience doesn't matter. Keep up the good work."
Link to my free scripts and tutorials.
http://forums.osgrid.org/viewtopic.php?f=5&t=5544&start=0
I'll be happy if you find anything useful. Thank you.
Top
 Profile  
 
 Post subject: Apply diffuse, normal and specular maps on a prim instantly
PostPosted: Fri May 15, 2020 2:40 pm 
Furious Typer
User avatar

Joined: Sun Oct 18, 2015 4:09 am
Posts: 86
I baked the textures in Blender 2.82 and applied on a cube. I liked the result.
So I am sharing the textures in case anyone wants to experiment.
Instruction: Put the Script into a cube prim . This will set the textures automatically.

{L_CODE}:
//------Script Starts Here ---------\\
// Put the Script into a cube prim . This will set the textures automatically. //

string tex1 = "8f919678-5c4d-4d7c-b1ac-4fc5a175d5d0"; // diffuse
string tex2 = "52a72ddd-16a9-470c-b57d-ef7dbc655786"; // normal
string tex3 = "04af9df1-8d90-4c1a-a991-ac48fc78f437"; // specular

ppf(string t1, string t2, string t3){llSetLinkPrimitiveParams(LINK_THIS, [
PRIM_TEXTURE, -1, t1, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 0.0,
PRIM_LINK_TARGET, LINK_THIS, PRIM_NORMAL,-1, t2, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 0.0,
PRIM_LINK_TARGET, LINK_THIS, PRIM_SPECULAR,-1, t3, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, 0.0, <1,1,1>, 128, 51,
PRIM_LINK_TARGET, LINK_THIS, PRIM_MATERIAL, PRIM_MATERIAL_STONE
]);
}

default{state_entry(){ppf(tex1, tex2, tex3); llRemoveInventory(llGetScriptName()); }}

//----------------------Script Ends Here --------\\


Attachments:
floor project in blend.jpg
floor project in blend.jpg [ 40.43 KiB | Viewed 134 times ]
Material Testing in OSG1s.jpg
Material Testing in OSG1s.jpg [ 69.32 KiB | Viewed 134 times ]
Material Testing in OSG 2s.jpg
Material Testing in OSG 2s.jpg [ 69.46 KiB | Viewed 134 times ]

_________________
"The size of your audience doesn't matter. Keep up the good work."
Link to my free scripts and tutorials.
http://forums.osgrid.org/viewtopic.php?f=5&t=5544&start=0
I'll be happy if you find anything useful. Thank you.
Top
 Profile  
 
 Post subject: CIRCULAR STAIR REZZER SCRIPT
PostPosted: Sat May 16, 2020 1:25 pm 
Furious Typer
User avatar

Joined: Sun Oct 18, 2015 4:09 am
Posts: 86
CIRCULAR STAIR REZZER SCRIPT EXPERIMENT
This script creates automatic circular staircase with a click on the pillar. It stays rezzed for some time then auto deletes itself.
The pillar size can be adjusted as per your need.
As usual, kindly no commercial usage.

https://www.youtube.com/watch?v=LwGxIxODbcI


Here are the steps:
1. (a) Rez a box prim. It will be the step of the staircase (b) Create a new script inside it. (c) Paste the "step script" into the new script. (d) Save it. (e) Right click on the step prim and take it . This will be in your inventory now.
{L_CODE}:
// Step Script  by Renoobed Radical
integer communication_channel = -8888;
default
{
    state_entry()
    {
        llSetObjectName("step");  llSetScale(<0.5, 7.5, 0.2>);
        llListen( communication_channel,"","","");  llSay(0, "Script running");
    }
   
    on_rez(integer r){llSetTimerEvent( r);}
   
    timer(){ llDie();}
   
    listen( integer c, string name, key k, string m)
    {
        if( "die" == m){ llDie();}
    }
}


2. (a) Rez a cylinder. This will be the pillar around which the steps will be rezzed. (b) Create a new script inside it. (c) Copy and Paste the "Circular step rezzer script" into it. (d) Save it.
{L_CODE}:
//Circular Staircase Rezzer Script by Renoobed Radical

integer communication_channel = -8888;
integer on;
colorize(vector c){llSetColor(c,-1);}

default{
    state_entry(){llSetScale(<1.5, 1.5, 10>);}
    touch_start(integer t) {}   
    touch_end(integer x){
        if(on=on^1){
            colorize(<1,0,0>);
            integer steps = 80;           
            vector cylinder_height = llGetScale();
            float poll_height =  cylinder_height.z-0.5 ;           
            float gap = poll_height/(steps-1);           
            float current_height = -poll_height/2;           
            rotation rot;
            rotation turn = llAxisAngle2Rot(<0,0,1>,TWO_PI/steps);
                   
            integer i;
            while(i< steps){
                i++;
                current_height+=gap;
           
                llRezAtRoot(llGetInventoryName( INVENTORY_OBJECT,0)
                    ,llGetPos()+<0,-3.2,current_height>*rot
                    ,llGetVel()
                    ,rot
                    ,30
                );
               rot*=turn;
            }
            colorize(<1,1,1>);
        }
        else{
            colorize(<1,1,1>);
            llShout(communication_channel,"die");
        }
    }
}


3. (a) Drag the "step" prim from your inventory into the content of the Pillar prim.

CHECKPOINT:
So there are two items in the content of the Pillar prim. (i) The "Circular step rezzer script" and "step" prim.


Now touch the Pillar and all the steps will be rezzed automatically.


Attachments:
step1.jpg
step1.jpg [ 174.02 KiB | Viewed 120 times ]
step2.jpg
step2.jpg [ 136.64 KiB | Viewed 120 times ]
Circular_stair_rezzer.jpg
Circular_stair_rezzer.jpg [ 56.81 KiB | Viewed 120 times ]

_________________
"The size of your audience doesn't matter. Keep up the good work."
Link to my free scripts and tutorials.
http://forums.osgrid.org/viewtopic.php?f=5&t=5544&start=0
I'll be happy if you find anything useful. Thank you.
Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 8 of 8   [ 76 posts ]
Go to page Previous  1 ... 4, 5, 6, 7, 8


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net