Jump to content

Day/Night Environmental Sounds


Eidolon Aeon
 Share

You are about to reply to a thread that has been inactive for 942 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hi all,

I have an old school ambient sounds script that plays different sounds according to whether it is day or night. It's only supposed to loop crickets at night, but it plays the loop during the day as well. Other sounds play at the correct time. I'm not skilled enough to figure out what is going on with that and am hoping somebody can help.

The chunk of code:

    {
        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);
        }

 

 

 

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 942 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...