Login / Registrieren
DE EN FR ES IT CZ
Zurück Nach oben

Changing music volume always at text?

  • #10, by afrlme 10 years ago Zitieren
    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.
  • #11, by wimf 10 years ago Zitieren
    Thank you very much, It works perfectly!
  • #12, by afrlme 10 years ago Zitieren
    No problem. smile