[LUA] Disable Sounds/Music in the Loading Screen

Night007

Chieftain
Joined
Apr 9, 2015
Messages
2
Hey guys,
I added a new "Dawn of Man"-Msg with Audio. There is also a "Thememusic" in the audio-file. But then I realiesed, that the mainmenu-music is still playing in the loading Screen. I tried to disable it in XML, but it "seems" impossible.
Its my first project in Civ 5, so I am not sure, how "Strong" lua is (Only worked with LUA in Garrysmod, in which it can change every aspect of the game).

So to my question:
Is it possible to disable the Music of the Loading Screen/Main Menu with LUA?

[PS: Sorry for bad english, me german :mischief:]
 
Is it possible to disable the Music of the Loading Screen/Main Menu with LUA?

Almost certainly not possible. In general, mods can't affect anything until after the ModBrowser screen, as it's after that screen that they get loaded. While you could make your mod into a DLC to bypass that restriction, I'm not sure anyone has figured out how to add music/sounds/audio to DLC yet.
 
In general, mods can't affect anything until after the ModBrowser screen, as it's after that screen that they get loaded.

So changing it that way: Can I stop the music via lua in "Character Loading Screen" (after the ModBrowser, while the Dawn of Man is playing)?

And after searching in the lua commands, is it even possible to play/stop musics/sounds in lua?
 
And after searching in the lua commands, is it even possible to play/stop musics/sounds in lua?
You can play a sound by calling Events.AudioPlay2DSound, but it'll be considered a sound effect, even if the sound is set as background music, so it'll end up playing over the background music. Ingame, you can go to the next song in the war or peace song-pool by calling Events.AudioDebugChangeMusic, but you can't stop it. I don't know what happens if you invoke that event outside the game in the frontend, though.
 
You can play a sound by calling Events.AudioPlay2DSound, but it'll be considered a sound effect, even if the sound is set as background music, so it'll end up playing over the background music.

This can be alleviated by setting the TaperSoundtrackVolume tag in Audio_2DSounds to 0.0 for the sound you want to play. This will cause the currently playing music to be muted while the sound plays. This does have its own problem, though: you cannot stop the sound once it starts playing, and it will play over all other music, including other Civilizations' themes when their leader screens are opened.
 
Back
Top Bottom