I've been coding for decades, but new to lua scripting and how things tie together in AC.
I've figured out to hide/show a sunroof mesh in the ext_config.ini when the "extra B" control is triggered:
What I would like to also do is increase certain sounds when it's "open", and quiet them when it's closed. (maybe even swap to different sounds that are more muffled).
I've found an example of controlling the sound volume using something like this:
But, how do I tie that to the extra key, and sync it with whether the roof is open (meshes hidden)? Can a global variable be set that is accessible in both the script and in the ini file to keep track of it or something?
Or, can I handle hiding the meshes, changing the sound, etc.... all from within a script, that is triggered by the extra B key?
Thanks for any help or links to examples.
I've figured out to hide/show a sunroof mesh in the ext_config.ini when the "extra B" control is triggered:
Code:
[EMISSIVE_EXTRA_B_...]
NAME=SUN_ROOF
TOGGLE_VISIBILITY = 1
TOGGLE_VISIBILITY_INVERSE = 1 ; VISIBLE BY DEFAULT!
COLOR=0.1, 0.1, 0.1, 0.1
I've found an example of controlling the sound volume using something like this:
Code:
local carSounds = ui.MediaPlayer()
carSounds:setVolume(ac.getAudioVolume('main') * 0.4)
Or, can I handle hiding the meshes, changing the sound, etc.... all from within a script, that is triggered by the extra B key?
Thanks for any help or links to examples.