Really Stuck with my first mod

CharZ

Chieftain
Joined
Mar 3, 2017
Messages
31
So I've tried to make the Netherlands via Modbuddy and most of my issues have been the game not loading, but thanks to LeeS I've gotten past that roadblock, unfortunately this revealed that most of my mod does, in fact, not work.
What I want for this Civ is:
Leader: Johan de Witt
Unique District: VOC Have (Harbor replacement. Available at currency; Provides an extra trade route, Great Scientist points, Great Artist points, and better adjacency bonuses)
Unique Improvement: Windmill (+1 food per adjacent [improved] wheat/farm, +1 production for adjacent windmills, +1 food and +2 production to tile, +1 production (or food) if built on marsh
Civ Ability: Colonial Trade (Settlers embark at Shipbuilding/Foreign Trade/Currency, Naval coastal tiles are better)
Leader Ability: Golden Age (Domestic Trade routes provide +1 food to both cities, Other civ's trade route to Netherlands provide +2 gold and +1 Production to them, and +2 gold +1 culture to Netherlands)
Unique Agenda: Grand Pensionary of Holland (Likes Civs with high gold, dislikes civs weaker in gold, tries to accumulate as much gold as possible)

And after successfully launching my first game I found a few issues
  • VOC District has no icon in the tech tree
  • The 'Golden Age' Leader ability isn't working (With the current code I don't expect it to work, need help w/ that)
  • The Windmill Improvement cannot be built
  • My 2nd City was called 'Mecca' instead of one of the dutch city names
  • Naming issues in multiple occasions

These are a few screenshots of the Naming issues:

Attatched is my code, so I would like help trying to get this thing functional.


Oh yeah, here is my Database.log as well
[2663204.832] [Localization]: Validating Foreign Key Constraints...
[2663204.833] [Localization]: Passed Validation.
[2663204.841] [Configuration]: Validating Foreign Key Constraints...
[2663204.842] [Configuration]: Passed Validation.
[2663216.237] [FullTextSearch]: Initializing FullTextSearch
[2663216.759] [Gameplay]: Validating Foreign Key Constraints...
[2663216.772] [Gameplay]: Passed Validation.
[2663217.223] [Configuration]: Validating Foreign Key Constraints...
[2663217.223] [Configuration]: Passed Validation.
[2663235.949] [FullTextSearch]: FTS - Creating Context
[2663241.702] [Configuration]: Validating Foreign Key Constraints...
[2663241.702] [Configuration]: Passed Validation.
[2663242.098] [Gameplay] ERROR: UNIQUE constraint failed: ModifierArguments.ModifierId, ModifierArguments.Name
[2663242.098] [Gameplay]: While executing - 'insert into ModifierArguments('ModifierId', 'Name', 'Value') values (?, ?, ?);'
[2663242.098] [Gameplay]: In XMLSerializer while inserting row into table insert into ModifierArguments('ModifierId', 'Name', 'Value') with values (TRAIT_CIVILIZATION_COLONIAL_TRADE, TerrainType, TERRAIN_OCEAN, ).
[2663242.098] [Gameplay]: In XMLSerializer while updating table ModifierArguments from file TheNetherlands_Civilizations.xml.
[2663242.098] [Gameplay] ERROR: UNIQUE constraint failed: ModifierArguments.ModifierId, ModifierArguments.Name
[2663242.134] [Gameplay]: Validating Foreign Key Constraints...
[2663242.147] [Gameplay]: Passed Validation.
[2663253.004] [FullTextSearch]: FTS - Creating Context
[2663253.253] [FullTextSearch]: FTS - Creating Context
[2663253.992] [FullTextSearch]: FTS - Creating Context
[2664182.608] [FullTextSearch]: FullTextSearch - Shutting down
 

Attachments

Has anyone made a mod that worked with modbuddy? I just use it to make the .blp files, do the rest by hand, it is safer & easier.
 
I'll take a look and see if I can find anything in a bit (I did manage to get ModBuddy working as my sole IDE for Civ 6 mod development, so hopefully I can help you out). :)
 
I've noticed that the zip you sent is missing the PlayerColours xml, which is referenced in your modinfo. Could you please send that, or does it not exist? Other than that, I've gotten your texts to work; the game, however, crashes when attempting to load your civ. I'll include some screenshots. If the file doesn't exist then I'll assume it isn't the problem and move on to trying other things. ;P

The Civilization Select Screen:
screenshot1.jpg


And the crash:
screenshot2.jpg
 
I've noticed that the zip you sent is missing the PlayerColours xml, which is referenced in your modinfo. Could you please send that, or does it not exist? Other than that, I've gotten your texts to work; the game, however, crashes when attempting to load your civ. I'll include some screenshots. If the file doesn't exist then I'll assume it isn't the problem and move on to trying other things. ;P

The Civilization Select Screen:
View attachment 466433

And the crash:
View attachment 466434
No there is no _PlayerColours xml file. How did you get the text to work, anyway?
 
So I managed to get the leader select screen text to work (I had an unneccessary underscore in one of my files) and I managed to build a VOC Have; there were no textures. The tile was a blank ocean tile, the icon in the list was that of the city centre, and when producing it it showed a monument icon in the city bar.
Other problems include:
  • The Windmill (It does not show up on the tech tree and cannot be built; there is a civlopedia entry)
  • Most of the naming
  • Leader & Civ abilities still do not work
Here is my Database.log
[2947391.736] [Localization]: Validating Foreign Key Constraints...
[2947391.737] [Localization]: Passed Validation.
[2947391.748] [Configuration]: Validating Foreign Key Constraints...
[2947391.749] [Configuration]: Passed Validation.
[2947403.405] [FullTextSearch]: Initializing FullTextSearch
[2947403.994] [Gameplay]: Validating Foreign Key Constraints...
[2947404.006] [Gameplay]: Passed Validation.
[2947404.533] [Configuration]: Validating Foreign Key Constraints...
[2947404.533] [Configuration]: Passed Validation.
[2947423.673] [FullTextSearch]: FTS - Creating Context
[2947435.878] [Configuration]: Validating Foreign Key Constraints...
[2947435.878] [Configuration]: Passed Validation.
[2947436.584] [Gameplay] ERROR: UNIQUE constraint failed: ModifierArguments.ModifierId, ModifierArguments.Name
[2947436.584] [Gameplay]: While executing - 'insert into ModifierArguments('ModifierId', 'Name', 'Value') values (?, ?, ?);'
[2947436.584] [Gameplay]: In XMLSerializer while inserting row into table insert into ModifierArguments('ModifierId', 'Name', 'Value') with values (TRAIT_CIVILIZATION_COLONIAL_TRADE, TerrainType, TERRAIN_OCEAN, ).
[2947436.584] [Gameplay]: In XMLSerializer while updating table ModifierArguments from file TheNetherlands_Civilizations.xml.
[2947436.584] [Gameplay] ERROR: UNIQUE constraint failed: ModifierArguments.ModifierId, ModifierArguments.Name
[2947436.622] [Gameplay]: Validating Foreign Key Constraints...
[2947436.635] [Gameplay]: Passed Validation.
[2947446.287] [FullTextSearch]: FTS - Creating Context
[2947446.514] [FullTextSearch]: FTS - Creating Context
[2947447.095] [FullTextSearch]: FTS - Creating Context
[2948896.109] [FullTextSearch]: FullTextSearch - Shutting down

And attached is my mod.
 

Attachments

Ok, I can tell you why you are still having naming problems. This code right here in your modinfo:
Code:
<Components>
        <UpdateDatabase id="NETHERLANDS_COMPONENT">
            <Items>
                <File>TheNetherlands_Civilizations.xml</File>
                <File>TheNetherlands_Icons.xml</File>
                <File>TheNetherlands_Improvements.xml</File>
                <File>TheNetherlands_Gossip.xml</File>
                <File>TheNetherlands_Leaders.xml</File>
                <File>TheNetherlands_PlayerColours.xml</File>
                <File>TheNetherlands_Districts.xml</File>
            </Items>
        </UpdateDatabase>
        <LocalizedText id="NETHERLANDS_TEXT">
            <Items>
                <File>TheNetherlands_Text.xml</File>
            </Items>
        </LocalizedText>
    </Components>
is telling the game to use the _Text xml for everything other than the civ select screen. The lines after this tell the game to use the _ConfigText xml for the civ select screen. Because your _Text is currently just copied over from the example mod, it doesn't contain any of the necessary localizations that your mod calls for. Basically what I'm saying is that you should copy everything from your _ConfigText xml into your _Text xml and delete everything that was already in it. Then insert this piece of code into it:
Code:
<Row Tag="LOC_CIVILIZATION_NETHERLANDS_DESCRIPTION" Language="en_US">
            <Text>The Netherlands</Text>
        </Row>
This is what gives your civilization a name on the loading screen (i.e. [Insert name here] joins the world's stage). If you find anything else that isn't named properly, chances are it's simply not registered in the _Text xml. I'll keep digging to see if I can find the solutions to your other problems.
 
Ok, I can tell you why you are still having naming problems. This code right here in your modinfo:
Code:
<Components>
        <UpdateDatabase id="NETHERLANDS_COMPONENT">
            <Items>
                <File>TheNetherlands_Civilizations.xml</File>
                <File>TheNetherlands_Icons.xml</File>
                <File>TheNetherlands_Improvements.xml</File>
                <File>TheNetherlands_Gossip.xml</File>
                <File>TheNetherlands_Leaders.xml</File>
                <File>TheNetherlands_PlayerColours.xml</File>
                <File>TheNetherlands_Districts.xml</File>
            </Items>
        </UpdateDatabase>
        <LocalizedText id="NETHERLANDS_TEXT">
            <Items>
                <File>TheNetherlands_Text.xml</File>
            </Items>
        </LocalizedText>
    </Components>
is telling the game to use the _Text xml for everything other than the civ select screen. The lines after this tell the game to use the _ConfigText xml for the civ select screen. Because your _Text is currently just copied over from the example mod, it doesn't contain any of the necessary localizations that your mod calls for. Basically what I'm saying is that you should copy everything from your _ConfigText xml into your _Text xml and delete everything that was already in it. Then insert this piece of code into it:
Code:
<Row Tag="LOC_CIVILIZATION_NETHERLANDS_DESCRIPTION" Language="en_US">
            <Text>The Netherlands</Text>
        </Row>
This is what gives your civilization a name on the loading screen (i.e. [Insert name here] joins the world's stage). If you find anything else that isn't named properly, chances are it's simply not registered in the _Text xml. I'll keep digging to see if I can find the solutions to your other problems.
Yay! It worked and my game still loads.
Did a quick playtest and these are my results:
  • Only 'Golden Age' appears on loading screen & personal diplomatic screen
  • Newly founded cities use another civs names
  • VOC uses random icons outside of Leader Select screen (All other effects that have been coded work [Need to add trade routes])
  • (More of an issue/oversight with the idea) The Great People attracted by the VOC cannot be used without their respective districts
  • Still cannot use or see Windmill outside Civlopedia
Again, Database.log & Mod files
[2951461.003] [Localization]: Validating Foreign Key Constraints...
[2951461.003] [Localization]: Passed Validation.
[2951461.010] [Configuration]: Validating Foreign Key Constraints...
[2951461.011] [Configuration]: Passed Validation.
[2951472.351] [FullTextSearch]: Initializing FullTextSearch
[2951472.853] [Gameplay]: Validating Foreign Key Constraints...
[2951472.866] [Gameplay]: Passed Validation.
[2951473.304] [Configuration]: Validating Foreign Key Constraints...
[2951473.304] [Configuration]: Passed Validation.
[2951493.634] [FullTextSearch]: FTS - Creating Context
[2951503.790] [Configuration]: Validating Foreign Key Constraints...
[2951503.790] [Configuration]: Passed Validation.
[2951504.392] [Gameplay] ERROR: UNIQUE constraint failed: ModifierArguments.ModifierId, ModifierArguments.Name
[2951504.392] [Gameplay]: While executing - 'insert into ModifierArguments('ModifierId', 'Name', 'Value') values (?, ?, ?);'
[2951504.392] [Gameplay]: In XMLSerializer while inserting row into table insert into ModifierArguments('ModifierId', 'Name', 'Value') with values (TRAIT_CIVILIZATION_COLONIAL_TRADE, TerrainType, TERRAIN_OCEAN, ).
[2951504.392] [Gameplay]: In XMLSerializer while updating table ModifierArguments from file TheNetherlands_Civilizations.xml.
[2951504.392] [Gameplay] ERROR: UNIQUE constraint failed: ModifierArguments.ModifierId, ModifierArguments.Name
[2951504.426] [Gameplay]: Validating Foreign Key Constraints...
[2951504.439] [Gameplay]: Passed Validation.
[2951513.435] [FullTextSearch]: FTS - Creating Context
[2951513.701] [FullTextSearch]: FTS - Creating Context
[2951514.250] [FullTextSearch]: FTS - Creating Context
[2953269.954] [FullTextSearch]: FullTextSearch - Shutting down
 

Attachments

Moving on, I've found the problem with your civilization ability (and, as a result, your windmill problem). Firstly, you've not actually registered your modifier id to your civ's trait. To do that, you should start by renaming your modifier id from TRAIT_CIVILIZATION_COLONIAL_TRADE to TRAIT_CIVILIZATION_COLONIAL_TRADE_OCEAN_NAV (this is because your modifier id can't have the same name as the trait itself). After you do that, you need to actually register the modifier id. To do that, insert this code between your "TraitModifiers" opener and closer (in the _Civilizations xml):
Code:
<Row>
            <TraitType>TRAIT_CIVILIZATION_COLONIAL_TRADE</TraitType>
            <ModifierId>TRAIT_CIVILIZATION_COLONIAL_TRADE_OCEAN_NAV</ModifierId>
        </Row>
Now that you've registered your modifier id, I'll move on to the second problem. You have placed two identical "ModifierArguments" sections in your _Civilizations xml:
Code:
<ModifierArguments>
        <Row>
            <ModifierId>TRAIT_CIVILIZATION_COLONIAL_TRADE_OCEAN_NAV</ModifierId>
            <Name>TerrainType</Name>
            <Value>TERRAIN_OCEAN</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_CIVILIZATION_COLONIAL_TRADE_OCEAN_NAV</ModifierId>
            <Name>Valid</Name>
            <Value>true</Value>
        </Row>
    </ModifierArguments>
This means that the game will try to register your modifier id twice, resulting in failure. Simply remove the duplicate, and you'll be fine. I have tested it, and after making these changes, not only does your civilization ability work, but this also fixed some more naming problems (such as issues with city names and the loading screen only displaying the leader ability) and it fixed your windmill not appearing in the tech tree (your windmill is also now buildable). This is because, after an xml fails to load, the game basically considers it to be trash and makes no attempt to continue pulling data from it. Because your _Civilizations xml failed to register, all of the windmill references and city names (with some exceptions) were also not registered.

Keep in mind that icons won't work past the civ select screen until you add custom textures and an _Icons xml (you can look on my github for examples on that). As for the voc district, I'm not entirely sure how to fix the fact that the tile doesn't change (your windmill is the same way). In my Turkey mod, I just sort of left my improvement in that state.

Your leader ability isn't working because you haven't made any modifier ids or arguments for it (although, as you said, it wasn't expected to work). As I'm not entirely sure what it was you were attempting to do or how to go about what I do understand, I'll leave it to you (or someone else, if you find someone) to look through the game's xmls and figure it out.

To save you some trouble, I'll reupload my modified version of your mod's ModBuddy project. I'm not sure if you're aware (although you probably are), but when you build a mod in ModBuddy, ModBuddy generates a .modinfo for it. Because of this, building your mod results in two .modinfo's. This isn't really a problem, as the other modinfo doesn't actually do much, but it does show up in the mod list. Simple fix: delete the ModBuddy modinfo from your mod after you build.
 

Attachments

As for the great people, you would either have to modify the particular great person itself or create a new type of great person for the district. I'm pretty sure that the usable districts for great people are not defined by the district itself, which is why this is the case.
 
Thanks NerdByFate, it finally functions!
Now what I need help with is this:
Leader Ability: Golden Age (Domestic Trade routes provide +1 food to both cities, Other civ's trade route to Netherlands provide +2 gold and +1 Production to them, and +2 gold +1 culture to Netherlands)
Unique Agenda: Grand Pensionary of Holland (Likes Civs with high gold, dislikes civs weaker in gold, tries to accumulate as much gold as possible)
And also the fact that the Windmill and VOC do not appear on the map (I would like the VOC to look like a normal harbour), I haven't got border colours, and the Windmill should probably be nerfed.
 
Attempted to add the 'Golden Age' trading ability. It did not work.

[3182454.244] [Localization]: Validating Foreign Key Constraints...
[3182454.244] [Localization]: Passed Validation.
[3182454.252] [Configuration]: Validating Foreign Key Constraints...
[3182454.252] [Configuration]: Passed Validation.
[3182465.528] [FullTextSearch]: Initializing FullTextSearch
[3182466.046] [Gameplay]: Validating Foreign Key Constraints...
[3182466.058] [Gameplay]: Passed Validation.
[3182466.503] [Configuration]: Validating Foreign Key Constraints...
[3182466.503] [Configuration]: Passed Validation.
[3182484.703] [FullTextSearch]: FTS - Creating Context
[3182499.517] [Configuration]: Validating Foreign Key Constraints...
[3182499.517] [Configuration]: Passed Validation.
[3182499.945] [Gameplay] ERROR: table Modifiers has no column named Row
[3182499.945] [Gameplay]: In Query - insert into Modifiers('ModifierId', 'ModifierType', 'Row') values (?, ?, ?);
[3182499.945] [Gameplay]: In XMLSerializer while updating table Modifiers from file TheNetherlands_Leaders.xml.
[3182499.973] [Gameplay]: Validating Foreign Key Constraints...
[3182499.985] [Gameplay]: Passed Validation.
[3182510.105] [FullTextSearch]: FTS - Creating Context
[3182510.341] [FullTextSearch]: FTS - Creating Context
[3182511.074] [FullTextSearch]: FTS - Creating Context
[3192227.559] [FullTextSearch]: FullTextSearch - Shutting down

Mod is attached (also request help with icons)
 

Attachments

MAJOR Bug: Germany (and probably every civ) gets the VOC Have as well.

Also the leader select screen is broken again.
 
Back
Top Bottom