DLC modding help needed

IgorS

Your ad could be here!
Joined
Sep 28, 2008
Messages
2,297
Location
Rishon
Hi! So, I've created my mod for alternate city lists (link in signature), and I still have a problem.
The problem is with DLC. It just won't work with it. I've tried many things, but nothing really works.

Here is the thing: when I change the city lists, the database aspect works perfectly, but there is some problem with linking to the text.

As an example, the first Aztec city is supposed to be LOC_CITY_NAME_AZTEC_CITY_00, which links to this:
<Row Tag="LOC_CITY_NAME_AZTEC_CITY_00" Language="en_US">
<Text>Tenochtitlan</Text>
</Row>

When I play the game, the city name shown is LOC_CITY_NAME_AZTEC_CITY_00 and not Tenochtitlan.
So the database update works, but for some reason the text update does not.

The problem is only with DLC civs. Vanilla civs work properly.

OK, to elaborate a bit more on it. For myself I made two mods. One has the city lists for vanilla + Aztecs + Poland, and all the databases for Australia, Persia and Macedon. The other mod has the city lists (without the database, only text update) for Australia, Persia and Macedon, and it is set to depend on the first one. This mod works absolutely fine. The questions are: 1. Why? 2. Can I upload the mod that way for the community, and would it work for people who don't have every dlc civ?
 
Last edited:
Here are the files. If you have time to take a look at them and tell what is wrong, I'll be glad.
 

Attachments

LOC_CITY_NAME_AZTEC_CITY_00 neither this nor any other Aztec city is defined in <LocalizedText> in any file within mod
Code:
<Mod id="9786606e-c741-4c51-9833-88999c0c193f" version="1">
  <Properties>
    <Name>Alternate City Lists</Name>
You've defined data for Poland, Australia, Persia, and Macedon in file CityLists-DLC.xml

In mod
Code:
<Mod id="aafc4cbc-8708-4279-bf26-79551cf43f72" version="1">
  <Properties>
    <Name>Alternate City Lists - DLC Addon</Name>
You are re-defining the same information for LOC_CITY_NAME_POLAND_CITY_00, etc., which causes unique constraint failure when both mods are enabled. Within this "addon" mod, however, you are not stating anything that is updating to <UpdateDatabase> that re-directs city-name usages to the new names contained within this mod. You are doing this in the "main" mod. And you have the definitions of LOC_CITY_NAME_AZTEC_CITY_00 only contained within this "addon" mod.

The re-directs for civilization Aztec are therefore occuring in the main mod's <UpdateDatabase> but at that time the game cannot find the definition of the Tag because it has not been made yet.

The following is not a cure for anything because these priotities only affect file load order within the action, not across mods.:
Code:
<File priority="1">CityLists-DLC.xml</File>
<File priority="1">Names.xml</File>
To affect load order you need to use <LoadOrder> to enact a priority to the action as a whole. So you would need to try something like this
Code:
  <InGameActions>
    <UpdateText id="NewAction">
      <Properties>
        <LoadOrder>1</LoadOrder>
      </Properties>
      <File priority="1">CityLists-DLC.xml</File>
      <File priority="1">Names.xml</File>
    </UpdateText>
  </InGameActions>
The lower the <LoadOrder> priority the sooner the action is implemented vs all other actions from all other mods. But I don't know if anyone has tested whether <LoadOrder> works for UpdateText.

Change all these from <Row> to <Replace>:
Code:
		<Row Tag="LOC_CITY_NAME_AZTEC_CITY_00" Language="en_US">
			<Text>Tenochtitlan</Text>
		</Row>
		<Row Tag="LOC_CITY_NAME_AZTEC_CITY_01" Language="en_US">
			<Text>Texcoco</Text>
		</Row>
		<Row Tag="LOC_CITY_NAME_AZTEC_CITY_02" Language="en_US">
			<Text>Tlacopan</Text>
		</Row>
I would do this for all the <LocalizedText> text entries because then it does not matter how many times the same localizations are added, you will not get Unique Constraint errors.

<Replace> is short for INSERT OR REPLACE INTO and will add the row if there is no matching one already within the table. It will literally replace the existing row if there is a matching one within the table.

I would also move all the <UpdateText> actions to occur in the two modinfo files before any <UpdateDatabase> actions within the same mod. And I would move this stuff
Code:
<GameData>
	<CivilizationLeaders>
		<Replace CivilizationType="CIVILIZATION_POLAND" LeaderType="LEADER_JADWIGA" CapitalName="LOC_CITY_NAME_POLAND_CITY_01"/>
		<Replace CivilizationType="CIVILIZATION_AUSTRALIA" LeaderType="LEADER_JOHN_CURTIN" CapitalName="LOC_CITY_NAME_AUSTRALIA_CITY_00"/>
		<Replace CivilizationType="CIVILIZATION_MACEDON" LeaderType="LEADER_ALEXANDER" CapitalName="LOC_CITY_NAME_MACEDON_CITY_00"/>
		<Replace CivilizationType="CIVILIZATION_PERSIA" LeaderType="LEADER_CYRUS" CapitalName="LOC_CITY_NAME_PERSIA_CITY_01"/>
	</CivilizationLeaders>
	<CityNames>
		<Delete CivilizationType="CIVILIZATION_POLAND"/>
		<Delete CivilizationType="CIVILIZATION_AUSTRALIA"/>
		<Delete CivilizationType="CIVILIZATION_MACEDON"/>
		<Delete CivilizationType="CIVILIZATION_PERSIA"/>
		<!-- Poland -->
		<Row CivilizationType="CIVILIZATION_POLAND" CityName="LOC_CITY_NAME_POLAND_CITY_00"/>
		<Row CivilizationType="CIVILIZATION_POLAND" CityName="LOC_CITY_NAME_POLAND_CITY_01"/>
		<Row CivilizationType="CIVILIZATION_POLAND" CityName="LOC_CITY_NAME_POLAND_CITY_02"/>
		<Row CivilizationType="CIVILIZATION_POLAND" CityName="LOC_CITY_NAME_POLAND_CITY_03"/>
                ....etc.....
Into the mod for the dlc.

If it were me I would slice the dlc mod into multiple mods respective of their dlc packaging from firaxis, and set each of these mods to have a <Dependancy> to their respective dlc. This dependancy should cause these add-on mods to only load into the game after their respective dlc and then a player can only enable these dlc dependant mods if they have the correct dlc for the given add-on mod.
 
Change all these from <Row> to <Replace>:
Code:
        <Row Tag="LOC_CITY_NAME_AZTEC_CITY_00" Language="en_US">
            <Text>Tenochtitlan</Text>
        </Row>
        <Row Tag="LOC_CITY_NAME_AZTEC_CITY_01" Language="en_US">
            <Text>Texcoco</Text>
        </Row>
        <Row Tag="LOC_CITY_NAME_AZTEC_CITY_02" Language="en_US">
            <Text>Tlacopan</Text>
        </Row>
I would do this for all the <LocalizedText> text entries because then it does not matter how many times the same localizations are added, you will not get Unique Constraint errors.

<Replace> is short for INSERT OR REPLACE INTO and will add the row if there is no matching one already within the table. It will literally replace the existing row if there is a matching one within the table.
Thanks. I'm not sure I understood all of it, but I am going to try the "replace" thing first, because it makes the most sense to me. I'll look again at your explanation, and try to figure out the problem.

Did you look into BOTH mods I uploaded? Because I want to repeat that the one in post #2 does not work (the dlc mods), and the one in post #3 works fine.
 
I looked at the two mods that were on steam workshop as they were downloaded into my folders. Nothing esle you had linked to by the time I tried to look into the issue was actually a playable mod.
 
I looked at the two mods that were on steam workshop as they were downloaded into my folders. Nothing esle you had linked to by the time I tried to look into the issue was actually a playable mod.
I was talking about the zip files I have attached to posts 2 and 3.
 
Well, I tried the replace thing, and it does not work. The problem is 100% with load order, but I just can't seem to figure it out.
Here is the mod I am trying to run.
 

Attachments

  1. Database.log report:
    Code:
    [3376452.292] [Localization] ERROR: Database::XMLSerializer (Names.xml): 'Row' or 'Delete' expected, got 'Where'.
    [3376452.292] [Localization]: In XMLSerializer while updating table Update from file Names.xml.
    [3376452.292] [Configuration]: Validating Foreign Key Constraints...
    [3376452.293] [Configuration]: Passed Validation.
    [3376476.734] [FullTextSearch]: FTS - Creating Context
    [3376480.346] [FullTextSearch]: FTS - Creating Context
    [3376490.397] [Configuration]: Validating Foreign Key Constraints...
    [3376490.397] [Configuration]: Passed Validation.
    [3376497.683] [Configuration]: Validating Foreign Key Constraints...
    [3376497.683] [Configuration]: Passed Validation.
    [3376504.772] [Localization] ERROR: Database::XMLSerializer (Names.xml): 'Row' or 'Delete' expected, got 'Where'.
    [3376504.772] [Localization]: In XMLSerializer while updating table Update from file Names.xml.
    [3376504.773] [Configuration]: Validating Foreign Key Constraints...
    [3376504.773] [Configuration]: Passed Validation.
    [3376555.589] [Localization] ERROR: Database::XMLSerializer (Names.xml): 'Row' or 'Delete' expected, got 'Where'.
    [3376555.589] [Localization]: In XMLSerializer while updating table Update from file Names.xml.
    [3376555.589] [Configuration]: Validating Foreign Key Constraints...
    [3376555.589] [Configuration]: Passed Validation.
    [3376557.821] [Localization] ERROR: Database::XMLSerializer (AztecCityList.xml): 'Row' or 'Delete' expected, got 'Text'.
    [3376557.821] [Localization]: In XMLSerializer while updating table Replace from file AztecCityList.xml.
    [3376557.821] [Localization] ERROR: Database::XMLSerializer (Names.xml): 'Row' or 'Delete' expected, got 'Where'.
    [3376557.821] [Localization]: In XMLSerializer while updating table Update from file Names.xml.
    The issue is not a mod loading order issue, it is fatal code syntax errors
  2. Basic Syntax error here in file Names.xml:
    Code:
    <GameData>
    	<Update>
    		<Where Tag="LOC_CIVILIZATION_AZTEC_NAME" Language="en_US"/>
    		<Set Text="Triple Alliance"/>
    	</Update>
    </GameData>
    No Table name. You need:
    Code:
    <GameData>
    	<LocalizedText>
    		<Update>
    			<Where Tag="LOC_CIVILIZATION_AZTEC_NAME" Language="en_US"/>
    			<Set Text="Triple Alliance"/>
    		</Update>
    	</LocalizedText>
    </GameData>
  3. Same error and fix applies to file AztecCityList.xml
 

Attachments

  1. Basic Syntax error here in file Names.xml:
    Code:
    <GameData>
        <Update>
            <Where Tag="LOC_CIVILIZATION_AZTEC_NAME" Language="en_US"/>
            <Set Text="Triple Alliance"/>
        </Update>
    </GameData>
    No Table name. You need:
    Code:
    <GameData>
        <LocalizedText>
            <Update>
                <Where Tag="LOC_CIVILIZATION_AZTEC_NAME" Language="en_US"/>
                <Set Text="Triple Alliance"/>
            </Update>
        </LocalizedText>
    </GameData>
Oh, you've got to be kidding me!!!:wallbash:
This is what you get when trying to create a mod with a short attention span, I guess... Thank you for noticing my mistake. I was looking at the code, and comparing with the one that works, and nothing... And it was right there!
 
And still, the question remains: what happens if I make a mod that changes city lists (and nothing else) for DLC civs, and someone has only some DLC civs, and not all of them, and installs my mod. Will it still work for them (in case I do not make it a requirement to actually have that DLC, of course)?
 
The text files should be fine since all you are doing is shoving text Tags into the <LocalizedText> table. Does not matter if those Tags are ever actually used anywhere.

The <UpdateDatabase> files are more problematic especially if you try to roll everything in Australia, Persia, Macedon, and Poland into one add-on mod. Since these are broken into three different DLC eventually you will run afoul of the user who has one but not the others and the permuatations thereof. I think such a user would keep getting shunted back to the main menu in such a case because there would be an Invalid Reference error.

This is why I was suggesting break up the dlc add-ons into individual mods one each for each DLC and its civs. Then you can set a dependancy in your modinfo file and this ought to also ensure that the dlc loads before your add-on mod, as well as it will not allow the add-on mod to even be enabled if the player does not also have the dlc and the dlc is not currently enabled.
 
Last edited:
The text files should be fine since all you are doing is shoving text Tags into the <LocalizedText> table. Does not matter if those Tags are ever actually used anywhere.

The <UpdateDatabase> files are more problematic especially if you try to roll everything in Australia, Persia, Macedon, and Poland into one add-on mod. Since these are broken into two different DLC eventually you will run afoul of the user who has one but not the other. I think such a user would keep getting shunted back to the main menu in such a case because there would be an Invalid Reference error.

This is why I was suggesting break up the dlc add-ons into individual mods one each for each DLC and its civs. Then you can set a dependancy in your modinfo file and this ought to also ensure that the dlc loads before your add-on mod, as well as it will not allow the add-on mod to even be enabled if the player does not also have the dlc and the dlc is not currently enabled.
Yes, that's what I also thought. And this is what I did now. Going to reupload the mod to Steam. It really sucks though that you cannot upload a DLC pack, and let the user turn on and off the necessary files. Instead you need to make a separate upload for each pack. But never mind.
Thanks.
 
Back
Top Bottom