CRxTRDude said:Checked the documentation project, there's nothing, until I got into the source code and found this:
//setmusicvolume(left, right)
Apparently, you can give the number value of the left and right channels. You could use this for various stuff, but for fading music, there's the fade music command.
#bglayer {path} {xratio} {zratio} {xposition} {zposition} {xspacing} {zspacing} {xrepeat} {zrepeat} {transparency} {alpha} {watermode} {amplitude} {wavelenghth} {wavespeed} {bgspeedratio}
#bglayer path xratio zratio xoffset zoffset xspacing zspacing xrepeat zrepeat trans alpha w-mode ampl wlen wmode begsize endsize
bglayer data/bgs/ryu/ryubg.png 1 0.5 0 0 0 0 -1 1 1 0 0 0 0 0
bglayer data/bgs/ryu/ryubg1.png 0 0.5 0 0 0 0 -1 1 1 0 0 0 0 0
panel data/bgs/ryu/ryu1.png
order a
direction both
settime 0
notime 1
cameratype 0
#music data/music/ryu.ogg 1992614.4 #1:30.368 = 90.523 => 22050 * 90.368 = 1992614.4
#music data/music/ken.ogg 4124628.9 #93.529 #Ken's theme 1.33.480 = 93.480 => 44100 * 93.480 4122468
#music data/music/balrog.ogg 4186809.9 #Balrog's theme 44100 * 94.861 =
#music data/music/bison.ogg 3991491 #Bison's theme 44100 * 90.510
#music data/music/akuma.ogg 4110120 #Akuma's theme
#music data/music/gou-ryu.ogg 3503789.1 #Gouken vs Ryu
#music data/music/joe2.ogg
music data/music/cody.ogg 4525321.5
#music data/music/cody1.ogg 3074828.4
setmusicvolume 100 0
EDIT: I am lost in where to setmusicvolume. I tried to make the volume on the left stay higher than the right which I make it no sound, but I can't get it to work.
@script
if(frame==1){
playmusic("data/music/ken.ogg", 1);
setmusicvolume(35,100);
}
if(frame==2){
void self = getlocalvar("self");
int r = rand()%30;
if( r > 10 ){
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW1"));
} else if( r < -10 ){
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW2"));
} else if( r > -10 ){
changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW3"));
}
}
@end_script
I was increasing the volume for the right higher than the left and it's not louder as it seems. Left volume works good though. I think left is the main factor for adjusting volumes to work, and it must be because it's stereo? I dunno. It cannot be adjusted like mono style?
Also, another strange thing is that when exiting/quitting the game (whether you close OpenBOR.exe or quit game) the volume returns to normal default (non-scripted volume). For example, when you set your setmusicvolume lower in in-game and you quit game, the volume will return from lower setmusicvolume adjustment to normal (while closing).
Now I'm wondering if it could be possible to use for entering from outside of the dance club to inside there where volume is very loud when people dance in the club.
O Ilusionista said:About the volume at OpenBOR, I dunno if it works like in Mugen, where the engine changes the stereo ballance based on the entity position.