Having difficulty modding the music of existing leaders.

lindsay40k

Emperor
Joined
Mar 13, 2009
Messages
1,689
Location
England
I'm making a mod that's integrating a bunch of in-jokes amongst my friends.

I've followed this guide to make a new leader, with success. We now have a leader named Toku, of the Toku people, whose theme tune is an acoustic Japanese track.

I applied what I learned there to change the existing Tokugawa of Japan into Toyotomi, Toku's arch-nemesis. A simple name and Civilopedia change of an existing leader; worked fine.

The next job was to change Wang Kon's theme to Gangnam Style.

I cut an intro and loop out of it with Garageband (Mac user here), named Wang.mp3 and WangIntro.mp3.

I popped them into Assets/Sounds/Diplomacy.

In CIV4LeaderHeadInfos.xml, I changed
AS2D_DIPLO_WANGKON_EARLY
to
AS2D_DIPLO_WANG
and added
AS2D_DIPLO_WANG_INTRO
under
DiplomacyIntroMusicPeace.

In Audio2DScripts.xml, I copied the DIPLO_WANGKON_EARLY section and changed
AS2D_DIPLO_WANGKON_EARLY
to
AS2D_DIPLO_WANG
and
DIPLO_WANGKON_EARLY
to
DIPLO_WANG. I also made a similar entry for AS2D_DIPLO_WANG_INTRO and DIPLO_WANG_INTRO.

In AudioDefines.xml, I copied the DIPLO_WANGKON_EARLY section and changed
DIPLO_WANGKON_EARLY
to
DIPLO_WANG
and
Wangkon_Early
to
Wang. I also made a similar entry for DIPLO_WANG_INTRO and WangIntro.

I edited all of the eras of Wang Kon in the same way, making every one of them direct to the same intro and loop files.

The mod loaded ok, but when it came to a game involving Wang Kon, there was no audio.

I reverted to a working backup and tried dropping the audio files into Assets/Sounds/Diplomacy and renaming them to Wangkon_Early. Each one, when renamed to Wang's existing sound file, functioned fine.

So, these files are not dodgily encoded in a way that Civ doesn't like, and whilst the mod loads ok with the xml I wrote, it loses sound as soon as it follows my xml's directions to them. Yet if I have them pose as the files it usually looks for, it can work with them.

One workaround would be to simply duplicate the files with names for every occasion, but this would cause a lot of bloating as we want to give loads of other leaders theme tunes. And since Wang Kon does not have a preset intro on which to piggyback, he's just going to barge into diplomacy with HEY SEXY LADY without an introduction playing in.

Edit: I should probably mention we both have Gangnam Style on our iTunes and this isn't a mod that will be put out for download. Copyright theft is a crime.
 
I never change the script files. What controls the existing diplomacy music is actually the AudioDefines.xml file.

If you want to replace the existing music for WangKon without changing file names or data in the other audio xml files, what you can do is edit the diplomacy music entries in the AudioDefines file that point to the directory with the file in question.

In your mod directory(if its structured the same way as Beyond the sword's foldier structure) simply rename the song you want to what the song in the AudioDefines is named.

If you have more questions I'll see what I can do to help. :)
 
Aha. So, just change the very last link in the chain that leads Civ to tune.mp3, then, rather than redirecting the leaderinfo file along a completely different chain. OK, fingers crossed :)
 
Top Bottom