Scripts / Reducing music volume when playing video ?

Author
Message
Ertlov
GameGuru BOTB Developer
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location: Australia
Posted: 15th May 2016 12:06 Edited at: 15th May 2016 12:07
I am pretty sure I am doing it wrong, that´s why I want to ask the crowd.

The goal is to reduce the background music (I use the music.lua container with the playtrack lua scripts for the soundtrack) to 25% when a video is playing.

As my LUA days were 7 years ago, I thought this here should work:



Well. It doesn´t. The music volume level stays at full 100% throughout the video.

Can anyone point out WHAT I am doing wrong?
AMD FX 8Core @ 4GHZ - 16 GB DDR4 - 2xRadeon7950 - Windows 7 Ultimate
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 15th May 2016 13:34
@ Ertlov
Can't test now, but perhaps you are calling "Destroy(e)" before to "music_set_volume(100,100)".

Try to call "Destroy(e)" the last.



hth

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
Ertlov
GameGuru BOTB Developer
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location: Australia
Posted: 15th May 2016 14:15
I tried that already, no effekt. If I put only the reduction in, it triggers AFTER the video is played, no matter in which line I call it.
AMD FX 8Core @ 4GHZ - 16 GB DDR4 - 2xRadeon7950 - Windows 7 Ultimate
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 15th May 2016 18:12
perhaps these are better suited to your needs?
Quote: "function SetGameMusicVolume(v)
function SetGameSoundVolume(v)"

i havent personally used the music commands so can't really say for sure
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Ertlov
GameGuru BOTB Developer
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location: Australia
Posted: 15th May 2016 18:49
How would that suit into the story script ?!
AMD FX 8Core @ 4GHZ - 16 GB DDR4 - 2xRadeon7950 - Windows 7 Ultimate
3com
9
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 15th May 2016 19:05
maybe something like this ...



3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics

PM
Ertlov
GameGuru BOTB Developer
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location: Australia
Posted: 15th May 2016 19:12
music_set_volume(100,100) works fine as long as you use the music container, but not in this case.

SetGameMusicVolume doesnt do anything here on my end.

And the else causes all my Storyzones (many,many,many!!!) to constantly fire the 100 back, because i am not in them
AMD FX 8Core @ 4GHZ - 16 GB DDR4 - 2xRadeon7950 - Windows 7 Ultimate
Ertlov
GameGuru BOTB Developer
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location: Australia
Posted: 15th May 2016 19:49
Ha, found a creative solution, but had two use 2 scripts
AMD FX 8Core @ 4GHZ - 16 GB DDR4 - 2xRadeon7950 - Windows 7 Ultimate

Login to post a reply

Server time is: 2024-04-27 09:11:00
Your offset time is: 2024-04-27 09:11:00