Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

I want prims to change change color when soundloop is on

Eileen McCallister
Registered User
Join date: 13 Aug 2006
Posts: 9
04-05-2007 12:21
I got this nifty script that plays soundloops, menu-driven.
Now I want to the prims to change color when soundloop is on/off.
So the user does not have to guess or listen which prim is on or off.
How do I do that?
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
04-05-2007 12:38
From: Eileen McCallister
I got this nifty script that plays soundloops, menu-driven.
Now I want to the prims to change color when soundloop is on/off.
So the user does not have to guess or listen which prim is on or off.
How do I do that?


|As long as you know how long each sound clip is its just a case of setting the required colour when you start the loop playing, a sleep for the required length of time and then setting the colour back again

CODE

float length = 5.0;
string clip = "my sound clip";
vector off = < 1., 1., 1.>;
vector on = < 1., 0., 0.>;
default
{
state_entry()
{
llSetColor(off, ALL_SIDES);
}

touch_start(integer total_number)
{

llPlaySound(clip, 1.0);
llSetColor(on, ALL_SIDES);
llSleep(length);
llSetColor(off, ALL_SIDES);
}
}
Eileen McCallister
Registered User
Join date: 13 Aug 2006
Posts: 9
04-05-2007 13:48
I'm on it.
Thank you, Newgate :-)