help with bird sounds
|
|
Poppytat Sodwind
Registered User
Join date: 29 Nov 2006
Posts: 52
|
10-16-2007 06:12
.
|
|
Nika Talaj
now you see her ...
Join date: 2 Jan 2007
Posts: 5,449
|
10-16-2007 07:48
Sorry, I don't quite understand. Is the script you post above the one on which you are getting the errors, or the original script you started from?
If the latter, please post the script that is getting the errors.
And, when you say that you get errors when you remove the owl etc.., do you mean when you remove the owl sound from the prim the script is in, or when you removed the pieces of code referring to the owl? Again, if the latter, please post the actual script getting the errors.
Thanks.
_____________________
.  To contact forum folks, join the inworld group "The Forum Cartel". New residents with questions about SL more than welcome! We has parties!  To contact forum scripters, join the inworld group "Scriptoratti" (thanks Void!). New scripter questions welcome!
|
|
Poppytat Sodwind
Registered User
Join date: 29 Nov 2006
Posts: 52
|
10-16-2007 22:06
.
|
|
Noctua Janus
Registered User
Join date: 22 Mar 2007
Posts: 29
|
10-17-2007 01:40
I'm offline, but I guess this should trigger bird sounds only during daytime : From: Poppytat Sodwind list daySounds = ["American Oriole", "Cardinal", "Red-tailed Hawk", "Robin", "Song Sparrow", "Tree Swallow", "Locust"]; 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 { llStopSound(); // silence, all birds asleep density = 1.1; // prevent triggering during nighttime } if (llFrand(1.0) > density) { llTriggerSound(llList2String(myList, 0), 1.0); } } } In regards to overlapping sounds: I'm not sure if a prim can play more than one sound..currently the script decides if it wants to play a new sound (if llFrand..) every 2 seconds, so if the playtime of your sounds is longer they should be overlapping sometimes (also they only have a 10% chance of playing, you might want to set density to 0.0 for testing purposes). If a prim is noct capable of more than one sound you would need multiple prims to achieve this effect. As I said before, I'm currently not in SL so I can't test this 
|
|
Jana Kamachi
Registered User
Join date: 19 Apr 2007
Posts: 111
|
10-17-2007 01:46
Sound instances are created by location. can't have two sounds playing at once in the >exact< same position.
|
|
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
|
10-17-2007 02:15
I created an ambient sound generator with 10 bird sounds by day, and a cricket loop at night. I get overlap by rezzing multiple copies placed randomly around my lot. If you want to get multiple sounds out of the same object, you can have multiple scripts running in a singular multi-prim object. I just recently moved the ticking of a clock from the main script to a child prim, and I can hear the ticking while the clock is chiming no problem.
|
|
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
|
10-17-2007 02:16
Jana: I can prove you wrong there. // Note: llStopSound() is only needed when looping sounds. // Since we are just triggering bird sounds here, it is not needed. // The script below will play random sounds during daytime. // // Note: If you provide UUID keys for the sounds you will not have to put // the sounds into the object. Therefore that should be your preferred // method of action.
// Place the UUID keys of the sounds you want played in this list:
list Sounds = []; vector Sun; integer Pos;
default { on_rez(integer X) {llResetScript();}
state_entry() { llSetTimerEvent(1.0); }
timer() { Sun = llGetSunDirection(); if (Sun.z > 0) // Only when the sun is above the horizon... { Pos = llGetListLength(Sounds); if (Pos > 0) { Pos = llFloor(llFrand(Pos)); // Pick a random sound to play... llTriggerSound(llList2String(Sounds,Pos),1.0); // and play it. llSetTimerEvent(llFrand(10.0)); // Set random timer for next sound } else { llOwnerSay("Zere iz no Zoundz in ze lizt!"); } } else { llSetTimerEvent(180.0); // During nighttime reduce the timer events... } } }
|
|
Jana Kamachi
Registered User
Join date: 19 Apr 2007
Posts: 111
|
10-17-2007 02:21
Quote "Sounds played with llPlaySound and llLoopSound (and the master/slave versions of these functions) "stick" to the object playing the sound. That is, if a long sound is started with llPlaySound, and then the object moves away, the sound will grow fainter. Compare this to llTriggerSound and llTriggerSoundLimited where the sound stays at the location it was first played."
I was under the impression that llTriggerSound was a positional triggers, not relative to the object.
|
|
Nika Talaj
now you see her ...
Join date: 2 Jan 2007
Posts: 5,449
|
10-17-2007 09:54
From: Poppytat Sodwind didnt i say that the script is the original script i am using?
why does what i ask sound so difficult? is it my english? even though i am from the uk...lol
ok, i have placed the script (this script, the one i have added here) into an object and edited it by removing the "American Oriole", "Cardinal", "Red-tailed Hawk", "Robin", "Song Sparrow", "Tree Swallow", "Locust" and replaced these with my sound file names, (oh...and placed my sounds in the object too!!) this object is new...and up until me placing anything in it, it was empty! i did say in my OP i was editing a script and not an object!)
i DONT want to add the the owl or cricket sounds, i DONT want them to play, therefore i haven't added the SOUNDS to the OBJECT. i have tried to remove the part of the script which mentions the owl and the cricket and this is when i get errors!! this is when i undo the editing i have done and return the script back to how it was when it worked...
i see no reason to post the script i have edited and using when it works with my sounds and all i want to do is remove the owl and cricket sounds....which are not used...the sounds are not even in the object.
i hope this has about covered it...i didnt think that my OP was that difficult to understand! maybe it is just me...lol You've gotten some great tips here on overlapping ... hope you've resolved the rest of your issues. If you want help getting rid of specific errors in a script, you'll have to post it, or at least say specifically which errors you're getting (i.e. the error text), which you also seem reluctant to share. If you intend to charge for the script, I understand your reluctance to post it. Your insulting tone is less easy to understand; possibly I simply fail to comprehend the thoughts of an intelligence so vastly superior to my own.
_____________________
.  To contact forum folks, join the inworld group "The Forum Cartel". New residents with questions about SL more than welcome! We has parties!  To contact forum scripters, join the inworld group "Scriptoratti" (thanks Void!). New scripter questions welcome!
|
|
Poppytat Sodwind
Registered User
Join date: 29 Nov 2006
Posts: 52
|
10-20-2007 15:31
From: Squirrel Wood Jana: I can prove you wrong there. // Note: llStopSound() is only needed when looping sounds. // Since we are just triggering bird sounds here, it is not needed. // The script below will play random sounds during daytime. // // Note: If you provide UUID keys for the sounds you will not have to put // the sounds into the object. Therefore that should be your preferred // method of action.
// Place the UUID keys of the sounds you want played in this list:
list Sounds = []; vector Sun; integer Pos;
default { on_rez(integer X) {llResetScript();}
state_entry() { llSetTimerEvent(1.0); }
timer() { Sun = llGetSunDirection(); if (Sun.z > 0) // Only when the sun is above the horizon... { Pos = llGetListLength(Sounds); if (Pos > 0) { Pos = llFloor(llFrand(Pos)); // Pick a random sound to play... llTriggerSound(llList2String(Sounds,Pos),1.0); // and play it. llSetTimerEvent(llFrand(10.0)); // Set random timer for next sound } else { llOwnerSay("Zere iz no Zoundz in ze lizt!"); } } else { llSetTimerEvent(180.0); // During nighttime reduce the timer events... } } }
thanks for your help, it works perfect! 
|