[BNW] Lua Functions do not work properly

Is there any chance to get custom city-state music working? I've tried replacing MinorCivSounds/MinorCivSound, but it still doesn't work.
MinorCivSounds and MinorCivsSounds track back via an AgentRansack seach to files such as C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization V\assets\DLC\DLC_01\Sounds\XML\MinorCivSounds_DLC01.xml and which have contents like this
Code:
<MinorCivsSounds>
	<MinorCivSound>
		<ID>MINOR_CIV_UIGHUR</ID>
		<AudioScript>AS2D_MINOR_CIV_LHASA</AudioScript>
	</MinorCivSound>
	<MinorCivSound>
		<ID>MINOR_CIV_GEORGIA</ID>
		<AudioScript>AS2D_MINOR_CIV_WARSAW</AudioScript>
	</MinorCivSound>
	<MinorCivSound>
		<ID>MINOR_CIV_HUNGARY</ID>
		<AudioScript>AS2D_MINOR_CIV_BUCHAREST</AudioScript>
	</MinorCivSound>
	<MinorCivSound>
		<ID>MINOR_CIV_DAI_VIET</ID>
		<AudioScript>AS2D_MINOR_CIV_OSLO</AudioScript>
	</MinorCivSound>
	<MinorCivSound>
		<ID>MINOR_CIV_DALI</ID>
		<AudioScript>AS2D_MINOR_CIV_TYRE</AudioScript>
	</MinorCivSound>
	<MinorCivSound>
		<ID>MINOR_CIV_ABBASIDS</ID>
		<AudioScript>AS2D_MINOR_CIV_GENEVA</AudioScript>
	</MinorCivSound>
	<MinorCivSound>
		<ID>MINOR_CIV_CRUSADERS</ID>
		<AudioScript>AS2D_MINOR_CIV_COPENHAGEN</AudioScript>
	</MinorCivSound>
	<MinorCivSound>
		<ID>MINOR_CIV_WESTERN_XIA</ID>
		<AudioScript>AS2D_MINOR_CIV_SIDON</AudioScript>
	</MinorCivSound>
	<MinorCivSound>
		<ID>MINOR_CIV_KOREA</ID>
		<AudioScript>AS2D_MINOR_CIV_HANOI</AudioScript>
	</MinorCivSound>
</MinorCivsSounds>
and in which Firaxis uses special rules and tables that are not directly accessible to modders in the sense that we cannot write directly to these tables with standard xml/sql.

You could probably copy file C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization V\assets\DLC\Expansion2\Sounds\XML\MinorCivSounds_Inherited_Expansion2.xml into your mod, add your extra sound designation into your copy, and then import the resulting file into the VFS as part of your mod. Otherwise this is all sound goop and is getting a bit beyond my area of knowledge.

There are update-able Audio tables like this one
Code:
	<Audio_Sounds>
		<Row>
			<SoundID>SND_LEADER_MUSIC_SCIPIO_PEACE</SoundID>
			<Filename>Ceasar_Peace</Filename>
			<LoadType>DynamicResident</LoadType>
		</Row>
		<Row>
			<SoundID>SND_LEADER_MUSIC_SCIPIO_WAR</SoundID>
			<Filename>Ceasar_War</Filename>
			<LoadType>DynamicResident</LoadType>
		</Row>
	</Audio_Sounds>
	<Audio_2DSounds>
		<Row>
			<ScriptID>AS2D_LEADER_MUSIC_SCIPIO_PEACE</ScriptID>
			<SoundID>SND_LEADER_MUSIC_SCIPIO_PEACE</SoundID>
			<SoundType>GAME_MUSIC</SoundType>
			<MinVolume>50</MinVolume>
			<MaxVolume>50</MaxVolume>
			<IsMusic>true</IsMusic>
		</Row>
		<Row>
			<ScriptID>AS2D_LEADER_MUSIC_SCIPIO_WAR</ScriptID>
			<SoundID>SND_LEADER_MUSIC_SCIPIO_WAR</SoundID>
			<SoundType>GAME_MUSIC</SoundType>
			<MinVolume>50</MinVolume>
			<MaxVolume>50</MaxVolume>
			<IsMusic>true</IsMusic>
		</Row>
	</Audio_2DSounds>
I am using tables added by Firaxis for getting sound into the game, but I do not know how you then tie the sound designation to a city-state. The code quoted is from one of my mods and is used in "standard" xml activated via an <UpdateDatabase> action, but is for assigning sound files to a leader, and the game assumes the leader name LEADER_SCIPIO matches to the AS2D_LEADER_MUSIC_SCIPIO_WAR and SND_LEADER_MUSIC_SCIPIO_PEACE for a Major Civ Leader.
 
MinorCivSounds and MinorCivsSounds track back via an AgentRansack seach to files such as C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization V\assets\DLC\DLC_01\Sounds\XML\MinorCivSounds_DLC01.xml and which have contents like this
Code:
<MinorCivsSounds>
<MinorCivSound>
<ID>MINOR_CIV_UIGHUR</ID>
<AudioScript>AS2D_MINOR_CIV_LHASA</AudioScript>
</MinorCivSound>
<MinorCivSound>
<ID>MINOR_CIV_GEORGIA</ID>
<AudioScript>AS2D_MINOR_CIV_WARSAW</AudioScript>
</MinorCivSound>
<MinorCivSound>
<ID>MINOR_CIV_HUNGARY</ID>
<AudioScript>AS2D_MINOR_CIV_BUCHAREST</AudioScript>
</MinorCivSound>
<MinorCivSound>
<ID>MINOR_CIV_DAI_VIET</ID>
<AudioScript>AS2D_MINOR_CIV_OSLO</AudioScript>
</MinorCivSound>
<MinorCivSound>
<ID>MINOR_CIV_DALI</ID>
<AudioScript>AS2D_MINOR_CIV_TYRE</AudioScript>
</MinorCivSound>
<MinorCivSound>
<ID>MINOR_CIV_ABBASIDS</ID>
<AudioScript>AS2D_MINOR_CIV_GENEVA</AudioScript>
</MinorCivSound>
<MinorCivSound>
<ID>MINOR_CIV_CRUSADERS</ID>
<AudioScript>AS2D_MINOR_CIV_COPENHAGEN</AudioScript>
</MinorCivSound>
<MinorCivSound>
<ID>MINOR_CIV_WESTERN_XIA</ID>
<AudioScript>AS2D_MINOR_CIV_SIDON</AudioScript>
</MinorCivSound>
<MinorCivSound>
<ID>MINOR_CIV_KOREA</ID>
<AudioScript>AS2D_MINOR_CIV_HANOI</AudioScript>
</MinorCivSound>
</MinorCivsSounds>
and in which Firaxis uses special rules and tables that are not directly accessible to modders in the sense that we cannot write directly to these tables with standard xml/sql.

You could probably copy file C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization V\assets\DLC\Expansion2\Sounds\XML\MinorCivSounds_Inherited_Expansion2.xml into your mod, add your extra sound designation into your copy, and then import the resulting file into the VFS as part of your mod. Otherwise this is all sound goop and is getting a bit beyond my area of knowledge.

This means that I can't set two music tracks with the same Minor Civ ID, as it will return a "ID is not unique". It's a small problem because I have included an User Option to change the Minor Civ Trait of the added City-State.
But thanks for pointing out.

EDIT: Nope, Civ V thinks that I've done an error within the coding and refuses to load the file.
 
Last edited:
Back
Top Bottom