Creating a mod

JuniperBarry

Chieftain
Joined
Aug 28, 2021
Messages
9
I have been working on a mod to add a new civilization into the game. This is my first time modding I have gotten to a point where I debugged my code with 0 errors in the code but I get in game and the civilization does not appear on the menu I'm at a loss on what to do from here is there somewhere I can post my files and have someone review it and see where I went wrong?
 
You can attach your mod to a post on this very thread, assuming the total size of the zipped up version of the mod does not exceed the limits the forum will accept.

  1. Zip the version of the mod the game is actually trying to use, which will be found as a sub-folder in ~\Documents\My Games\Sid Meier's Civilization VI\Mods. Zip the whole sub-folder for your mod.
  2. To attach the zip to a forum post, look for a button called Upload A File when composing your thread reply: this button opens a browse menu where you can select the zipped folder to attach directly to a forum post.
Above assuming you are using a Windows PC and are not running from a Mac, about which I know nothing. But you can't run Modbuddy from a Mac so I assume you are using a Windows machine.
 
I did a quick look at your mod on Sinday but I did not have a chance to get back to you that evening or yesterday because of Real Life. Not sure I will be able to make a response this evening or not because Real Life Stuff is still in Real Life Sucks Mode.

Just wanted to drop a quick line to assure I did not forget you -- just having "things" going on that started Sunday afternoon.
 
Your most basic problem is that you've told the game to use files which are not part of your mod. From your modinfo file
Code:
  <FrontEndActions>
    <UpdateDatabase id="NewAction">
      <File>Core/Joshs_Template_Config.sql</File>
      <File>Core/Joshs_Template_Buildings.xml</File>
    </UpdateDatabase>
    <UpdateIcons id="NewAction">
      <File>Core/Joshs_Template_Icons.xml</File>
    </UpdateIcons>
    <UpdateText id="NewAction">
      <File>Core/Joshs_Template_GameText.xml</File>
    </UpdateText>
And
Code:
  <InGameActions>
    <UpdateDatabase id="NewAction">
      <File>Core/Joshs_Template_GameDefines.sql</File>
      <File>Core/Joshs_Template_Buildings.xml</File>
    </UpdateDatabase>
    <UpdateIcons id="NewAction">
      <File>Core/Joshs_Template_Icons.xml</File>
    </UpdateIcons>
    <UpdateText id="NewAction">
      <File>Core/Joshs_Template_GameText.xml</File>
    </UpdateText>
These however are the files the mod says are part of it
Code:
    <File>Core/Buildings.xml</File>
    <File>Core/Config.sql</File>
    <File>Core/GameDefines.sql</File>
    <File>Core/GameText.xml</File>
    <File>Core/Icons.xml</File>



Next, you've told the game your mod requires Rise and Fall but you have not told the game your Civ/Leader are valid for Rise and Fall.

This within your modinfo file tells the game that Rise and Fall are required
Code:
  <Dependencies>
    <Mod id="1B28771A-C749-434B-9053-D1380C553DE9" title="Expansion: Rise and Fall" />
  </Dependencies>
However, in your file Core/Config.sql you have told the game the Leader / Civ are only usable for the Vanilla Expansion of the game
Code:
INSERT INTO Players	
	(CivilizationType,			Portrait,					PortraitBackground,				LeaderType,			LeaderName,				LeaderIcon,				LeaderAbilityName,				LeaderAbilityDescription,					LeaderAbilityIcon,			CivilizationName,				CivilizationIcon,			CivilizationAbilityName,			CivilizationAbilityDescription,				CivilizationAbilityIcon)
VALUES	('CIVILIZATION_CIV_CUSTOM',		'LEADER_LEADER_CUSTOM_NEUTRAL.dds',		'LEADER_JOHN_CURTIN_BACKGROUND',		'LEADER_LEADER_CUSTOM',		'LOC_LEADER_LEADER_CUSTOM_NAME',	'ICON_LEADER_LEADER_CUSTOM',		'LOC_TRAIT_LEADER_LEADER_CUSTOM_ECO_NAME',	'LOC_TRAIT_LEADER_LEADER_CUSTOM_ECO_DESCRIPTION',		'ICON_LEADER_LEADER_CUSTOM',		'LOC_CIVILIZATION_CIV_CUSTOM_NAME',		'ICON_CIVILIZATION_CIV_CUSTOM',		'LOC_TRAIT_CIVILIZATION_GRIND_NAME',		'LOC_TRAIT_CIVILIZATION_GRIND_DESCRIPTION',		'ICON_CIVILIZATION_CIV_CUSTOM');


INSERT INTO PlayerItems	
	(CivilizationType,			LeaderType,		Type,			Icon,				Name,				Description,				SortIndex)
VALUES	('CIVILIZATION_CIV_CUSTOM',		'LEADER_LEADER_CUSTOM',	'BUILDING_CUSTOM',	'ICON_BUILDING_CUSTOM',		'LOC_BUILDING_CUSTOM_NAME',	'LOC_BUILDING_CUSTOM_DESCRIPTION',	30);
Since you have given no value for "Domain", the game will use the default value associated to the Vanilla (no expansions) version of the game for determining where this player is valid for use.

So you need to add this to get the Leader to be selectable when playing Rise and Fall
Code:
INSERT INTO Players	
	(Domain,	CivilizationType,			Portrait,					PortraitBackground,				LeaderType,			LeaderName,				LeaderIcon,				LeaderAbilityName,				LeaderAbilityDescription,					LeaderAbilityIcon,			CivilizationName,				CivilizationIcon,			CivilizationAbilityName,			CivilizationAbilityDescription,				CivilizationAbilityIcon)
VALUES	('Players:Expansion1_Players',	'CIVILIZATION_CIV_CUSTOM',		'LEADER_LEADER_CUSTOM_NEUTRAL.dds',		'LEADER_JOHN_CURTIN_BACKGROUND',		'LEADER_LEADER_CUSTOM',		'LOC_LEADER_LEADER_CUSTOM_NAME',	'ICON_LEADER_LEADER_CUSTOM',		'LOC_TRAIT_LEADER_LEADER_CUSTOM_ECO_NAME',	'LOC_TRAIT_LEADER_LEADER_CUSTOM_ECO_DESCRIPTION',		'ICON_LEADER_LEADER_CUSTOM',		'LOC_CIVILIZATION_CIV_CUSTOM_NAME',		'ICON_CIVILIZATION_CIV_CUSTOM',		'LOC_TRAIT_CIVILIZATION_GRIND_NAME',		'LOC_TRAIT_CIVILIZATION_GRIND_DESCRIPTION',		'ICON_CIVILIZATION_CIV_CUSTOM');


INSERT INTO PlayerItems	
	(Domain,	CivilizationType,			LeaderType,		Type,			Icon,				Name,				Description,				SortIndex)
VALUES	('Players:Expansion1_Players',	'CIVILIZATION_CIV_CUSTOM',		'LEADER_LEADER_CUSTOM',	'BUILDING_CUSTOM',	'ICON_BUILDING_CUSTOM',		'LOC_BUILDING_CUSTOM_NAME',	'LOC_BUILDING_CUSTOM_DESCRIPTION',	30);
For Gathering Storm the designation is 'Players:Expansion2_Players` for the Domain field. As a general rule in order to keep the game happy you should add the Vanilla "INSERTS" but for each of the two expansions you might want your leader to be able to play under you must add the INSERT with the Domain designations as I have shown.

Third, and related to number one, your mod is at this point a bit of a confused mess. The entire folder Neo Queen Serenity dated 8/25/21 does not seem to have anything in it you need or are using. The folder named NEO_QUEEN_SERENITY seems to be the only one that has anything in it that you are using. So, move the unnecessary folder completely out of the mod and stick it somewhere else directly in your "Documents" area. If I am wrong and there is some needed files within that folder, then at least you still can access that file if you move instead of delete the folder that does not appear to be doing anything for you.

There are more issues which will have to be worked through, but start there.
 
I fixed most of all you said I could not for the life of me fine this in the files I went through and ctr + f'd every file too

<Dependencies>
<Mod id="1B28771A-C749-434B-9053-D1380C553DE9" title="Expansion: Rise and Fall" />
</Dependencies>

But I also do not care if it has the dlc or not I do not think that is important is it? I did howerver go into mod buddy and in the Properties I removed the requirement I am unsure if that will fix the issue but with those fixes in place it still has not fixed it. Thank you so much for the information! Also, Looking through the files I had noticed that in icons for Civ_custom I had the wrong file name that did not exist in the version so I had changed the name to Civ_Custom to fix that issue hopefully!
 

Attachments

  • Neo 2.zip
    1.3 MB · Views: 18
These lines within the modifno file
Code:
<Dependencies>
<Mod id="1B28771A-C749-434B-9053-D1380C553DE9" title="Expansion: Rise and Fall" />
</Dependencies>
are generated by modbuddy when you do either of "Build" ModName or "Build Solution". You should be able to find the Dependancy setups under the "Associations" tab in Modbuddy (under "Properties" on the same page where you also select between FrontEnd and InGame actions).

Everything you set up in Modbuddy is added to the modinfo file which is what the game actually uses to execute the mod and the files within the mod. The modinfo file does not show up as part of a Modbuddy Project since the modinfo file is literally the "packaging up" of the various instructions you have given Modbuddy within the Project for the Mod.
 
  1. You need to open modbuddy.
  2. Open the mod solution (ie, what looks like the mod in modbuddy)
  3. Go to the Mod Properties tab
  4. Select the FrontEnd Actions button
  5. Open each of the actions listed there one at a time and
    • remove the files showing in that action that are not part of your mod (Josh_This and Josh_That for the most part)
    • use the add file button to add the correct file(s) for each action
  6. Select the inGame actions
  7. Repeat the process you did in the FrontEnd Actions to remove the incorrect file names and add the correct ones
  8. Save all your work
  9. Do a "Build Solution" under the "Build" menu of Modbuddy's top menu ribbon
  10. Check whether the mod now does anything when enabled or whether syntax errors are borking your code -- open Database.log at
    -\Documents\My Games\Sid Meier's Civilization VI\Logs
    and look for messages reporting errors after you have attempted to run your mod in-game.
If you don't think you will need the Dependancy to Rise and Fall, go to the Modbuddy "Associations" tab and delete it before you build your mod. You will still need to fix the issue with the "Players" and "PlayerItems" tables noted in my previous message(s). The Dependancy has nothing whatever to do with the need to state a seperate row in these two "Config" tables for each of the expansions in order for the leader / civ to be seen by the game as playable for that expansion.
 
Most recent build with the database.log Thank you so much for helping sorry if I'm being dumb I utilized a template and wanted to get it to somewhat work and improve the mod once I get it to finally work for now I was trying to keep it as close to their template as possible so then when I change things one at a time I know what broke by being added.


[2828846.126] [Localization]: StartupErrorMessages.xml
[2828846.127] [Localization]: Input XML does not contain database entry tags. GameData, GameInfo or Database
[2828850.668] [Localization]: Validating Foreign Key Constraints...
[2828850.669] [Localization]: Passed Validation.
[2828850.818] [Configuration]: Validating Foreign Key Constraints...
[2828850.818] [Configuration]: Passed Validation.
[2828852.763] [FullTextSearch]: Initializing FullTextSearch
[2828853.985] [Gameplay]: Validating Foreign Key Constraints...
[2828854.001] [Gameplay]: Passed Validation.
[2828854.387] [Configuration] ERROR: no such table: Types
[2828854.387] [Configuration]: In Query - insert into Types('Type', 'Kind') values (?, ?);
[2828854.391] [Configuration]: In XMLSerializer while updating table Types from file Buildings.xml.
[2828854.396] [Configuration] ERROR: no such table: Types
[2828857.149] [Configuration]: Validating Foreign Key Constraints...
[2828857.149] [Configuration]: Passed Validation.
[2828859.818] [HallofFame]: Database found. Checking versions...
[2828859.828] [HallofFame]: Database is up-to-date!
[2828893.344] [FullTextSearch]: FTS - Creating Context
[2828925.771] [FullTextSearch]: FTS - Creating Context
[2828949.409] [FullTextSearch]: FullTextSearch - Shutting down
 

Attachments

  • Neo 3.rar
    1.2 MB · Views: 21
Code:
[2828854.387] [Configuration] ERROR: no such table: Types
[2828854.387] [Configuration]: In Query - insert into Types('Type', 'Kind') values (?, ?);
[2828854.391] [Configuration]: In XMLSerializer while updating table Types from file Buildings.xml.
[2828854.396] [Configuration] ERROR: no such table: Types
This error stems from the methods in the original template. Your Buildings file is being loaded into the FrontEnd database, but the code in that file does not belong there. You only want and need the Buildings.xml file loaded under the InGame Actions.

There are several bad templates banging around the internet (of which the Josh Atkins template is one) that have this mistake. Which stems from a poor understanding by the template-makers of how the game actually works, and leads to novice modders following this mistake and then getting confusing but actually meanginless error messages in Database,log.

You do not want the GameDefines.sql in the FrontEnd UpdateDatabase action, either. Config.sql is the only file you want under the FrontEnd Updatedatabase action.

If you do not edit the Config.sql file to add the code I demonstrated upthread for tables "Players" and "PlayerItems", then your leader / civ will only ever show up as a choice when running the Vanilla version of the game.
 
Last edited:
The civilization is finally at least appearing but with a question mark over Icon and a name of LEADER_LEADER_CUSTOM_NAME and when I try to launch the Civilization the game crashes I made a few changes to see if that'd fix the icon problem and nothing on that means this is what I have changed

Code:
INSERT INTO PlayerItems   
        (Domain,                            Domain,                                CivilizationType,                LeaderType,                    Type,                            Icon,                        Name,                                Description,                                SortIndex)
VALUES    ('Players:Expansion2_Players'        'Players:Expansion1_Players'        'CIVILIZATION_CIV_CUSTOM',        'LEADER_LEADER_CUSTOM',        'BUILDING_CUSTOM',                'ICON_BUILDING_CUSTOM',        'LOC_BUILDING_CUSTOM_NAME',            'LOC_BUILDING_CUSTOM_DESCRIPTION',            30);

Code:
INSERT INTO Players   
        (Domain,                            Domain,                                    CivilizationType,                    Portrait,                                    PortraitBackground,                    LeaderType,                    LeaderName,                                LeaderIcon,                    LeaderAbilityName,                            LeaderAbilityDescription,                                LeaderAbilityIcon,                CivilizationName,            CivilizationIcon,        CivilizationAbilityName,                    CivilizationAbilityDescription,                            CivilizationAbilityIcon)
VALUES    ('Players:Expansion2_Players',        'Players:Expansion1_Players',            'CIVILIZATION_CIV_CUSTOM',            'FALLBACK_NEUTRAL_LEADER_CUSTOM.dds',        'ART_LEADER_LEADER_CUSTOM.dds',        'LEADER_LEADER_CUSTOM',        'LOC_LEADER_LEADER_CUSTOM_NAME',        'ICON_LEADER_CUSTOM',        'LOC_TRAIT_LEADER_LEADER_CUSTOM_ECO_NAME',        'LOC_TRAIT_LEADER_LEADER_CUSTOM_ECO_DESCRIPTION',        'ICON_LEADER_LEADER_CUSTOM',        'Neo Queen Serenity',        'ICON_CIV_CUSTOM',        'LOC_TRAIT_CIVILIZATION_GRIND_NAME',        'LOC_TRAIT_CIVILIZATION_GRIND_DESCRIPTION',                'ICON_CIVILIZATION_CIV_CUSTOM');
 
I have been trying a lot of things and I am not getting things to pop up anymore.

[2909863.552] [Localization]: StartupErrorMessages.xml
[2909863.552] [Localization]: Input XML does not contain database entry tags. GameData, GameInfo or Database
[2909866.423] [Localization]: Validating Foreign Key Constraints...
[2909866.424] [Localization]: Passed Validation.
[2909866.437] [Configuration]: Validating Foreign Key Constraints...
[2909866.438] [Configuration]: Passed Validation.
[2909867.122] [FullTextSearch]: Initializing FullTextSearch
[2909867.505] [Gameplay]: Validating Foreign Key Constraints...
[2909867.518] [Gameplay]: Passed Validation.
[2909868.370] [Configuration]: Validating Foreign Key Constraints...
[2909868.370] [Configuration]: Passed Validation.
[2909869.382] [HallofFame]: Database found. Checking versions...
[2909869.384] [HallofFame]: Database is up-to-date!
[2909884.195] [FullTextSearch]: FTS - Creating Context
[2909901.546] [FullTextSearch]: FTS - Creating Context
[2909910.919] [FullTextSearch]: FullTextSearch - Shutting down
 

Attachments

  • Neo 4.rar
    1.2 MB · Views: 18
Code:
- Players
-------------------------------------	
INSERT INTO Players	
	(Domain,			 CivilizationType,		Portrait,				PortraitBackground,			LeaderType,			LeaderName,				LeaderIcon,			LeaderAbilityName,				LeaderAbilityDescription,				LeaderAbilityIcon,		CivilizationName,			CivilizationIcon,			CivilizationAbilityName,		CivilizationAbilityDescription,			CivilizationAbilityIcon)
VALUES	('Players:StandardPlayers',	'CIVILIZATION_CIV_CUSTOM',	'LEADER_LEADER_CUSTOM_NEUTRAL.dds',	'LEADER_JOHN_CURTIN_BACKGROUND',	'LEADER_LEADER_CUSTOM',		'LOC_LEADER_LEADER_CUSTOM_NAME',	'ICON_LEADER_LEADER_CUSTOM',	'LOC_TRAIT_LEADER_LEADER_CUSTOM_ECO_NAME',	'LOC_TRAIT_LEADER_LEADER_CUSTOM_ECO_DESCRIPTION',	'ICON_LEADER_LEADER_CUSTOM',	'LOC_CIVILIZATION_CIV_CUSTOM_NAME',	'ICON_CIVILIZATION_CIV_CUSTOM',		'LOC_TRAIT_CIVILIZATION_GRIND_NAME',	'LOC_TRAIT_CIVILIZATION_GRIND_DESCRIPTION',	'ICON_CIVILIZATION_CIV_CUSTOM'),
	('Players:Expansion1_Players',	'CIVILIZATION_CIV_CUSTOM',	'LEADER_LEADER_CUSTOM_NEUTRAL.dds',	'LEADER_JOHN_CURTIN_BACKGROUND',	'LEADER_LEADER_CUSTOM',		'LOC_LEADER_LEADER_CUSTOM_NAME',	'ICON_LEADER_LEADER_CUSTOM',	'LOC_TRAIT_LEADER_LEADER_CUSTOM_ECO_NAME',	'LOC_TRAIT_LEADER_LEADER_CUSTOM_ECO_DESCRIPTION',	'ICON_LEADER_LEADER_CUSTOM',	'LOC_CIVILIZATION_CIV_CUSTOM_NAME',	'ICON_CIVILIZATION_CIV_CUSTOM',		'LOC_TRAIT_CIVILIZATION_GRIND_NAME',	'LOC_TRAIT_CIVILIZATION_GRIND_DESCRIPTION',	'ICON_CIVILIZATION_CIV_CUSTOM'),
	('Players:Expansion2_Players',	'CIVILIZATION_CIV_CUSTOM',	'LEADER_LEADER_CUSTOM_NEUTRAL.dds',	'LEADER_JOHN_CURTIN_BACKGROUND',	'LEADER_LEADER_CUSTOM',		'LOC_LEADER_LEADER_CUSTOM_NAME',	'ICON_LEADER_LEADER_CUSTOM',	'LOC_TRAIT_LEADER_LEADER_CUSTOM_ECO_NAME',	'LOC_TRAIT_LEADER_LEADER_CUSTOM_ECO_DESCRIPTION',	'ICON_LEADER_LEADER_CUSTOM',	'LOC_CIVILIZATION_CIV_CUSTOM_NAME',	'ICON_CIVILIZATION_CIV_CUSTOM',		'LOC_TRAIT_CIVILIZATION_GRIND_NAME',	'LOC_TRAIT_CIVILIZATION_GRIND_DESCRIPTION',	'ICON_CIVILIZATION_CIV_CUSTOM');


-------------------------------------
-- PlayerItems
-------------------------------------	
INSERT INTO PlayerItems	
	(Domain,			CivilizationType,		LeaderType,		Type,			Icon,				Name,				Description,				SortIndex)
VALUES	('Players:StandardPlayers',	'CIVILIZATION_CIV_CUSTOM',	'LEADER_LEADER_CUSTOM',	'BUILDING_CUSTOM',	'ICON_BUILDING_CUSTOM',		'LOC_BUILDING_CUSTOM_NAME',	'LOC_BUILDING_CUSTOM_DESCRIPTION',	30),
	('Players:Expansion1_Players',	'CIVILIZATION_CIV_CUSTOM',	'LEADER_LEADER_CUSTOM',	'BUILDING_CUSTOM',	'ICON_BUILDING_CUSTOM',		'LOC_BUILDING_CUSTOM_NAME',	'LOC_BUILDING_CUSTOM_DESCRIPTION',	30),
	('Players:Expansion2_Players',	'CIVILIZATION_CIV_CUSTOM',	'LEADER_LEADER_CUSTOM',	'BUILDING_CUSTOM',	'ICON_BUILDING_CUSTOM',		'LOC_BUILDING_CUSTOM_NAME',	'LOC_BUILDING_CUSTOM_DESCRIPTION',	30);
Tourism is not a Yield
Code:
<Row BuildingType="BUILDING_GAME_CENTER_CROWN" YieldType="YIELD_TOURISM" YieldChange="4"/>
None of these are defined anywhere nor linked to the civilization or leader
Code:
TraitType="TRAIT_BUILDING_JUBAN_MUNICIPAL_HIGH_SCHOOL"/>
TraitType="TRAIT_BUILDING_HIKAWA_SHRINE"/>
TraitType="TRAIT_BUILDING_GAME_CENTER_CROWN"/>
This trait is defined but is then never used for anything once linked to the civilization
Code:
('TRAIT_CIVILIZATION_BUILDING_CUSTOM',							'CIVILIZATION_CIV_CUSTOM');
 
So I have been digging around the code trying to at least get rid of as many discrepancies as I can The Icon is still not showing also is it this like the code that determines leader name?

Code:
<!--LEADER-->
        <Row Tag="LOC_LEADER_LEADER_CUSTOM__NAME" Language="en_US">
            <Text>Neo Queen Serenity</Text>
        </Row>
also most recent build
 

Attachments

  • Neo 5.zip
    1.3 MB · Views: 15
LOC_LEADER_LEADER_CUSTOM_NAME should be the tag the game will use to look up the actual name of the leader since you have specified it here
Code:
NSERT INTO Leaders	
	(LeaderType,			Name,					InheritFrom,		SceneLayers)
VALUES	('LEADER_LEADER_CUSTOM',	'LOC_LEADER_LEADER_CUSTOM_NAME',	'LEADER_DEFAULT',	4);
The double LEADER in the LeaderType tag-name might be causing trouble with the ingame icons since there is a lot of assumed naming convention coding within the UI files that display the leader, building, etc., icons. Most likely though the icon problem is in the art and/or dep which is where my expertise comes to a screeching halt.
 
I just noticed there was a lot of double underscores. I used ctrl h and replaces all __ with just _ that fixed the name issue now the icons XD
 
The name is fixed there is still a question mark in Icons but all the naming conventions are fixed I launch the game and game crashes which log file should i look into to figure out why it is?
This is out of modding.log
UpdateDatabase - Loading Core/Buildings.xml
[3150804.008] Warning: UpdateDatabase - Error Loading XML.
[3150804.008] UpdateDatabase - Loading Core/GameDefines.sql
[3150804.010] Warning: UpdateDatabase - Error Loading SQL.
[3150804.010] Applying Component - NewAction (UpdateIcons)
 
Top Bottom