Jump to content

llTriggerSoundLimited Not Working


BrownBoxStudio
 Share

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

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

Recommended Posts

I am making a game with sound effects. I have the games base script which uses LLTriggerSoundLimited and it works perfectly fine. Although I said the function doens't work and I'm not lieing, this is the only function call I have gotten to work. Nothing else will trigger in any other object. I went as far to put all the scripts from the working game into a new root prim and link that to the build and no sound triggers. It's very odd. It's as if I somehow got the script to work in my one prim and now it won't work in anything else.

 

This is a piece of the working version that includes the llTriggerSoundLimited();

 

state pay 
{
    state_entry()
    {
        llSetPayPrice(price, [price, PAY_HIDE, PAY_HIDE, PAY_HIDE]);
    }
    money(key id, integer amount)
    {
        if (amount != price)
        {
            llRegionSayTo(id, 0, "Sorry, you have not paid the correct amount and have been refunded. Please pay " + (string)price + "L$ to play."); 
            llGiveMoney(id, amount);
        }
        else if (amount == price)    
        {
            llRegionSayTo(id, 0, "Thank you for paying. Your game will start shortly. Quit the game before taking a turn to be refunded.");
            player = id;
            llTriggerSoundLimited(skeeball_paysound, skeeball_paysound_vol, llGetPos() + (<sound_offset, sound_offset,0>* llGetRot()), llGetPos() + (<-sound_offset, -sound_offset,0> * llGetRot())); //skeeball new game music
            llSetTimerEvent(4.51);
        }
    }
    timer()
    {
        llMessageLinked(LINK_ROOT, 0, "new game", player);
        state play;
    }
}

 

This is a solo version of the above excerpt that I created to test which I cannot get working in any other object.

key player;
integer price = 1;

//sound settings
float sound_offset = 10;
float skeeball_paysound_vol = .5;
key skeeball_paysound = "3a8add53-8813-33db-3dac-ad60918b9020";
float skeeball_fanhumsound_vol = .14;
key skeeball_fanhumsound = "0b9b5a63-2630-f331-8e61-bc39496983c6";

default
{
    state_entry()
    {
        llSetPayPrice(price, [price, PAY_HIDE, PAY_HIDE, PAY_HIDE]);
    }
    money(key id, integer amount)
    {
        if (amount != price)
        {
            llRegionSayTo(id, 0, "Sorry, you have not paid the correct amount and have been refunded. Please pay " + (string)price + "L$ to play."); 
            llGiveMoney(id, amount);
        }
        else if (amount == price)    
        {
            llRegionSayTo(id, 0, "Thank you for paying. Your game will start shortly. Quit the game before taking a turn to be refunded.");
            player = id;
            llTriggerSoundLimited(skeeball_paysound, skeeball_paysound_vol, llGetPos() + (<sound_offset, sound_offset,0>* llGetRot()), llGetPos() + (<-sound_offset, -sound_offset,0> * llGetRot())); //skeeball new game music
            llSetTimerEvent(4.51);
        }
    }
    timer()
    {
        llMessageLinked(LINK_ROOT, 0, "new game", player);
    }
}

 

Link to comment
Share on other sites

True, that isn't needed now that I think about it. But I tested without that, or at least I thought I did. The working script has it too without any issue. Either way I will test again. Thanks for the suggestion.

 

Edit: Nope, removing both llGetRot()s made no difference. 

Link to comment
Share on other sites

Using 0 for the Z axis on both vectors does only work inconjunction with llGetRot(), AND when the object is NOT at 0.0 rotation on the X, or Y axis. If the object is at zero rotation, you are just describing a flat plane, and not a box with 0.0 on both vectors.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2964 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...