#car entity driving sound play when opening car GUI - JKIL KnightRider mod
1 messages · Page 1 of 1 (latest)
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
no one ? help
@latent cairn (excuse me for pinging you here, but I see no other option anymore) - can I ask one of the devs to take a look in this thread and that link please ?(https://forums.factorio.com/viewtopic.php?p=628343#p628343)
In release 2.0.7, there is a mention of support for multiple main sounds for entities Added support for multiple main sounds for entities' working_sound. Thi…
If this is about documentation then ask @ Bilka or @ Therenas. If this is about sounds then ask @ Don
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 ?)
I'll take a look
I sweer - I just thought it's a funny one - I'm not some snut-nosed kid, I'm 50 yr/o
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
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
I'm checking 1.1 with your mod now but it should be playing it twice, unmodded car plays it twice
thank you
a workaround could be setting the hidden sound setting "active-gui-volume-modifier" to zero, so the second sound would be muted
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
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
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
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
I'm going to check again now - that's a surprise to me
the file or 'other settings' dev menu ?
both/either
I gotcha
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
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
you're correct, it's not possible and haven't changed
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 ❤️
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
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
there is a modding interface request thread on the forums about stuff like that, feel free to join it with your ideas