[R&F] Editing existing civilization mod

Rick_88

Chieftain
Joined
Apr 27, 2018
Messages
22
I'm trying to edit JFD's Italy civilization mod to replace Benito Mussolini with Sukritact's Lorenzo de Medici (Florence) mod, which is based on former. This is because unfortunately Sukritact's mod doesn't work, in that when you select Lorenzo de Medici as a leader, the game starts without Italy in the first place and you only get to watch.
[Does anyone know how to solve that?]

Not knowing how to solve that, I tried replacing Mussolini with Lorenzo de Medici in the original mod by JFD. I'm new to Civ modding, but not to programming, so I thought I would give it a go.
I understand the important files are in Core/, but upon changing the tags with the respective counterparts, I get no changes at all. Not even the name of the leader, which I think is defined in gametext.xml file, changes when I launch the game.

Same for the images/icons of the leader, although I've added the new ArtDefs, LeaderFallbacks etc.

Am I missing something...?
(Clearly I am!)


Thanks for the help!
 
Hi Raen, thanks for the reply.
I've been having a look at your handy guide already. But also the structure of the mod is already in place, I mostly just need to change tags and parameters.
I just don't get why the changes I've been making are not reflected at all in the game?
 
Well okay, let's start with the basics. Say I just want to change the name of the leader, so that it appears on the list from which a player can choose.
The only file in which I can see the name of the leader written out as a string is ItalyMussolini_gametext.xml, which say

<GameData>
<LocalizedText>
<Row Tag="LOC_LEADER_JFD_MUSSOLINI_NAME" Language="en_US">
<Text>Benito Mussolini</Text>
</Row>
....

So even if I keep the same tag, but change the text, shouldn't that be reflected in the game's leader list?
 
Okay, it's very strange because now I tried starting from scratch and that name change worked!
Hmm, I must have made some mistake elsewhere that clashed with the tag.
 
The first question is always going to be "What is showing in file Database.log ?"

Database.log is found in folder C:\Users\[YourNameGoesHere]\Documents\My Games\Sid Meier's Civilization VI\Logs

You need to ensure no syntax, unique constraint, or invalid reference errors are showing in Database.log related to the SQL or XML files you are altering. Unfortunately Database.log does not specify which file is generating an error when using SQL, so you have to compare the timestamp in Database.log to the timestamps in Modding.log to determine which file(s) the game was attempting to load into the database at or just before the timestamp shown in Database.log

---------------------------------------

Also bear in mind that the game has two databases into which SQL and XML code is implemented (plus the language localization ones). The two databases for non-language code are "FrontEnd" and "InGame". The FrontEnd database handles everything up to the point where the user clicks the "Start Game" or "Load Saved Game" buttons, so if a leader or civ is not showing in the Civilization/Leader selection screens, there is a problem in the code of the mod in its files that are being loaded into the FrontEnd database. If the Civilization/Leader appear in the selection screens but are not present or are showing problems after the player clicks the "Start Game" button, then the problem is in the files that are being loaded into the database in the InGame actions.

Leader arts and the like as I recall also have to be loaded within their proper "environment": FrontEnd or InGame.

Language text files like "real" database files also have to be loaded into their proper environment: FrontEnd or InGame.

JFD's original mod should have all these issues with FrontEnd and InGame properly set-up in the modinfo file which controls what the game does with the mod. I mention these issues for reference since you said you are not XP'd with Civ6 modding.
 
Also there can be issues with "caching", esp for info in the <LocalizedText> table if you "fix" an error in a file by editing the XML file but do not completely exit the game. The change will be saved into the XML file for example, but the change may not be loaded into the FrontEnd language database if you just return to the main menu, open the text XML file to make your changes, but never completely exit the game.
 
Hi LeeS,

thank you for your reply. That info on the log files is really useful!

I have an issue with the actual leader images at the moment. The mod comes of course with Texture files of Mussolini, while I want to exchange them with the ones for de Medici.
I have literally removed the Mussolini portrait (LEADER_JFD_MUSSOLINI_NEUTRAL.dds) and small icon portrait (mussolini265.dds) and replaced them with the de Medici ones, which I renamed exactly the same so as to avoid filename conflicts (they are then still called LEADER_JFD_MUSSOLINI_NEUTRAL and mussolini265.
However, I still get Mussolini's face in the game menu.

Are these images controlled elsewhere other than in Textures/ (where I made the changes), or did I just do something wrong? :)
 
So, from my understanding .tex files simply call .dds files, right? So I left them untouched.

I have the pre-existing Mussolini .dds images, and I also have Sukritact's de Medici's .dds images. What I did was to simply swap them leaving the original filenames so the .tex files do not need amending.
Am I on the right path here?

So because I swapped the images leaving the filenames and .tex files untouched, I thought the game would automatically load the new (de medici's) images, but I still get Mussolini.


I hope I was clear enough!

And no, I don't have Modbuddy as I didn't purchase the game through Steam :(
 
So essentially it needs to compile with the new images, if I understood you correctly?

Also, how do you "break" it, and how do you know if the replacement images are plain dds?
 
Yes, you generate the tex files with ModBuddy, and all icons in BLP format.

The breaking part is in leaders.artdef and and fallbackleaders.artdef, you have to do some like I did in 16.4 version of Portugal. That and seeing where dds are being used in my mod version, does it I think.
 
I understand.

Could you explain how you break it in leaders.artdef and fallbackleaders.artdef, if you have the time?
I'd really like it to get working, and the only other option is to have somebody else (with Modbuddy) to build it for me, I'm guessing.
 
Last edited:
Yes, it was clear, thank you.

But I've been slightly side-tracked by an error that makes the mod crash. I have reached, I believe, the error that made the original mod crash, too.

The error in database.log is:
[880842.900] [Gameplay] ERROR: Invalid Reference on Modifiers.SubjectRequirementSetId - "SUK_LAURENTIAN_LIBRARY_HAS_BUILDING_JFD_DUOMO" does not exist in RequirementSets


This is the section of the file that is of concern. It does indeed look a bit messy, and RequirementSetRequirements seems like it has an extra part pasted by mistake in it.
I've tried tinkering with it, but I am not too sure what it should look like exactly, so I thought best to ask.


-------------------------------------
-- ModifierArguments
-------------------------------------
INSERT INTO ModifierArguments
(ModifierId, Name, Value)
VALUES ('SUK_LAURENTIAN_LIBRARY_AMPHITHEATRE', 'BuildingType', 'BUILDING_AMPHITHEATER'),
('SUK_LAURENTIAN_LIBRARY_AMPHITHEATRE', 'GreatWorkSlotType', 'GREATWORKSLOT_WRITING'),
('SUK_LAURENTIAN_LIBRARY_AMPHITHEATRE', 'Amount', 1),
('SUK_LAURENTIAN_LIBRARY_DUOMO', 'BuildingType', 'BUILDING_JFD_DUOMO'),
('SUK_LAURENTIAN_LIBRARY_DUOMO', 'GreatWorkSlotType', 'GREATWORKSLOT_ART'),
('SUK_LAURENTIAN_LIBRARY_DUOMO', 'Amount', 1),
('SUK_LAURENTIAN_LIBRARY_MUSEUM_ART', 'BuildingType', 'BUILDING_MUSEUM_ART'),
('SUK_LAURENTIAN_LIBRARY_MUSEUM_ART', 'GreatWorkSlotType', 'GREATWORKSLOT_ART'),
('SUK_LAURENTIAN_LIBRARY_MUSEUM_ART', 'Amount', 1),
('SUK_LAURENTIAN_LIBRARY_MUSEUM_ARTIFACT', 'BuildingType', 'BUILDING_MUSEUM_ARTIFACT'),
('SUK_LAURENTIAN_LIBRARY_MUSEUM_ARTIFACT', 'GreatWorkSlotType', 'GREATWORKSLOT_ARTIFACT'),
('SUK_LAURENTIAN_LIBRARY_MUSEUM_ARTIFACT', 'Amount', 1),
('SUK_LAURENTIAN_LIBRARY_BROADCAST_CENTER', 'BuildingType', 'BUILDING_BROADCAST_CENTER'),
('SUK_LAURENTIAN_LIBRARY_BROADCAST_CENTER', 'GreatWorkSlotType', 'GREATWORKSLOT_MUSIC'),
('SUK_LAURENTIAN_LIBRARY_BROADCAST_CENTER', 'Amount', 1);
-------------------------------------
-- RequirementSets
-------------------------------------
INSERT INTO RequirementSets
(RequirementSetId, RequirementSetType)
SELECT 'SUK_LAURENTIAN_LIBRARY_HAS_' || BuildingType, 'REQUIREMENTSET_TEST_ALL'
FROM Buildings WHERE BuildingType IN ('BUILDING_AMPHITHEATER', 'BUILDING_JFD_DUOMO', 'BUILDING_MUSEUM_ART', 'BUILDING_MUSEUM_ARTIFACT', 'BUILDING_BROADCAST_CENTER');
-------------------------------------
-- RequirementSetRequirements
-------------------------------------
INSERT INTO RequirementSetRequirements
(RequirementSetId, RequirementId)
SELECT 'SUK_LAURENTIAN_LIBRARY_HAS_' || BuildingType, 'SUK_LAURENTIAN_LIBRARY_HAS_' || BuildingType || '_REQUIREMENT'
FROM Buildings WHERE BuildingType IN ('BUILDING_AMPHITHEATER', 'BUILDING_JFD_DUOMO', 'BUILDING_MUSEUM_ART', 'BUILDING_MUSEUM_ARTIFACT', 'BUILDING_BROADCAST_CENTER');
-------------------------------------
-- Requirements
-------------------------------------
INSERT INTO Requirements
(RequirementId, RequirementType)
SELECT 'SUK_LAURENTIAN_LIBRARY_HAS_' || BuildingType || '_REQUIREMENT', 'REQUIREMENT_CITY_HAS_BUILDING'
FROM Buildings WHERE BuildingType IN ('BUILDING_AMPHITHEATER', 'BUILDING_JFD_DUOMO', 'BUILDING_MUSEUM_ART', 'BUILDING_MUSEUM_ARTIFACT', 'BUILDING_BROADCAST_CENTER');
-------------------------------------
-- RequirementArguments
-------------------------------------
INSERT INTO RequirementArguments
(RequirementId, Name, Value)
SELECT 'SUK_LAURENTIAN_LIBRARY_HAS_' || BuildingType || '_REQUIREMENT', 'BuildingType', BuildingType
FROM Buildings WHERE BuildingType IN ('BUILDING_AMPHITHEATER', 'BUILDING_JFD_DUOMO', 'BUILDING_MUSEUM_ART', 'BUILDING_MUSEUM_ARTIFACT', 'BUILDING_BROADCAST_CENTER');
 
Actually, I've tried removing all instances of SUK_LAURENTIAN_LIBRARY_HAS_BUILDING_JFD_DUOMO from that snippet I posted, and the mod works. So given that the other SUK_LAURENTIAN_LIBRARY_HAS_BUILDING_*** work, the problem seems that BUILDING_JFD_DUOMO (a unique building introduced by JFD's original Italy mod) is not properly defined. But I'm really not quite sure where it should be defined!
This is the link to the file, if you would like to take a look: https://drive.google.com/open?id=1YNAZ-ixPkSbVReC2kdfvpaDANHRLkUWV

Also, I've had a look at your Leaders.artdef and leaderfallbacks.artdef and they are practically identical to JFD's. So even after using your files (with only 1 leader, and the correct filename) I still get Mussolini's face looking at me. Help? :p
 
Last edited:
Also, I've had a look at your Leaders.artdef and leaderfallbacks.artdef and they are practically identical to JFD's. So even after using your files (with only 1 leader, and the correct filename) I still get Mussolini's face looking at me. Help? :p


Are you sure you downloaded the right version? since the "older" version (16.4) has commented areas with <!-- -->
 
Back
Top Bottom