Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Ambient sound triggered by time of day

Elizabeth Rookwood
Registered User
Join date: 31 Oct 2006
Posts: 7
04-23-2007 15:27
I have a script that I was given that plays different sounds day vs. night. I would like to create a third category to play sounds at dusk. I have a general idea how to do it... any help here? The script is below:

list daySounds = ["American Oriole", "Cardinal", "Red-tailed Hawk", "Robin", "Song Sparrow", "Tree Swallow", "Locust"];
list nightSounds = ["Great Horned Owl"];

list nightAmbient = ["Cricket"];

default {
state_entry() {
llStopSound();
llSetTimerEvent(2.0);
}

timer() {
vector time = llGetSunDirection();
list myList;
float density = 0.9;

if (time.z > 0.0) {
myList = llListRandomize(daySounds, 1);
} else {
myList = llListRandomize(nightSounds, 1);
density = 0.98;

// Ambient nighttime sound
if (llFrand(1.0) > 0.85) {
llStopSound();
} else {
llLoopSound(llList2String(nightAmbient, 0), 1.0);
}
}

if (llFrand(1.0) > density) {
llTriggerSound(llList2String(myList, 0), 1.0);
}
}
}
2k Suisei
Registered User
Join date: 9 Nov 2006
Posts: 2,150
04-24-2007 08:11
Hello again!

I noticed somebody in the other forum said that they had sent you a script. Did you manage to modify their script to suit your needs?

If not, I'll modify the above script for you.
Nagual Candour
Registered User
Join date: 19 Jun 2005
Posts: 1
Clock script
05-06-2007 17:02
Hi Suisei,

you sound like you know what you're doing scriptwise, I was wondering if you could help me out too, or point me at a resource that might?

I have an installation called LIGHTIME at Bedos (251, 221, 59)

It's a 4 room piece based around the ideas of "natural" light, time and moving images. The first room is the one I need some scripting help with:

I need a way to control movement according to time of day so that I can make a clock? Doesn't have to update more than about every 15 mins.

Any help really appreciated as this is key to the whole piece.

Many thanks and don't worry if you don't have time :]

Cheers,
Nagual Candour

From: 2k Suisei
Hello again!

I noticed somebody in the other forum said that they had sent you a script. Did you manage to modify their script to suit your needs?

If not, I'll modify the above script for you.