First Civ Modding Attempt. NEED Help Coding

679x

Warlord
Joined
Mar 30, 2017
Messages
289
Hey, I'm new to coding and all that, never attempted it before, and I'm trying to make a new civilization/leader. I've been following the tutorials of a youtuber named Keniisu who is making tutorials for how to create this type of mod, but he currently only has 1 video on the subject. I watched that video and it helped a lot, but that was just for the ModBuddy aspect of creating a civ/leader, and I don't know what to do next in order to actually make my civilization do what I want it to do.

I'm trying to make a mod that gets extra gold for each type of district that is built in the Capital, and also gets Tourism from Commercial Hubs and their buildings (in all cities). However, I have no idea how to go about doing this.

So far, I've done the ModBuddy Civilization/Leader project aspect, but that doesn't include coding for actually making a trait; it just seems to include the technical stuff like text, city names, new leader's name, etc. I've also done the ModBuddy for creating a new building, and that seemed to go well. It was a simple building replacement, so I was able to just look at Civ 6's own coding and copy what I needed, and re-write what I wanted to change.

Anyway, my idea for the easiest possible method of making my leader/civ traits was to copy the code for Commercial Hubs/Markets/Banks/Stock Exchanges and add tourism as a yield for each, but I don't know which code to copy -- code of all districts and all buildings is jumbled up together in the xml files, which makes it difficult to isolate the code for a single building type -- and I also don't know what code to write in order for this change to only apply to my new mod civilization and not all other civilizations as well.

The next issue I have is that I don't know how to make the 'gold from districts' bonus only apply to the Capital city and not all other cities.

I think the major problem here is that I don't know how to create a mod lol. If anyone can help me resolve my issues, I'd be able to create my first mod, and hopefully any info I receive can be used in future mod attempts.

Thanks in advance.
 
i suggest reading this:
https://nycholusv.com/guides/using-modifiers/chapter-1/
as well as chapter 2, it explains the modifier system quite well,
and modifiers are what you will be using most for something like that

in your case(this will probably only make sense after reading the tutorial)
you might want to use these DynamicModifiers:

MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_PER_DISTRICT
or
MODIFIER_PLAYER_DISTRICT_ADJUST_YIELD_CHANGE
for the extra gold

and

MODIFIER_PLAYER_DISTRICT_ADJUST_TOURISM_CHANGE
for the tourism
 
i suggest reading this:
https://nycholusv.com/guides/using-modifiers/chapter-1/
as well as chapter 2, it explains the modifier system quite well,
and modifiers are what you will be using most for something like that

in your case(this will probably only make sense after reading the tutorial)
you might want to use these DynamicModifiers:

MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_PER_DISTRICT
or
MODIFIER_PLAYER_DISTRICT_ADJUST_YIELD_CHANGE
for the extra gold

and

MODIFIER_PLAYER_DISTRICT_ADJUST_TOURISM_CHANGE
for the tourism
Thanks for the reply. I have no idea what I'm doing lol, can you post what the code should look like, if you don't mind? I need to know how it should be written, or else I won't know whether I'm doing it right or not.

I want 4 extra gold from the districts in the capital, and 2 tourism from the commercial district and its buildings. What would I write for the code?

Thanks again.
 
ill do the first part and explain it somewhat

so first, for something like this we need a modifier, you can think of it like an effect/ability something has
we create a modifier and call it "LEADER_TRAIT_DISTRICT_GOLD" (you can name it what you want, you just have to stick with that name)
<Modifiers>
<Row>
<ModifierId>LEADER_TRAIT_DISTRICT_GOLD</ModifierId>
<ModifierType>MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_PER_DISTRICT</ModifierType>
</Row>
</Modifiers>
ModifierType tells the game what kind of modifier we want, each modifiertype has an effect(what does it do) and a collection(who is the target)
for the modifiertype MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_PER_DISTRICT the effect is increasing the yield in a city based on the amount of districts
and the collection are all player cities

next we need to give the modifier its arguments
<ModifierArguments>
<Row>
<ModifierId>LEADER_TRAIT_DISTRICT_GOLD</ModifierId>
<Name>YieldType</Name>
<Value>YIELD_GOLD</Value>
</Row>
<Row>
<ModifierId>LEADER_TRAIT_DISTRICT_GOLD</ModifierId>
<Name>Amount</Name>
<Value>4</Value>
</Row>
</ModifierArguments>
first part tells the modifier which yield it should increase, second part tells him how much (per district)

now the modifier we need exits, any player who gets to "own" this modifier will get 4 gold per district in each of his cities
since you want this modifier to come with a specific leader trait you need this:

<TraitModifiers>
<Row>
<TraitType>TRAIT_LEADER_MEDITERRANEAN</TraitType>
<ModifierId>LEADER_TRAIT_DISTRICT_GOLD</ModifierId>
</Row>
</TraitModifiers>

(TRAIT_LEADER_MEDITERRANEAN is the leadertrait that is assiciated with Cleopatra, you can put here whichever trait you want)

I hope this gives you an example to go from, ill try to help if you have more questions
 
Thanks for the reply. I have no idea what I'm doing lol, can you post what the code should look like, if you don't mind? I need to know how it should be written, or else I won't know whether I'm doing it right or not.

I want 4 extra gold from the districts in the capital, and 2 tourism from the commercial district and its buildings. What would I write for the code?

Thanks again.
i suggest reading this:
https://nycholusv.com/guides/using-modifiers/chapter-1/
as well as chapter 2, it explains the modifier system quite well,
and modifiers are what you will be using most for something like that

in your case(this will probably only make sense after reading the tutorial)
you might want to use these DynamicModifiers:

MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_PER_DISTRICT
or
MODIFIER_PLAYER_DISTRICT_ADJUST_YIELD_CHANGE
for the extra gold

and

MODIFIER_PLAYER_DISTRICT_ADJUST_TOURISM_CHANGE
for the tourism

had to ready a couple of times, but it's starting to make sense
 
I hope this gives you an example to go from, ill try to help if you have more questions
Thank you so much!! With your help, and with looking through the code files of Civ 6 and 2 mods that I downloaded to see how it worked, I wrote code for the leader ability, civilization ability, and the unique unit ability (the latter of which was nothing fancy, just extra combat strength in friendly territory...)

How do I test out these components to see whether I did it properly? If I tried to play my new civilization in-game, I'm assuming it'd just crash because the civilization's essential components aren't complete -- I haven't given the civ its colours yet, and I'm sure there's more on top of that that I haven't done yet.

Anyway, thanks again for helping, Aldollin :)
 
You could attach the modifiers to something else, for example another leaders trait (one from the base game)
then see if the modifiers work by playing that civ (starting the game in a late era makes it easy testing stuff)

for crashes, there is a "Logs" folder under Documents\My Games\Sid Meier's Civilization VI and in that a "Database" file
if you fail to start a game with your mod(shows "start game" then goes back to menu is what usualy happens) this file will show you what went wrong
 
You could attach the modifiers to something else, for example another leaders trait (one from the base game)
then see if the modifiers work by playing that civ (starting the game in a late era makes it easy testing stuff)

for crashes, there is a "Logs" folder under Documents\My Games\Sid Meier's Civilization VI and in that a "Database" file
if you fail to start a game with your mod(shows "start game" then goes back to menu is what usualy happens) this file will show you what went wrong
Ok, so I disabled all other mods and played as my leader in a duel-size pangaea. After displaying the loading message for a relatively short period, my game crashes. It doesn't show 'start game' and doesn't go back to the menu -- the entire game crashes (I'm assuming it crashes when 'start game' would normally appear.)

I checked the Database log and it had 3 errors, so I did some tinkering with my files and then there were no errors, so I tried it again, but the game is still crashing with no errors on the database log file. After fixing the errors, I get a message saying "Civilization VI has quit unexpectedly." or something along those lines when the game crashes. Before fixing the errors, I didn't get that message. I'm on a Mac and have been coding on Parallels, which is an app that lets you run Windows on a Mac, but I highly doubt that's the problem.

From looking at the Modding log, I don't see anything related to my mod. It's a long file to read through, and I found errors for other modded leaders that I had installed, but they were related to textures/images and I played using that mod with no problems, so I don't think that's the issue, either.

What could be the problem?

EDIT/UPDATE 1: After posting this original reply, I tried playing as Spain and making the AI play as my mod. The game loaded properly, and I was able to settle my capital. But when I settled my capital, I instantly won a Domination victory (and got achievements for it, lol)

In addition, when I looked at the replay, there were only 4 civilizations (Spain, and 3 city states) in the replay. There should be 2 civilizations and 3 city states. This means that my mod leader didn't seem to be in the game when it loaded. I'm assuming this is the problem that I encountered when I tried to play as the mod leader, the only difference being that this time, it was the AI that experienced the issues rather than myself.

EDIT/UPDATE 2: In order to make this mod, I was following a Civ 6 modding tutorial video series (the only one on Youtube as far as I know) and the uploader just released a new video today that fixed an issue with his other video. I think this issue was the one that was preventing me from playing as my civ earlier today. But now, I am able to load the game as Monaco, my new civilization :)

However, there are a few issues that I didn't expect:

-the capital city's name is "LOC_CIVLIZATION_CW_MONACO_CITY_1", and yes, 'civilization' is supposed to be spelt wrong, because that's what it says in-game.
-the tourism from my unique building does not work.
-the Leader Ability (gold from districts in the capital) does not work.
-the unique building shows up on the list of things to build too early. It shouldn't show up until the required tech is researched -- but I think I know how to fix that, not 100% sure.
-my unique unit doesn't even show up at all, e.g. it isn't in the Civilopedia, but my building is.

Regarding the unique building tourism issue, if I remember correctly, I added PSEUDOYIELD_TOURISM to the list of yields from my unique building. Is that wrong? I looked through Civ 6's files and found PSEUDOYIELD_TOURISM or something like that, so I used it as a yield for my building, along with +2 culture. Note that the culture works but the tourism does not.
 
Last edited:
nice for you getting it to work, i have some ideas what could be causing your problems:

-the capital city's name is "LOC_CIVLIZATION_CW_MONACO_CITY_1", and yes, 'civilization' is supposed to be spelt wrong, because that's what it says in-game.
check your list of city names, and maybe the entry for the leader specific capital(in your file, use ctrl+f to search for LOC_CIVLIZATION_CW_MONACO_CITY_1 this should lead you to where is is mentioned)
-the tourism from my unique building does not work.
As far as i know Pseudoyields are only something for the Ai, so it knows what certain things "do", you would have to to that via a modifier(i suggest using a modifer that adds tourism to the commercial hub if the city has that specific building(using a requirement))
-the Leader Ability (gold from districts in the capital) does not work.
cant say much unless you show me how you implemented it, one way to do it would be what i showed you in my first post, i tested it and that works
-the unique building shows up on the list of things to build too early. It shouldn't show up until the required tech is researched -- but I think I know how to fix that, not 100% sure
in Buildings, where you also put things like name etc put PrereqTech="TECH_NAMEOFYOURTECH" (for example TECH_WRITING")
-my unique unit doesn't even show up at all, e.g. it isn't in the Civilopedia, but my building is.
this could be anything really, be sure to double check the spelling on everything related to the unit
 
nice for you getting it to work, i have some ideas what could be causing your problems:
Thanks again, wish I could give you something for helping me lol.

Not sure what the issue is with the city name. LOC_blahblahblah is appearing where I thought there should be something else, like the unique building name, LOC_PLACEHOLDER when I'm loading the game after picking my civ, the city name, and probably more that I can't remember/haven't encountered.

But anyway, I have no idea what I'm doing :( Here's the code for the leader ability (is it an issue here that is causing it to not work?):
Spoiler Leader Ability code :

<?xml version="1.0" encoding="utf-8"?>
<GameData>
<Modifiers>
<Row>
<ModifierId>LEADER_TRAIT_DISTRICT_GOLD</ModifierId>
<ModifierType>MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_PER_DISTRICT</ModifierType>
</Row>
</Modifiers>
<ModifierArguments>
<Row>
<ModifierId>LEADER_TRAIT_DISTRICT_GOLD</ModifierId>
<Name>YieldType</Name>
<Value>YIELD_GOLD</Value>
</Row>
<Row>
<ModifierId>LEADER_TRAIT_DISTRICT_GOLD</ModifierId>
<Name>Amount</Name>
<Value>4</Value>
</Row>
</ModifierArguments>
<TraitModifiers>
<Row>
<TraitType>TRAIT_LEADER_TAX_HAVEN</TraitType>
<ModifierId>LEADER_TRAIT_DISTRICT_GOLD</ModifierId>
</Row>
</TraitModifiers>
</GameData>

On the subject of my unique unit not showing up: I'm not sure what the issue here is, there are multiple files that could cause the problem I'm assuming. I can post all the files related to the unit if you want.

Next, the tech requirement for the unique building worked. Thanks :)

Lastly, and the main topic of this reply, I don't know how to do the modifier thing for tourism. I tried doing it but stopped when I didn't know how to go any further. I was looking at the code of Arwick's Kingdom of Prussia mod in order to do the tourism for commercial hubs and its buildings... I chose this mod because it gave culture for encampments and its buildings, which is similar to what I'm trying to do. After looking at the code for a bit and replacing what values I needed to replace (e.g. putting a tourism modifier where Arwick had culture modifier) I eventually couldn't go on any further because the code went to <ModifierArguments> and I didn't know what to do in my case. So, I'm going to need some help with that part. Here is the code that I had made (I stopped after Modifiers):
Spoiler Tourism Ability half-finished code :

<?xml version="1.0" encoding="utf-8"?>
<GameData>
<Civilizations>
<Row>
<CivilizationType>CIVILIZATION_CW_MONACO</CivilizationType>
<Name>LOC_CIVILIZATION_CW_MONACO_NAME</Name>
<Description>LOC_CIVILIZATION_AR_PRUSSIA_DESCRIPTION</Description>
<Adjective>LOC_CIVILIZATION_CW_MONACO_ADJECTIVE</Adjective>
<StartingCivilizationLevelType>CIVILIZATION_LEVEL_FULL_CIV</StartingCivilizationLevelType>
</Row>
</Civilizations>
<CivilizationLeaders>
<Row CivilizationType="CIVILIZATION_CW_MONACO" LeaderType="LEADER_CW_RAINIER_III" CapitalName="LOC_CIVILIZATION_CW_MONACO_CITY_1"/>
</CivilizationLeaders>
<Types>
<Row Type="CIVILIZATION_CW_MONACO" Kind="KIND_CIVILIZATION"/>
<Row Type="TRAIT_LEADER_TAX_HAVEN" Kind="KIND_TRAIT"/>
<Row Type="TRAIT_CIVILIZATION_CW_MONACO_CENTRE_OF_COMMERCE" Kind="KIND_TRAIT"/>
<Row Type="TRAIT_CIVILIZATION_UNIT_CW_MONACO_CARABINIER" Kind="KIND_TRAIT"/>
<Row Type="TRAIT_LEADER_CW_RAINIER_III" Kind="KIND_TRAIT"/>
<Row Type="MODIFIER_PLAYER_DISTRICT_ADJUST_TOURISM_CHANGE" Kind="KIND_MODIFIER"/>
</Types>
<Traits>
<Row TraitType="TRAIT_CIVILIZATION_CW_MONACO_CENTRE_OF_COMMERCE" Name="LOC_TRAIT_CIVILIZATION_CW_MONACO_CENTRE_OF_COMMERCE_NAME" Description="LOC_TRAIT_CIVILIZATION_CW_MONACO_CENTRE_OF_COMMERCE_DESCRIPTION"/>
<Row TraitType="TRAIT_CIVILIZATION_UNIT_CW_MONACO_CARABINIER" Name="LOC_UNIT_CW_MONACO_CARABINIER_NAME" Description="LOC_UNIT_CW_MONACO_CARABINIER_DESCRIPTION"/>
<Row TraitType="TRAIT_LEADER_TAX_HAVEN" Name="LOC_TRAIT_LEADER_TAX_HAVEN_NAME" Description="LOC_TRAIT_LEADER_TAX_HAVEN_DESCRIPTION"/>
<Row TraitType="TRAIT_LEADER_CW_RAINIER_III" Name="LOC_TRAIT_LEADER_CW_RAINIER_III_NAME" Description="LOC_TRAIT_LEADER_CW_RAINIER_III_DESCRIPTION"/>
</Traits>
<TraitModifiers>
<Row TraitType="TRAIT_CIVILIZATION_CW_MONACO_CENTRE_OF_COMMERCE" ModifierId="TRAIT_TOURISM_FROM_COMMERCIAL_HUB"/>
<Row TraitType="TRAIT_CIVILIZATION_CW_MONACO_CENTRE_OF_COMMERCE" ModifierId="TRAIT_TOURISM_FROM_MARKET"/>
<Row TraitType="TRAIT_CIVILIZATION_CW_MONACO_CENTRE_OF_COMMERCE" ModifierId="TRAIT_TOURISM_FROM_BANK"/>
<Row TraitType="TRAIT_CIVILIZATION_CW_MONACO_CENTRE_OF_COMMERCE" ModifierId="TRAIT_TOURISM_FROM_CASINO"/>
</TraitModifiers>
<CivilizationTraits>
<Row CivilizationType="CIVILIZATION_CW_MONACO" TraitType="TRAIT_CIVILIZATION_CW_MONACO_CENTRE_OF_COMMERCE"/>
<Row CivilizationType="CIVILIZATION_CW_MONACO" TraitType="TRAIT_CIVILIZATION_UNIT_CW_MONACO_CARABINIER"/>
<Row CivilizationType="CIVILIZATION_CW_MONACO" TraitType="TRAIT_LEADER_TAX_HAVEN"/>
</CivilizationTraits>
<DynamicModifiers>
<Row>
<ModifierType>MODIFIER_PLAYER_DISTRICT_ADJUST_TOURISM_CHANGE</ModifierType>
<CollectionType>COLLECTION_OWNER</CollectionType>
<EffectType>EFFECT_ADJUST_DISTRICT_TOURISM_CHANGE</EffectType>
</DynamicModifiers>
<Modifiers>
<Row>
<ModifierId>TRAIT_TOURISM_FROM_COMMERCIAL_HUB</ModifierId>
<ModifierType>MODIFIER_PLAYER_DISTRICT_ADJUST_TOURISM_CHANGE</ModifierId>
</Row>
<Row>
<ModifierId>TRAIT_TOURISM_FROM_MARKET</ModifierId>
<ModifierType>MODIFIER_PLAYER_DISTRICT_ADJUST_TOURISM_CHANGE</ModifierId>
</Row>
<Row>
<ModifierId>TRAIT_TOURISM_FROM_BANK</ModifierId>
<ModifierType>MODIFIER_PLAYER_DISTRICT_ADJUST_TOURISM_CHANGE</ModifierId>
</Row>
<Row>
<ModifierId>TRAIT_TOURISM_FROM_CASINO</ModifierId>
<ModifierType>MODIFIER_PLAYER_DISTRICT_ADJUST_TOURISM_CHANGE</ModifierId>
</Row>
</Modifiers>
</GameData>

Bit long spoiler above, I sure hope I didn't do all of that for nothing. Is any of it correct for what I'm trying to do? If so, how do I complete it in order for it to work properly in-game? If not, what is the correct way? To recap, I'm trying to make commercial hubs and its buildings give +2 tourism each, in all cities. Note that 'Casino' is my unique building. It's for Monaco, so it had to be a casino :)

Thanks again for sticking with me through this. Eventually I'll get the hang of it... I hope.
 
the distric gold modifier works fine, it shows as for example "+4 from having 1 District" in the city gold yield
only thing i did was replace TRAIT_LEADER_TAX_HAVEN with TRAIT_LEADER_ADVENTURES_ENKIDU to test it with sumeria
for the other thing:
<DynamicModifiers>
<Row>
<ModifierType>MODIFIER_PLAYER_DISTRICT_ADJUST_TOURISM_CHANGE</ModifierType>
<CollectionType>COLLECTION_OWNER</CollectionType>
<EffectType>EFFECT_ADJUST_DISTRICT_TOURISM_CHANGE</EffectType>
</DynamicModifiers>
this part is not needed, since the Dynamic modifier you are creating here already exists (most likely nothing after this part will work since this throws a "unique constraint" error
also, you would want to use MODIFIER_PLAYER_DISTRICTS_ADJUST_TOURISM_CHANGE instead since that applies to ALL districts, while MODIFIER_PLAYER_DISTRICT_ADJUST_TOURISM_CHANGE applies to just one
your modifiers now need arguments, think of that step to giving it the values it is supposed to work with
if you look how certain great person modifiers work that add tourism to districts you see that MODIFIER_PLAYER_DISTRICTS_ADJUST_TOURISM_CHANGE only need to be told an amount (which will be the amount of tourism it provides)
so we add:
<ModifierArguments>
<Row>
<ModifierId>TRAIT_TOURISM_FROM_COMMERCIAL_HUB</ModifierId>
<Name>Amount</Name>
<Value>10</Value>
</Row>
</ModifierArguments>
if you want to know how to use a specific modifierType, copy it and search the Data folder for where and how the game used it, in this case MODIFIER_PLAYER_DISTRICTS_ADJUST_TOURISM_CHANGE is used by certain great persons looking that up should explain some more

one big thing you are missing now are Requirements, this modifier currently would give all districts 10 tourism, not just commercial hubs, since it applies to COLLECTION_PLAYER_DISTRICTS,
again, check how the great persons that do this work and copy that, maybe if i have time later ill explain to you how requirements work/are used
 
Ok, so I think the problem is that the leader ability is not being applied to my leader. You replaced TRAIT_LEADER_TAX_HAVEN with Sumeria's ability and it worked for you, but when I play as my mod civ with TAX_HAVEN still in there, it doesn't work. To me, it seems like there's an issue where my leader's TAX_HAVEN ability isn't being given to my leader, so I don't receive its benefits.

In addition, I did the TRAIT_TOURISM_FROM_COMMERCIAL_HUB the way you said it, and it doesn't work; either I did it wrong, or it relates back to the issue where mod civ isn't getting its leader/civ abilities. I did remove the dynamic modifier part, so that shouldn't be the problem.

I tried to make my own code for tourism from the commercial hub buildings based on the info you gave me: I tinkered with Windows so that I could search for files with certain contents, and based on what I found on various modifiers and whatnot, I wrote some code. Here is the entire file of my MonacoAbilities2 xml file that I made based on Arwick's mod and searching in-game files:
Spoiler Tourism Code :

<?xml version="1.0" encoding="utf-8"?>
<GameData>
<Civilizations>
<Row>
<CivilizationType>CIVILIZATION_CW_MONACO</CivilizationType>
<Name>LOC_CIVILIZATION_CW_MONACO_NAME</Name>
<Description>LOC_CIVILIZATION_CW_MONACO_DESCRIPTION</Description>
<Adjective>LOC_CIVILIZATION_CW_MONACO_ADJECTIVE</Adjective>
<StartingCivilizationLevelType>CIVILIZATION_LEVEL_FULL_CIV</StartingCivilizationLevelType>
</Row>
</Civilizations>
<CivilizationLeaders>
<Row CivilizationType="CIVILIZATION_CW_MONACO" LeaderType="LEADER_CW_RAINIER_III" CapitalName="LOC_CIVILIZATION_CW_MONACO_CITY_1"/>
</CivilizationLeaders>
<Types>
<Row Type="CIVILIZATION_CW_MONACO" Kind="KIND_CIVILIZATION"/>
<Row Type="TRAIT_LEADER_TAX_HAVEN" Kind="KIND_TRAIT"/>
<Row Type="TRAIT_CIVILIZATION_CW_MONACO_CENTRE_OF_COMMERCE" Kind="KIND_TRAIT"/>
<Row Type="TRAIT_CIVILIZATION_UNIT_CW_MONACO_CARABINIER" Kind="KIND_TRAIT"/>
<Row Type="TRAIT_LEADER_CW_RAINIER_III" Kind="KIND_TRAIT"/>
<Row Type="MODIFIER_PLAYER_DISTRICTS_ADJUST_TOURISM_CHANGE" Kind="KIND_MODIFIER"/>
</Types>
<Traits>
<Row TraitType="TRAIT_CIVILIZATION_CW_MONACO_CENTRE_OF_COMMERCE" Name="LOC_TRAIT_CIVILIZATION_CW_MONACO_CENTRE_OF_COMMERCE_NAME" Description="LOC_TRAIT_CIVILIZATION_CW_MONACO_CENTRE_OF_COMMERCE_DESCRIPTION"/>
<Row TraitType="TRAIT_CIVILIZATION_UNIT_CW_MONACO_CARABINIER" Name="LOC_UNIT_CW_MONACO_CARABINIER_NAME" Description="LOC_UNIT_CW_MONACO_CARABINIER_DESCRIPTION"/>
<Row TraitType="TRAIT_LEADER_TAX_HAVEN" Name="LOC_TRAIT_LEADER_TAX_HAVEN_NAME" Description="LOC_TRAIT_LEADER_TAX_HAVEN_DESCRIPTION"/>
<Row TraitType="TRAIT_LEADER_CW_RAINIER_III" Name="LOC_TRAIT_LEADER_CW_RAINIER_III_NAME" Description="LOC_TRAIT_LEADER_CW_RAINIER_III_DESCRIPTION"/>
</Traits>
<TraitModifiers>
<Row TraitType="TRAIT_CIVILIZATION_CW_MONACO_CENTRE_OF_COMMERCE" ModifierId="TRAIT_TOURISM_FROM_COMMERCIAL_HUB"/>
<Row TraitType="TRAIT_CIVILIZATION_CW_MONACO_CENTRE_OF_COMMERCE" ModifierId="TRAIT_TOURISM_FROM_MARKET"/>
<Row TraitType="TRAIT_CIVILIZATION_CW_MONACO_CENTRE_OF_COMMERCE" ModifierId="TRAIT_TOURISM_FROM_BANK"/>
<Row TraitType="TRAIT_CIVILIZATION_CW_MONACO_CENTRE_OF_COMMERCE" ModifierId="TRAIT_TOURISM_FROM_CASINO"/>
</TraitModifiers>
<CivilizationTraits>
<Row CivilizationType="CIVILIZATION_CW_MONACO" TraitType="TRAIT_CIVILIZATION_CW_MONACO_CENTRE_OF_COMMERCE"/>
<Row CivilizationType="CIVILIZATION_CW_MONACO" TraitType="TRAIT_CIVILIZATION_UNIT_CW_MONACO_CARABINIER"/>
<Row CivilizationType="CIVILIZATION_CW_MONACO" TraitType="TRAIT_LEADER_TAX_HAVEN"/>
</CivilizationTraits>
<Modifiers>
<Row>
<ModifierId>TRAIT_TOURISM_FROM_COMMERCIAL_HUB</ModifierId>
<ModifierType>MODIFIER_PLAYER_DISTRICTS_ADJUST_TOURISM_CHANGE</ModifierId>
<SubjectRequirementSetId>DISTRICT_IS_COMMERCIAL_HUB</SubjectRequirementSetId>
<RunOnce>false</RunOnce>
<Permanent>true</Permanent>
</Row>
<Row>
<ModifierId>TRAIT_TOURISM_FROM_MARKET</ModifierId>
<ModifierType>MODIFIER_PLAYER_DISTRICTS_ADJUST_TOURISM_CHANGE</ModifierId>
<SubjectRequirementSetId>CITY_HAS_MARKET</SubjectRequirementSetId>
<RunOnce>false</RunOnce>
<Permanent>true</Permanent>
</Row>
<Row>
<ModifierId>TRAIT_TOURISM_FROM_BANK</ModifierId>
<ModifierType>MODIFIER_PLAYER_DISTRICTS_ADJUST_TOURISM_CHANGE</ModifierId>
<SubjectRequirementSetId>CITY_HAS_BANK</SubjectRequirementSetId>
</Row>
<Row>
<ModifierId>TRAIT_TOURISM_FROM_CASINO</ModifierId>
<ModifierType>MODIFIER_PLAYER_DISTRICTS_ADJUST_TOURISM_CHANGE</ModifierId>
</Row>
</Modifiers>
<ModifierArguments>
<Row>
<ModifierId>TRAIT_TOURISM_FROM_COMMERCIAL_HUB</ModifierId>
<Name>Amount</Name>
<Value>3</Value>
</Row>
<Row>
<ModifierId>TRAIT_TOURISM_FROM_MARKET</ModifierId>
<Name>BuildingType</Name>
<Value>BUILDING_BANK</Name>
</Row>
<Row>
<ModifierId>TRAIT_TOURISM_FROM_MARKET</ModifierId>
<Name>Amount</Name>
<Value>2</Value>
</Row>
<Row>
<ModifierId>TRAIT_TOURISM_FROM_BANK</ModifierId>
<Name>BuildingType</Name>
<Value>BUILDING_BANK</Name>
</Row>
<Row>
<ModifierId>TRAIT_TOURISM_FROM_BANK</ModifierId>
<Name>Amount</Name>
<Value>2</Value>
</Row>
<Row>
<ModifierId>TRAIT_TOURISM_FROM_CASINO</ModifierId>
<Name>BuildingType</Name>
<Value>BUILDING_CW_CASINO</Name>
</Row>
<Row>
<ModifierId>TRAIT_TOURISM_FROM_CASINO</ModifierId>
<Name>Amount</Name>
<Value>2</Value>
</Row>
</ModifierArguments>
<RequirementSets>
<Row>
<RequirementSetId>CITY_HAS_MARKET_REQUIREMENTS</RequirementSetId>
<RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
</Row>
<Row>
<RequirementSetId>CITY_HAS_BANK_REQUIREMENTS</RequirementSetId>
<RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
</Row>
<Row>
<RequirementSetId>CITY_HAS_BUILDING_CW_CASINO_REQUIREMENTS</RequirementSetId>
<RequirementSetType>REQUIREMENTSET_TEST_ALL</RequirementSetType>
</Row>
</RequirementSets>
<RequirementSetRequirements>
<Row>
<RequirementSetId>CITY_HAS_MARKET_REQUIREMENTS</RequirementSetId>
<RequirementId>REQUIRES_CITY_HAS_MARKET</RequirementId>
</Row>
<Row>
<RequirementSetId>CITY_HAS_BANK_REQUIREMENTS</RequirementSetId>
<RequirementId>REQUIRES_CITY_HAS_BANK</RequirementId>
</Row>
<Row>
<RequirementSetId>CITY_HAS_BUILDING_CW_CASINO_REQUIREMENTS</RequirementSetId>
<RequirementId>REQUIRES_CITY_HAS_CW_CASINO</RequirementId>
</Row>
</RequirementSetRequirements>
<Requirements>
<Row>
<RequirementId>REQUIRES_CITY_HAS_MARKET</RequirementId>
<RequirementType>REQUIRES_CITY_HAS_BUILDING</RequirementType>
</Row>
<Row>
<RequirementId>REQUIRES_CITY_HAS_BANK</RequirementId>
<RequirementType>REQUIRES_CITY_HAS_BUILDING</RequirementType>
</Row>
<Row>
<RequirementId>REQUIRES_CITY_HAS_CW_CASINO</RequirementId>
<RequirementType>REQUIRES_CITY_HAS_BUILDING</RequirementType>
</Row>
</Requirements>
<RequirementArguments>
<Row>
<RequirementId>REQUIRES_CITY_HAS_MARKET</RequirementId>
<Name>BuildingType</Name>
<Value>BUILDING_MARKET</Name>
</Row>
<Row>
<RequirementId>REQUIRES_CITY_HAS_BANK</RequirementId>
<Name>BuildingType</Name>
<Value>BUILDING_BANK</Name>
</Row>
<Row>
<RequirementId<REQUIRES_CITY_HAS_CW_CASINO</RequirementId>
<Name>BuildingType</Name>
<Value>BUILDING_CW_CASINO</Name>
</Row>
</RequirementArguments>
</GameData>

It doesn't work, of course. Assuming the code you gave me for the commercial hub is correct, which it likely is, then the problem lies somewhere with A: my part of the code, which I definitely don't doubt haha, or B: the problem is with my mod not receiving its leader/civ ability bonuses, or C: a combination of both, which is probably most likely. I stayed up later doing this part so perhaps I made a mistake somewhere that I could have caught. It's 12:11 when I'm writing this...

So, without looking at every single file of code that I have (if you need it in order to diagnose the issue, I can certainly provide it), do you know what the issue could be?

...I really wish civ 6 modding was easier to learn. Either that or I'm just dumb. Lol

(On a side note, you should really make a tutorial for stuff like this, since you seem to have a lot of knowledge on the subject! I'd certainly read it.)
 
Code:
		<Row Type="MODIFIER_PLAYER_DISTRICTS_ADJUST_TOURISM_CHANGE" Kind="KIND_MODIFIER"/>
This already exists as part of the base game code. You do not need to re-define it. Nor can you re-define it. Your attempt to do so causes everything after that line in your file to be ignored by the game.
 
it looks right to me, one minor thing, right now TRAIT_TOURISM_FROM_MARKET should be giving tourism to every district if its city has a markes, if you use "REQUIREMENT_DISTRICT_HAS_BUILDING" it will only apply to the district that accualy houses the building(the commercial hub) instead of every district

having a look at the log files might help finding out what the acual problem is, in the Logs folder (next to Mods) there should be a file "Database" and a file "GameData"
Database will show you if anything went wrong appliying your code(typos, wrong syntax, unique constrained etc)
GameData tracks basicly everything that happens in game so search it for your modifiers to see if and when they are applies
(also usefull, search for "warning:", "invalid" or "cannot find" that will show you things that went wrong)

if the files are not in the Log folder you might have to enable them first, i think the tutorial i sent you mentions how to do it at the end
 
ARghh, nothing is working.

So I looked at the Database log and tinkered around with files to try to resolve issues. The closest I got to getting the leader/civ abilities to work was to get LOC_blahblahblah to appear on the screen that shows when you're loading a game, but in the end the abilities didn't work.

I tried removing duplicate <Types> and stuff which caused my game to crash to main menu, so I re-added KIND_CIVILIZATION or something to get it to let me play a game again, I can't remember exactly.

Here's what my Database log now says:
Spoiler Current Database log :

[899046.752] [Localization]: Validating Foreign Key Constraints...
[899046.752] [Localization]: Passed Validation.
[899046.913] [Configuration]: Validating Foreign Key Constraints...
[899046.914] [Configuration]: Passed Validation.
[899055.586] [FullTextSearch]: Initializing FullTextSearch
[899057.388] [Gameplay]: Validating Foreign Key Constraints...
[899057.407] [Gameplay]: Passed Validation.
[899058.952] [Configuration]: Validating Foreign Key Constraints...
[899058.953] [Configuration]: Passed Validation.
[899082.578] [FullTextSearch]: FTS - Creating Context
[899101.692] [Configuration]: Validating Foreign Key Constraints...
[899101.692] [Configuration]: Passed Validation.
[899132.862] [Gameplay] ERROR: UNIQUE constraint failed: Buildings.BuildingType
[899132.870] [Gameplay]: While executing - 'insert into Buildings('BuildingType', 'Name', 'PrereqDistrict', 'PrereqTech', 'PurchaseYield', 'Cost', 'AdvisorType', 'CitizenSlots') values (?, ?, ?, ?, ?, ?, ?, ?);'
[899132.870] [Gameplay]: In XMLSerializer while inserting row into table insert into Buildings('BuildingType', 'Name', 'PrereqDistrict', 'PrereqTech', 'PurchaseYield', 'Cost', 'AdvisorType', 'CitizenSlots') with values (BUILDING_CW_CASINO, LOC_CW_BUILDING_CASINO_NAME, DISTRICT_COMMERCIAL_HUB, TECH_ECONOMICS, YIELD_GOLD, 355, ADVISOR_GENERIC, 1, ).
[899132.870] [Gameplay]: In XMLSerializer while updating table Buildings from file NewLeader_LitterBox.xml.
[899132.870] [Gameplay] ERROR: UNIQUE constraint failed: Buildings.BuildingType
[899132.871] [Localization] ERROR: UNIQUE constraint failed: LocalizedText.Language, LocalizedText.Tag
[899132.871] [Localization]: While executing - 'insert into LocalizedText('Tag', 'Language', 'Text') values (?, ?, ?);'
[899132.871] [Localization]: In XMLSerializer while inserting row into table insert into LocalizedText('Tag', 'Language', 'Text') with values (LOC_BUILDING_CW_CASINO_NAME, en_US, Casino, ).
[899132.871] [Localization]: In XMLSerializer while updating table LocalizedText from file NewLeader_ConfigText.xml.
[899132.871] [Localization] ERROR: UNIQUE constraint failed: LocalizedText.Language, LocalizedText.Tag
[899132.872] [Localization] ERROR: UNIQUE constraint failed: LocalizedText.Language, LocalizedText.Tag
[899132.872] [Localization]: While executing - 'insert into LocalizedText('Tag', 'Language', 'Text') values (?, ?, ?);'
[899132.872] [Localization]: In XMLSerializer while inserting row into table insert into LocalizedText('Tag', 'Language', 'Text') with values (LOC_PEDIA_BUILDINGS_PAGE_BUILDING_CW_CASINO_CHAPTER_HISTORY_PARA_1, en_US, , ).
[899132.872] [Localization]: In XMLSerializer while updating table LocalizedText from file NewLeader_Text.xml.
[899132.872] [Localization] ERROR: UNIQUE constraint failed: LocalizedText.Language, LocalizedText.Tag
[899132.912] [Gameplay]: Validating Foreign Key Constraints...
[899132.932] [Gameplay]: Passed Validation.
[899181.015] [FullTextSearch]: FTS - Creating Context
[899181.632] [FullTextSearch]: FTS - Creating Context
[899184.226] [FullTextSearch]: FTS - Creating Context
[899621.129] [FullTextSearch]: FullTextSearch - Shutting down


I can't find GameData log anywhere, even after doing a system search.

The main thing is that I really wish I knew why my leader abilities won't work!! What else can I do?
 
if the files are not in the Log folder you might have to enable them first, i think the tutorial i sent you mentions how to do it at the end
The Database log is there, but GameData is not.

UPDATE: I messed around with my code to try to fix stuff, and one of the things I did was I adjusted my modinfo file to add my leader/civ abilities files to <InGameActions> so that it looks like:

<InGameActions>
<UpdateDatabase id="Gameplay">
<File>my abilities files, and Modbuddy-created files, each with their own <File> </File> of course.

After doing this, my game crashes to main menu when I try to create a game. However, at least my Database log looks different. Here's the new one:
Spoiler New Database log :

[920277.294] [Localization]: Validating Foreign Key Constraints...
[920277.294] [Localization]: Passed Validation.
[920277.540] [Configuration]: Validating Foreign Key Constraints...
[920277.541] [Configuration]: Passed Validation.
[920291.014] [FullTextSearch]: Initializing FullTextSearch
[920298.074] [Gameplay]: Validating Foreign Key Constraints...
[920298.093] [Gameplay]: Passed Validation.
[920299.788] [Configuration]: Validating Foreign Key Constraints...
[920299.789] [Configuration]: Passed Validation.
[920338.754] [FullTextSearch]: FTS - Creating Context
[920362.488] [Configuration]: Validating Foreign Key Constraints...
[920362.489] [Configuration]: Passed Validation.
[920379.748] [Gameplay] ERROR: NOT NULL constraint failed: RequirementArguments.RequirementId
[920379.748] [Gameplay]: While executing - 'insert into RequirementArguments('Name', 'Value') values (?, ?);'
[920379.748] [Gameplay]: In XMLSerializer while inserting row into table insert into RequirementArguments('Name', 'Value') with values (BuildingType, BUILDING_CW_CASINO, ).
[920379.748] [Gameplay]: In XMLSerializer while updating table RequirementArguments from file MonacoAbilities2.xml.
[920379.748] [Gameplay] ERROR: NOT NULL constraint failed: RequirementArguments.RequirementId
[920379.773] [Gameplay] ERROR: UNIQUE constraint failed: Buildings.BuildingType
[920379.773] [Gameplay]: While executing - 'insert into Buildings('BuildingType', 'Name', 'PrereqDistrict', 'PrereqTech', 'PurchaseYield', 'Cost', 'AdvisorType', 'CitizenSlots') values (?, ?, ?, ?, ?, ?, ?, ?);'
[920379.773] [Gameplay]: In XMLSerializer while inserting row into table insert into Buildings('BuildingType', 'Name', 'PrereqDistrict', 'PrereqTech', 'PurchaseYield', 'Cost', 'AdvisorType', 'CitizenSlots') with values (BUILDING_CW_CASINO, LOC_CW_BUILDING_CASINO_NAME, DISTRICT_COMMERCIAL_HUB, TECH_ECONOMICS, YIELD_GOLD, 355, ADVISOR_GENERIC, 1, ).
[920379.773] [Gameplay]: In XMLSerializer while updating table Buildings from file NewLeader_LitterBox.xml.
[920379.773] [Gameplay] ERROR: UNIQUE constraint failed: Buildings.BuildingType
[920379.773] [Gameplay] ERROR: FOREIGN KEY constraint failed
[920379.773] [Gameplay] ERROR: FOREIGN KEY constraint failed
[920379.773] [Gameplay]: Validating Foreign Key Constraints...
[920379.785] [Gameplay] ERROR: Invalid Reference on Modifiers.SubjectRequirementSetId - "REQUIREMENT_DISTRICT_HAS_BUILDING" does not exist in RequirementSets
[920379.785] [Gameplay] ERROR: Invalid Reference on Modifiers.SubjectRequirementSetId - "REQUIREMENT_DISTRICT_HAS_BUILDING" does not exist in RequirementSets
[920379.785] [Gameplay] ERROR: Invalid Reference on Modifiers.SubjectRequirementSetId - "REQUIREMENT_DISTRICT_HAS_BUILDING" does not exist in RequirementSets
[920379.795] [Gameplay]: Failed Validation.
[920379.805] [Localization] ERROR: UNIQUE constraint failed: LocalizedText.Language, LocalizedText.Tag
[920379.805] [Localization]: While executing - 'insert into LocalizedText('Tag', 'Language', 'Text') values (?, ?, ?);'
[920379.805] [Localization]: In XMLSerializer while inserting row into table insert into LocalizedText('Tag', 'Language', 'Text') with values (LOC_BUILDING_CW_CASINO_NAME, en_US, Casino, ).
[920379.805] [Localization]: In XMLSerializer while updating table LocalizedText from file NewLeader_ConfigText.xml.
[920379.805] [Localization] ERROR: UNIQUE constraint failed: LocalizedText.Language, LocalizedText.Tag
[920379.809] [Localization] ERROR: UNIQUE constraint failed: LocalizedText.Language, LocalizedText.Tag
[920379.809] [Localization]: While executing - 'insert into LocalizedText('Tag', 'Language', 'Text') values (?, ?, ?);'
[920379.809] [Localization]: In XMLSerializer while inserting row into table insert into LocalizedText('Tag', 'Language', 'Text') with values (LOC_PEDIA_BUILDINGS_PAGE_BUILDING_CW_CASINO_CHAPTER_HISTORY_PARA_1, en_US, , ).
[920379.809] [Localization]: In XMLSerializer while updating table LocalizedText from file NewLeader_Text.xml.
[920379.809] [Localization] ERROR: UNIQUE constraint failed: LocalizedText.Language, LocalizedText.Tag
[920380.015] [Gameplay]: Validating Foreign Key Constraints...
[920380.036] [Gameplay]: Passed Validation.
[920386.334] [FullTextSearch]: FTS - Creating Context
[920388.242] [Configuration]: Validating Foreign Key Constraints...
[920388.242] [Configuration]: Passed Validation.
[920476.213] [FullTextSearch]: FullTextSearch - Shutting down

How do I fix all these errors? There are a lot :(
 
so, let me see if i can decode those log messages
[920379.785] [Gameplay] ERROR: Invalid Reference on Modifiers.SubjectRequirementSetId - "REQUIREMENT_DISTRICT_HAS_BUILDING" does not exist in RequirementSets
this one means you probably put REQUIREMENT_DISTRICT_HAS_BUILDING (which is a requirement Type) as a SubjectRequirementSetId instead of the accual requirementSetId

[920379.748] [Gameplay] ERROR: NOT NULL constraint failed: RequirementArguments.RequirementId
[920379.748] [Gameplay]: While executing - 'insert into RequirementArguments('Name', 'Value') values (?, ?);'
[920379.748] [Gameplay]: In XMLSerializer while inserting row into table insert into RequirementArguments('Name', 'Value') with values (BuildingType, BUILDING_CW_CASINO, ).
[920379.748] [Gameplay]: In XMLSerializer while updating table RequirementArguments from file MonacoAbilities2.xml.
[920379.748] [Gameplay] ERROR: NOT NULL constraint failed: RequirementArguments.RequirementId
this should mean that you put:
<ModifierArguments>
<Row>
<Name>BuildingType</Name>
<Value>BUILDING_CW_CASINO</Value>
</Row>
</ModifierArguments
and forgot the 3rd part, the requirementId

and then there are the unique constraint errors:
[920379.773] [Gameplay] ERROR: UNIQUE constraint failed: Buildings.BuildingType
[920379.773] [Gameplay]: While executing - 'insert into Buildings('BuildingType', 'Name', 'PrereqDistrict', 'PrereqTech', 'PurchaseYield', 'Cost', 'AdvisorType', 'CitizenSlots') values (?, ?, ?, ?, ?, ?, ?, ?);'
[920379.773] [Gameplay]: In XMLSerializer while inserting row into table insert into Buildings('BuildingType', 'Name', 'PrereqDistrict', 'PrereqTech', 'PurchaseYield', 'Cost', 'AdvisorType', 'CitizenSlots') with values (BUILDING_CW_CASINO, LOC_CW_BUILDING_CASINO_NAME, DISTRICT_COMMERCIAL_HUB, TECH_ECONOMICS, YIELD_GOLD, 355, ADVISOR_GENERIC, 1, ).
[920379.773] [Gameplay]: In XMLSerializer while updating table Buildings from file NewLeader_LitterBox.xml.
[920379.773] [Gameplay] ERROR: UNIQUE constraint failed: Buildings.BuildingType

translated for humans this means at some point, the game tried to put your buildings enty into "buildings", but there was already an entry with BuildingType="BUILDING_CW_CASINO"
how exactly that happened im not sure, but somehow your mod is trying to do stuff twice, either you have it twice in your code, or you have two versions of your mod active or something like that

same goes for the other unique constraint errors, somehow things are added twice

i hope i am still beeing helpfull, good luck
 
i hope i am still beeing helpfull, good luck
You are always helpful!

The gold from districts now works, finally! Next up is the tourism from commercial hubs and its buildings -- I think it works, but not entirely... I'm getting 21 Tourism per turn according to the bar at the top of the screen that shows science, culture, etc. and I think it went up when I built a Commercial Hub, but it did NOT go up when I built a Market (it should have.) Going to settle a second city and build a commercial hub there and see if it goes up again.
-------
Ok, I just built a commercial hub in my second city and my tourism per turn went up by 12, and I won a culture victory?... Why would it have gone up by 12? It should be going up by 2 for commercial hubs and 2 for each of its buildings. I mean, I'm very happy to see that it somewhat worked, but I'm getting too much tourism!! At turn 55 I have 42 tourism per turn, and I haven't created a single great work.

I'm still getting [Gameplay] ERROR: NOT NULL constraint failed: RequirementArguments.RequirementId in my Database log for the Casino. I looked in the files and I have this:
<Row>
<ModifierId>TRAIT_TOURISM_FROM_CASINO</ModifierId>
<Name>BuildingType</Name>
<Value>BUILDING_CW_CASINO</Name>
</Row>
<Row>
<ModifierId>TRAIT_TOURISM_FROM_CASINO</ModifierId>
<Name>Amount</Name>
<Value>2</Value>
</Row>
I didn't forget the Id, but it's still giving me the error. What else could be the problem?

Glad to see that my civ is half-working though! Thank you so much :D
 
The error is saying that an attempt is being made to write to table RequirementArguments but nothing ia being provided for column RequirementId. The definition of the table as Firaxis requires:
Code:
CREATE TABLE "RequirementArguments" (
		"RequirementId" TEXT NOT NULL,
		"Name" TEXT NOT NULL,
		"Type" TEXT NOT NULL DEFAULT "ARGTYPE_IDENTITY",
		"Value" TEXT NOT NULL,
		"Extra" TEXT,
		"SecondExtra" TEXT,
		PRIMARY KEY(RequirementId, Name),
		FOREIGN KEY (RequirementId) REFERENCES Requirements(RequirementId) ON DELETE CASCADE ON UPDATE CASCADE);
Make sure you are not attempting to write to table RequirementArguments instead of table ModifierArguments. The snippet-bit of code you posted would imply you need table ModifierArguments.

It is actually easier to see what you are doing wrong if you follow this advice:

Add Your Mod to A Forum Post (Civ6):
  1. It's better to just take the mod from the game's MODS folder, zip it, and attach the result directly to a post. It is far easier to look at your actual code and the actual structure of the mod as it is being seen by the game than any attempt to determine what you are doing wrong by analyzing descriptions of the problem, or out-of-context snippets of the code.
  2. Very often what a new modder thinks the problem is and what the problem actually is are two different things. Having the actual mod as you are currently trying to use it allows us to look for the actual problem, and if all else fails to simply drop the mis-behaving mod into our MODS folder and run the mod to see what the game tells us.
  3. 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.
  4. 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.
  5. If the zipped folder is too large for the forum to accept then upload the zipped mod to a file-sharing site such as dropbox and provide a link where the mod can be downloaded.
    • Mediafire is not really a very good choice any more because they have become rife with spam and malware, as well as attempts to get you to download unwanted and uneeded kludge by confusing the layout of the download pages. You'll note for example that Mediafire links are no longer allowed on Steam, whereas CFC (this site) and dropbox links are still allowed.
 
The error is saying that an attempt is being made to write to table RequirementArguments but nothing ia being provided for column RequirementId. The definition of the table as Firaxis requires:

Make sure you are not attempting to write to table RequirementArguments instead of table ModifierArguments. The snippet-bit of code you posted would imply you need table ModifierArguments.

It is actually easier to see what you are doing wrong if you follow this advice:
Thanks for the reply. :)

Sorry, after re-reading what I said, I can see how it doesn't make sense; but my TOURISM_FROM_CASINO thing was indeed under ModifierArguments. I posted that bit of code in response to Aldollin's suggestion that I had forgotten part of the code, in order to show that I didn't forget it.

Anyway, the zipped mod is attached, called "CW's Rainier III of Monaco". If you were to play a game as the modded civ, you'd immediately notice some text appearing as LOC_blahblahblah, such as on the screen that appears while loading a new game after picking your civ, and the names of Monaco's cities. That's another issue that needs fixing.

I think for my next mod civ creation I'll try to implement some of the stuff I've learned from you guys on this thread, rather than having different ideas that I will again need to ask for help for :p
 

Attachments

  • CW's Rainier III of Monaco.zip
    115.2 KB · Views: 55
Top Bottom