Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Multiple value on click script

Rickel Petion
Registered User
Join date: 6 Jan 2006
Posts: 58
07-24-2006 13:37
So I'm a total noob when it comes to scripting, I wanted to make a script that when the prim containing it was clicked, changed between several different Alpha values.
You got it, an on touch window tinter, I've been searching for almost an hour how to do this but I haven't found any examples so I'm asking here..

I have four different tints on the windows, I want the script to change the tint every time it is clicked, and when it comes to the last tint it goes back to the first etc.

Anyone who could give me an example on how to do this would be thanked most humbly.
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
07-24-2006 14:02
From: Rickel Petion
I have four different tints on the windows, I want the script to change the tint every time it is clicked, and when it comes to the last tint it goes back to the first etc.

CODE

list tint_values = [ 1.0, 0.75, 0.5, 0.25 ];
integer tint_idx = 0;

default {

touch_start( integer ContactsTotal ) {

llSetAlpha( llList2Float( tint_values, tint_idx ), ALL_SIDES );
++tint_idx;
if( tint_idx >= llGetListLength( tint_values ) ) tint_idx = 0;
}
}

This is as bare-bones as it goes, but that's the gist of it ^^;
Rickel Petion
Registered User
Join date: 6 Jan 2006
Posts: 58
07-24-2006 14:11
From: Joannah Cramer

This is as bare-bones as it goes, but that's the gist of it ^^;


Thank you so much *smiles* now I just have to figure what each part of it does ;) otherwise I learn nothing from it.
Joannah Cramer
Registered User
Join date: 12 Apr 2006
Posts: 1,539
07-24-2006 14:18
Ack, sorry ^^;;

http://secondlife.com/badgeo/wakka.php?wakka=HomePage <-- LSL Wiki is a very good place to check for some basic introduction of all elements of SL script language, how these elements come together and what functions you can use to manipulate things around you.
Rickel Petion
Registered User
Join date: 6 Jan 2006
Posts: 58
07-24-2006 15:09
From: Joannah Cramer
Ack, sorry ^^;;

http://secondlife.com/badgeo/wakka.php?wakka=HomePage <-- LSL Wiki is a very good place to check for some basic introduction of all elements of SL script language, how these elements come together and what functions you can use to manipulate things around you.



Oh Much appreciated, thank you. Will have to look into this.