Changing music volume always at text?

  • #10, by afrlmeThursday, 11. February 2016, 16:44 8 years ago
    Yeah, you need to remove the if query bits from the 2 functions.
    -- * local variables * --
    local val = 10 -- amount to raise/lower the volume by...
    
    -- * text started lower volume * --
    function onTextStarted(text)
     if not Conditions["music_muted"].ConditionValue then setVolume(eMusicVolume, (getVolume(eMusicVolume) - val)) end
    end
    
    -- * text stopped raise volume * --
    function onTextStopped(text)
     if not Conditions["music_muted"].ConditionValue then setVolume(eMusicVolume, (getVolume(eMusicVolume) + val)) end
    end
    
    -- * the event listeners for text start & stop * --
    registerEventHandler("textStarted", "onTextStarted")
    registerEventHandler("textStopped", "onTextStopped")
    

    ... assuming you are using the same script as above. I just removed the queries that check if the text belongs to a character. Now it should work for any displayed text.

    Imperator

    7278 Posts


  • #11, by wimfFriday, 12. February 2016, 14:52 8 years ago
    Thank you very much, It works perfectly!

    Forum Fan

    238 Posts

  • #12, by afrlmeFriday, 12. February 2016, 17:51 8 years ago
    No problem. smile

    Imperator

    7278 Posts