Elizabeth Rookwood
Registered User
Join date: 31 Oct 2006
Posts: 7
|
04-23-2007 14:35
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-23-2007 14:48
You need the scripting forum. They're a real helpful bunch over there. It's about ten forums down. In the Content Creation section.
Twit Twoo
|
Elizabeth Rookwood
Registered User
Join date: 31 Oct 2006
Posts: 7
|
Silly me...
04-23-2007 15:27
Yup there it is. Thanks...
|
Sylvia Trilling
Flying Tribe
Join date: 2 Oct 2006
Posts: 1,117
|
04-23-2007 15:39
I dropped a tested script that you can adapt into your inventory in game. I wrote a script that changes a texture according to the position of the sun (dilates cat eyes). I have four light states, day, night, low light (beginning of dawn or end of dusk) and medium light for end of dawn or beginning of dusk. Have fun.
|
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
|
04-23-2007 16:04
Also, when posting scripts, it's nice to enclose the script in the PHP tags, . You can do that manually or if you use the enhanced editor it's the  icon. Doing so gives it syntax color coding and with proper copying and pasting preserves the indentation in the script.
_____________________
-
So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.
I can be found on the web by searching for "SuezanneC Baskerville", or go to
http://www.google.com/profiles/suezanne
-
http://lindenlab.tribe.net/ created on 11/19/03.
Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard, Robin, and Ryan
-
|
Elizabeth Rookwood
Registered User
Join date: 31 Oct 2006
Posts: 7
|
Thanks everyone
04-23-2007 16:09
Even if I did post in the wrong forum.
|