<Update> and <Row> for tables within a table

Kruelgor

Emperor
Joined
May 12, 2010
Messages
1,165
Location
The United States
Kael's example for adding or updating a table within a table wasn't exactly a good example, imo.

Here is the example of a table within a table that Kael's guide addresses:

The above example show an assets that only has one table. But most of the assets in Civilization V have multiple tables. Consider the following for the engineer specialist:

<GameData>
<Specialists>
<Row>
<Type>SPECIALIST_ENGINEER</Type>
<Description>TXT_KEY_SPECIALIST_ENGINEER</Description>
<Strategy>TXT_KEY_SPECIALIST_ENGINEER_STRATEGY</Strategy>
<GreatPeopleTitle>TXT_KEY_SPECIALIST_ENGINEER_TITLE</GreatPeopleTitle>
<Visible>true</Visible>
<Cost>0</Cost>
<GreatPeopleUnitClass>UNITCLASS_ENGINEER</GreatPeopleUnitClass>
<GreatPeopleRateChange>3</GreatPeopleRateChange>
<IconAtlas>CITIZEN_ATLAS</IconAtlas>
<PortraitIndex>1</PortraitIndex>
</Row>
</Specialists>

<SpecialistYields>
<Row>
<SpecialistType>SPECIALIST_ENGINEER</SpecialistType>
<YieldType>YIELD_PRODUCTION</YieldType>
<Yield>1</Yield>
</Row>
</SpecialistYields>
</GameData>



First of all that doesn't even truly look like a table within a table.

Audio2DScripts.xml appears to have true tables within a table, and this is where I get confused on what syntax to use to when updating or adding rows.

A snippet:

<Script2DFile>
<Script2DSounds>
<Script2DSound>
<ScriptID>AS2D_MINOR_CIV_WARSAW</ScriptID>
<SoundID>SND_MINOR_CIV_WARSAW</SoundID>
<SoundType>GAME_MUSIC_STINGS</SoundType>
<iMinVolume>55</iMinVolume>
<iMaxVolume>55</iMaxVolume>
<iMinTimeDelay>0</iMinTimeDelay>
<iDontPlayMoreThan>1</iDontPlayMoreThan>
<bDontTriggerDuplicates>True</bDontTriggerDuplicates>
<iMinTimeMustNotPlayAgain>0</iMinTimeMustNotPlayAgain>
<fTaperSoundtrackVolume>0.0</fTaperSoundtrackVolume>
</Script2DSound>
</Script2DSounds>
</Script2DFile>



How would you <update> and add a new <row> for a file like that with tables within tables?
 
Ok, for a start, the reason Kael's example isn't a good example of a "table within a table" is because it quite explicitly isn't intended to be an example of a table within a table at all. If you actually read the bit that you're quoting, you'll see that it's an example of an asset whose data is split over two tables.

As for your actual question, you wouldn't. <Update> and <Row> only apply to the gameplay XML files that are read into the SQL database.
 
As for your actual question, you wouldn't. <Update> and <Row> only apply to the gameplay XML files that are read into the SQL database.

My example I posted above is from a gameplay xml file.

Audio2DScripts.xml appears to have true tables within a table, and this is where I get confused on what syntax to use to when updating or adding rows.

A snippet:

<Script2DFile>
<Script2DSounds>
<Script2DSound>
<ScriptID>AS2D_MINOR_CIV_WARSAW</ScriptID>
<SoundID>SND_MINOR_CIV_WARSAW</SoundID>
<SoundType>GAME_MUSIC_STINGS</SoundType>
<iMinVolume>55</iMinVolume>
<iMaxVolume>55</iMaxVolume>
<iMinTimeDelay>0</iMinTimeDelay>
<iDontPlayMoreThan>1</iDontPlayMoreThan>
<bDontTriggerDuplicates>True</bDontTriggerDuplicates>
<iMinTimeMustNotPlayAgain>0</iMinTimeMustNotPlayAgain>
<fTaperSoundtrackVolume>0.0</fTaperSoundtrackVolume>
</Script2DSound>
</Script2DSounds>
</Script2DFile>
 
Maybe I'm being silly.. but this doesn't seem that complicated.

Shouldn't it be:

Spoiler :
Code:
<Gamedata>
	<Script2DFile>
		<Script2DSounds>
			<Script2DSound>
				<Set SoundID="InsertSoundFileHere"/>
				<Where ScriptID="AS2D_MINOR_CIV_WARSAW"/>
			</Script2DSound>
		</Script2DSounds>
	</Script2DFile>
</Gamedata>

Granted I don't know how to actually make the sound files (I think they use .ogg format?) but programming the xml was fairly well explained. Unless I'm missing something here
 
Maybe I'm being silly.. but this doesn't seem that complicated.

Shouldn't it be:

Spoiler :
Code:
<Gamedata>
	<Script2DFile>
		<Script2DSounds>
			<Script2DSound>
				<Set SoundID="InsertSoundFileHere"/>
				<Where ScriptID="AS2D_MINOR_CIV_WARSAW"/>
			</Script2DSound>
		</Script2DSounds>
	</Script2DFile>
</Gamedata>

Granted I don't know how to actually make the sound files (I think they use .ogg format?) but programming the xml was fairly well explained. Unless I'm missing something here

I'll give it a shot, doesn't hurt to try, but were you intending to include the <update> command?
 
Update, row, etc, (in fact the modularisation of mods) only apply to those files where you have records in the original coming from <Row> entities... as far as I can tell so far, there is no modular modding of things like graphics and audio XML.
 
Back
Top Bottom