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:
-- LUA Script - precede every function and global member with lowercase name of script + '_main'
-- Player Enters Story Zone
function storyinzone_init(e)
end
function storyinzone_main(e)
if g_Entity[e]['plrinzone']==1 then
music_set_volume(25,100)
PlaySound(e,0)
PlayVideo(e,1)
Destroy(e)
ActivateIfUsed(e)
music_set_volume(100,100)
end
end
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