#car entity driving sound play when opening car GUI - JKIL KnightRider mod

1 messages · Page 1 of 1 (latest)

terse badger
#

so my question is - how to I resolve this so it doesn't double play ?
here is the code:
'if data.raw["car"]["car"] and data.raw["car"]["car"].working_sound then
v = data.raw["car"]["car"].working_sound.main_sounds[1]
if v.sound then
s = v.sound
s.filename = Song
s.volume = Vol_level
end
v.match_speed_to_activity = false
v.match_volume_to_activity = false
end '

#

thought it better to split into a thread for easy access

terse badger
#

no one ? help

terse badger
latent cairn
#

If this is about documentation then ask @ Bilka or @ Therenas. If this is about sounds then ask @ Don

terse badger
#

well, it's all of the above... but my main concern is the sound issue. thank you for the reply

#

@floral jackal - can I ask you to give some attention to this thread ? (there is also information in the link above, maybe ask BIlka to check it out as well ?)

floral jackal
#

I'll take a look

terse badger
#

I sweer - I just thought it's a funny one - I'm not some snut-nosed kid, I'm 50 yr/o

floral jackal
#

so the fact that it's playing the sound twice when its GUI is opened is just how it works and have been working for a long time (way before 2.0) and has nothing to do with having multiple main sounds

terse badger
#

ok, but this didn't happen in any previous 1.0 or 1.1 version - so why now ?

#

and can you suggest any workaround ? I'm not a programmer - I just found an easy change and made it into a mod with the help of others

#

I thought maybe if I add the second sound as in the original entity code that maybe will resolve the issue but I hadn't had time to check that yet

floral jackal
#

I'm checking 1.1 with your mod now but it should be playing it twice, unmodded car plays it twice

terse badger
#

thank you

floral jackal
#

a workaround could be setting the hidden sound setting "active-gui-volume-modifier" to zero, so the second sound would be muted

terse badger
#

interesting - I'll need to learn how to limit that to only the car GUI so as to not disturb other GUI sounds, I guess

floral jackal
#

the "active-gui-volume-modifier" setting applies to the sound of an entity whose GUI is currently opened = the second instance of the sound

#

you can't limit it to only the car's GUI

terse badger
#

I was thinking, flip it before opening the gui and flipping again after, unless that is a prototype change in the loading stage of the mod ?

#

also - I can't find that setting in the API docs - can you direct me ?

#

am I not taking your work time here ? I don't want to distract you from your work

floral jackal
#

I've just checked latest 1.1 with 2.0.1 version of your mod and it definitely plays the music twice when I open the car's GUI while sitting in it

#

it's not an API thing, it's a hidden setting in the config

#

no worries, I wanted to make sure the double sound is not a regression from 1.1

terse badger
#

I'm going to check again now - that's a surprise to me

terse badger
floral jackal
#

both/either

terse badger
#

I gotcha

floral jackal
#

there is a chance I will make it so the sound is not doubled when the GUI is opened in the future, but for now it's a super minor thing that has been in the game for many years so it's a very low priority

terse badger
#

OMG - I'm sorry - I didn't remember this happening, that the sound plays also when in the car and opening the GUI 😮

#

maybe if I trigger playing the music separately from the car prototype - but I'd need to be able to stop the music/sound once the character stops driving and I think that is not possible (or wasn't possible) in the game because of how the engine plays sound - has that changed in 2.0 ?

#

asking because I think that was the previously the reason I went that way

floral jackal
#

you're correct, it's not possible and haven't changed

terse badger
#

I guess that's it then. with my limited programming abilities, fans of the mod will need to take it as is - thank you again for taking the time to work with me and please convey my thanks to all who participated in bringing this amazing game (which I already spent thousands of hours on - much beyond what steam is showing)

#

I love you all ❤️

floral jackal
#

you're welcome
and there was at least one other person asking about the double sound so maybe I'll get it changed at some point

terse badger
#

I would appreciate it and so will the 100 people that play with my mod (at least 😄 )

#

maybe see about making a "music player" entity that has a start-stop function that can be used by mods to do just that

#

as I always say - in computer programming, nothing is impossible

floral jackal
#

there is a modding interface request thread on the forums about stuff like that, feel free to join it with your ideas

terse badger
#

I will 🙂 thanks

#

I made a suggestion to provide sorting options to the mod list - I'd like to sort by mods marked as active (and I find that version is not a sort option I'd use, but that's a byproduct)