Mod will build but leader and civ don't appear in list

Lilpanda

Chieftain
Joined
Apr 2, 2017
Messages
7
Hi everyone,

I'm trying to hack together my first mod and I can't seem to get my new civ and leader to appear in the list when I create a new game. My mod builds without errors and appears in the additional content list. I've been trying to emulate Arwicks prussia but I can't figure out what syntax I'm missing. I feel like it should be something in my civs configuration file but I'm not sure what.

Let me know what you think.
 
Ok, I got my new civ to show up in the list but none of my icons or descriptions come in. It just shows the icons of the last civ before I mouse over my new civ. Also all the descriptions just show the tag for the text instead of the text. Example: instead of the leader name it just says LOC_LEADER_LP_TANDI. I'm not sure if its related but when I try to start a game with my leader it goes to a black screen, then game start, then back to menu.
 
being returned to main menu nearly always means you are telling the game to look for something you have never defined, or which did not successfully get into the game's database because of a code syntax or other error. You should check your database.log for error message related to your xml-files, and for errors in general anyway. C:\Users\YourNameHere\Documents\My Games\Sid Meier's Civilization VI\Logs/Database.log

To see what the normal messages are in the database.log, just shut off all mods in the additiional content menu, start a new game, and then once in-game after the loading, just exit directly to desktop. You can now open the database.log file with any text editor such as Notepad and will be able to see what are the usual messages that appear in this file.

Then start the game, re-enable your mod(s), and set-up a new game. Once the game hits the errors and returns to the main menu you can exit to desktop, open the database.log, and you should be able to see messages related to the errors encountered.

for future reference, ModBuddy does not check the code or correctness of your mod. It is quite happy to build a mod whose code is all entirely garbage. The only kind of errors it is really looking for or reporting when you build the mod is such things as not being able to access a file, for example.

When looking at the contents of an XML, SQL, or Lua file from within Modbuddy, the only error messages you get related to your code are for basic syntax errors such as missing </Row> commands, for example. But this will not stop Modbuddy from building the mod, nor will you get any errors during the "Build" process relating to such a mistake. Nor does Modbuddy check nor know whether the data you stick into a <Row> command is garbage, or even if the table-names you attempt to use in your code are garbage.
 
Last edited:
I'm looking at the logs and I'm not really sure what to do next. Can you help me understand what the errors mean?
 

Attachments

  1. This error set is saying that there is no table called "Players" in the Gameplay database:
    Code:
    [2471396.268] [Gameplay] ERROR: no such table: Players
    [2471396.268] [Gameplay]: In Query - insert into Players('Domain', 'CivilizationType', 'LeaderType', 'CivilizationName', 'CivilizationIcon', 'LeaderName', 'LeaderIcon', 'CivilizationAbilityName', 'CivilizationAbilityDescription', 'CivilizationAbilityIcon', 'LeaderAbilityName', 'LeaderAbilityDescription', 'LeaderAbilityIcon', 'Portrait', 'PortraitBackground') values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
    [2471396.268] [Gameplay]: In XMLSerializer while updating table Players from file LP_NCR_Config.xml.
    File LP_NCR_Config.xml must therefore be attempting to load into the game's database under <Components> in the modinfo file, but it needs to be loading under <Settings>.
  2. This error means that "TRAIT_CIVILIZATION_UNIT_LP_NCR_RANGERS" never got successfully loaded into the game's database:
    Code:
    [2471396.284] [Gameplay] ERROR: Invalid Reference on Units.TraitType - "TRAIT_CIVILIZATION_UNIT_LP_NCR_RANGERS" does not exist in Traits
    If the trait was defined in the LP_NCR_Config.xml file, the error regarding table <Players> will be the root cause.
  3. If you are using Modbuddy to create the mod, <InGameActions> is equivalent to <Components>. <FrontEndActions> is equivalent to <Settings>.
 
I was trying to do what you said and use mod buddy to make LP_NCR_Config.xml a front end action but I seem to have broken something. When I try to enable my mod the button is grayed out and it says cannot enable because and it just gives me the file name of my entire mod.
 
I got the mod to enable again, and I solved my problem where the names of the text files showed up instead of the actual text in the game creation screen. However the icons are not correct and when I try to start the game I get a crash to desktop. The database log doesn't seem to have updated so I'm not sure how to fix the crashing issue.
 
we would need you to link to where the mod itself can be downloaded in order to give you any real help at this point. If the total zipped size of the mod is not too big you can just add it to a forum post. We need the mod as it is in the game's MODS folder zipped and linked rather than the modbuddy project.
 
  1. All that "Action Criteria" stuff is not helping. Get rid of it.
  2. Doing so reveals a whole new set of errors related to your mod:
    Code:
    [2608835.969] [Gameplay] ERROR: UNIQUE constraint failed: ModifierArguments.ModifierId, ModifierArguments.Name
    [2608835.969] [Gameplay]: While executing - 'insert into ModifierArguments('ModifierId', 'Name', 'Value') values (?, ?, ?);'
    [2608835.969] [Gameplay]: In XMLSerializer while inserting row into table insert into ModifierArguments('ModifierId', 'Name', 'Value') with  values (TRAIT_LP_INTERNATIONAL_TRADE_GAIN_GOLD, Amount, 3, ).
    [2608835.969] [Gameplay]: In XMLSerializer while updating table ModifierArguments from file LP_NCR__Tandi.xml
    [2608835.969] [Gameplay] ERROR: UNIQUE constraint failed: ModifierArguments.ModifierId, ModifierArguments.Name
    [2608835.969] [Gameplay] ERROR: FOREIGN KEY constraint failed
    [2608835.969] [Gameplay] ERROR: FOREIGN KEY constraint failed
    [2608835.969] [Gameplay]: Validating Foreign Key Constraints...
    [2608835.969] [Gameplay] ERROR: Invalid Reference on Adjacency_YieldChanges.AdjacentImprovement - "LP_SHARECROPPER_FARM" does not exist in Improvements
    [2608835.969] [Gameplay] ERROR: Invalid Reference on Adjacency_YieldChanges.AdjacentImprovement - "LP_SHARECROPPER_FARM" does not exist in Improvements
    [2608835.978] [Gameplay] ERROR: Invalid Reference on Improvements.TraitType - "TRAIT_CIVILIZATION_IMPROVEMENT_LP_SHARECROPPER_FARM" does not exist in Traits
    [2608835.978] [Gameplay] ERROR: Invalid Reference on Improvement_Adjacencies.ImprovementType - "IMPROVEMENT_LP_SHARECROPPER_FAR" does not exist in Improvements
    [2608835.978] [Gameplay] ERROR: Invalid Reference on Improvement_Adjacencies.ImprovementType - "IMPROVEMENT_LP_SHARECROPPER_FAR" does not exist in Improvements
    [2608835.985] [Gameplay] ERROR: Invalid Reference on Traits.TraitType - "TRAIT_LEADER_LP_TAND" does not exist in Types
  3. This set of error messages are actually for the same error and are reporting a violation within your code of a uniqueness requirement.
    Code:
    [2608835.969] [Gameplay] ERROR: UNIQUE constraint failed: ModifierArguments.ModifierId, ModifierArguments.Name
    [2608835.969] [Gameplay]: While executing - 'insert into ModifierArguments('ModifierId', 'Name', 'Value') values (?, ?, ?);'
    [2608835.969] [Gameplay]: In XMLSerializer while inserting row into table insert into ModifierArguments('ModifierId', 'Name', 'Value') with  values (TRAIT_LP_INTERNATIONAL_TRADE_GAIN_GOLD, Amount, 3, ).
    [2608835.969] [Gameplay]: In XMLSerializer while updating table ModifierArguments from file LP_NCR__Tandi.xml.
    [2608835.969] [Gameplay] ERROR: UNIQUE constraint failed: ModifierArguments.ModifierId, ModifierArguments.Name
    Here is the relevant portion of file LP_NCR__Tandi.xml:
    Code:
    <ModifierArguments>
    	<!-- CULTURE AND GOLD FOR INTERNATION TRADE ROUTES-->
    	<Row>
    		<ModifierId>TRAIT_LP_INTERNATIONAL_TRADE_GAIN_GOLD</ModifierId>
    		<Name>YieldType</Name>
    		<Value>YIELD_GOLD</Value>
    	</Row>
    	<Row>
    		<ModifierId>TRAIT_LP_INTERNATIONAL_TRADE_GAIN_GOLD</ModifierId>
    		<Name>Amount</Name>
    		<Value>1</Value>
    	</Row>
    	<Row>
    		<ModifierId>TRAIT_LP_INTERNATIONAL_TRADE_GAIN_GOLD</ModifierId>
    		<Name>Intercontinental</Name>
    		<Value>false</Value>
    	</Row>
    	<Row>
    		<ModifierId>TRAIT_LP_INTERNATIONAL_TRADE_GAIN_CULTURE</ModifierId>
    		<Name>YieldType</Name>
    		<Value>YIELD_CULTURE</Value>
    	</Row>
    	<Row>
    		<ModifierId>TRAIT_LP_INTERNATIONAL_TRADE_GAIN_GOLD</ModifierId>
    		<Name>Amount</Name>
    		<Value>3</Value>
    	</Row>
    	<Row>
    		<ModifierId>TRAIT_LP_INTERNATIONAL_TRADE_GAIN_GOLD</ModifierId>
    		<Name>Intercontinental</Name>
    		<Value>false</Value>
    	</Row>
    You probalby wanted the second set to all be for TRAIT_LP_INTERNATIONAL_TRADE_GAIN_CULTURE but the game does know that and merely sees the conflicting violation.
  4. These error messages are reporting essentially typo errors
    Code:
    [2608835.969] [Gameplay] ERROR: Invalid Reference on Adjacency_YieldChanges.AdjacentImprovement - "LP_SHARECROPPER_FARM" does not exist in Improvements
    [2608835.969] [Gameplay] ERROR: Invalid Reference on Adjacency_YieldChanges.AdjacentImprovement - "LP_SHARECROPPER_FARM" does not exist in Improvements
    [2608835.978] [Gameplay] ERROR: Invalid Reference on Improvement_Adjacencies.ImprovementType - "IMPROVEMENT_LP_SHARECROPPER_FAR" does not exist in Improvements
    [2608835.978] [Gameplay] ERROR: Invalid Reference on Improvement_Adjacencies.ImprovementType - "IMPROVEMENT_LP_SHARECROPPER_FAR" does not exist in Improvements
    [2608835.985] [Gameplay] ERROR: Invalid Reference on Traits.TraitType - "TRAIT_LEADER_LP_TAND" does not exist in Types
  5. You either have not defined this or you have defined it with a different name:
    Code:
    [2608835.978] [Gameplay] ERROR: Invalid Reference on Improvements.TraitType - "TRAIT_CIVILIZATION_IMPROVEMENT_LP_SHARECROPPER_FARM" does not exist in Traits
  6. You have it defined as "TRAIT_IMPROVEMENT_LP_SHARECROPPER_FARM" in your LP_NCR__Civilization.xml file.
  7. fixing all these as done in the linked updated mod allows the mod to run. there are still a couple places where your are getting "LOC_THIS_OR_THAT" but that is easy enough to chase down which "LOC_THIS_OR_THAT" is not defined in the InGame text file or which is designated as "LOC_THIS_OR_THAT" but you defined a tag for "LOC_THIS_AND_THAT"
  8. You also have some artwork Icon issues but I cannot really help there because I have not been able to firure out all those convoluted new Civ6 system blp and tex and such files and how they are supposed to work.
 
Back
Top Bottom