Jump to content
HotosHideout

Say command will not replay sound after initial fire.

Recommended Posts

I have a function:


shout_sound = {
    player say ["sound", 100, 1];
    sleep 2;
};


called here:

        class interact_button7: RscButton
        {
            idc = 1606;
            text = "SHOUT"; //--- ToDo: Localize;
            x = 0.456847 * safezoneW + safezoneX;
            y = 0.514004 * safezoneH + safezoneY;
            w = 0.0986365 * safezoneW;
            h = 0.0280088 * safezoneH;
            action = "call shout_sound;";
        };

 

It will fire on gui mouse button click but it will not repeat when clicked again. No matter what i do even if i force the player say command in debug it will not fire. Any help would be appreciated. 

Share this post


Link to post
Share on other sites

Why not just put the player say command inside the action? You can't suspend execution of a thread called with "call" anyway. In fact, it may be throwing an error which would break it. Could also change 'call' to 'spawn' and see if it works better.

 

Share this post


Link to post
Share on other sites

I plan on adding more code including a titleText to the function. I'll try switching it to spawn and see what happens. 

Share this post


Link to post
Share on other sites
15 hours ago, HotosHideout said:

I must have my syntax wrong. I should be able to spawn a function correct?

Absolutely. I will double-check one of my own addons when I get home, I call a bunch of functions from a dialog.

 


action = "[] spawn shout_sound;";

Share this post


Link to post
Share on other sites

Ok, so either way the result is the same. On first click the sound fires. on any click after it does not. 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×