I hope this is OK with the script author, I modified the script to play the video using the
BGM Volume instead of always playing on maximum volume. You can download the
attached modified script.
More info:
I noticed the videos play in maximum volume regardless of what the user (or me) set the different volume levels to be. Looking at the code, it makes sense because the author is using PIXI directly to play videos. I modified it slightly (column
5878) to make the script play the video using the BGM volume. For me it made sense because I'm only playing an intro with some music, and I wanted it to match the music volume.
How to modify the script for your own use case:
You can find this new line in the file I attached:
JavaScript:
t.texture.baseTexture.source.volume=ConfigManager.bgmVolume/100.0
Where it says
ConfigManager.bgmVolume/100.0 you can put basically any other volume level.
Important: PIXI volume must be between 0 and 1 (inclusive). Most MV volume levels are in range 0..100. So for most of these examples we divide by 100, except for the Master Volume which is already in the right range.
For instance:
To play the video using the SE volume:
JavaScript:
t.texture.baseTexture.source.volume=ConfigManager.seVolume/100.0
To play the video using the ME volume:
JavaScript:
t.texture.baseTexture.source.volume=ConfigManager.meVolume/100.0
To play the video using the BGS volume:
JavaScript:
t.texture.baseTexture.source.volume=ConfigManager.bgsVolume/100.0
To play the video using the master volume:
JavaScript:
//Note: master volume is already in range [0..1], no need to divide by 100.
t.texture.baseTexture.source.volume=ConfigManager.masterVolume
Loading a volume level from variable:
I don't see a reason why you shouldn't be able to use a variable to set the video volume.
Let's say you store the desired volume level in
variable 5. You can use it like this:
JavaScript:
t.texture.baseTexture.source.volume=$gameVariables.value(5)/100.0
In the event where you play the video, you can set the variable to the desired volume before starting the video (in this case, set it between 0 and 100. I did it like this because you can't set real numbers in the variable screen in the editor).
Note: Credit for this script goes to Dr.Yami. However since I attached a file let me clear up that I have no intention of claiming credit for the script or changing the license. The original script is under MIT license and the modified version I attached, as far as I'm concerned, is under the same license.