Hey, so I've been trying to work on creating a custom civ with help from the tutorial at https://forums.civfanatics.com/threads/how-to-create-your-own-civilization.621377/ .
This is my first attempt at modding civ 6 but it's going pretty well. I've got most of what I want working, but I've been trying to make a civilization trait that changes the yield of farms in the civ.
I can't seem to figure out what I need to do modifier wise to get it to work.
Any help would be appreciated.
Also I don't have Rise & Fall.
You will want to change LEADER_X to the appropriate name for your leader, and you will want to change TRAIT_X to the primary trait-name your leader uses.
You can also make it an inherent ability of the civ instead simply by changing from using the <LeaderTraits> table to the <CivilizationTraits> table and giving the name of your civ instead of the name of a leader.
If you want production instead you change the yield to YIELD_PRODUCTION. But if you want more than one yield you will need to create seperate modifier set-ups for each yield, and add each of those to the TraitModifiers as the simplest way to go about it.
Thanks! I'm trying to figure out how to implement that in the SQL files that the template I'm trying to follow uses, I'll let you know if it works as soon as I can figure this file out!
Not sure if this works or not. I know that I couldn't get it to work, but I can't figure out how to get any traits to work properly.
I've tried to use the SQL files from the template I originally linked, I've tried to unravel it and make XML files since they make more sense currently. I also found this thread called SQL modding for dummies! (specially those that still use XML).
I tried to use the advice from that to convert this into a SQL formatted trait, though it is from civ 5 so I don't know if that's incompatible advice.
The SQL I made from it is here.
Spoiler:
INSERT INTO Types
(Type, Kind)
VALUES ('TRAIT_X', 'KIND_TRAIT);
--
INSERT INTO RequirementSets
(RequirementSetId, RequirementSetType);
VALUES ('PLOT_HAS_FARM_REQUIRMEMENT_SET', 'REQUIREMENTSET_TEST_ALL');
--
INSERT INTO RequirementSetRequirements
(RequirementSetId, RequirementId);
VALUES ('PLOT_HAS_FARM_REQUIRMEMENT_SET', 'PLOT_HAS_A_FARM_REQUIREMENT');
--
INSERT INTO TraitModifiers
(TraitType, ModifierId);
VALUES ('TRAIT_X', 'FARMS_INCREASED_FOOD_TRAIT_X');
--
INSERT INTO LeaderTraits
(LeaderType, TraitType)
VALUES ('LEADER_X', 'TRAIT_X');
--------------------------------------------------------------------------------------------------------------------------
So thanks for trying, I'm just sorta at the end of my rope and don't know what to do.
I would like to figure this out so I can make ANY working civilization.
It needs to be table Modifiers rather than table TraitModifiers. Table TraitModifiers is used to assign a Modifier to a Trait, not to define the Modifier.
You have an incorrect extra ";" in the middle of the code-chunk here at the end of this line
"null" in SQL is when no data is needed for a specific column for a given row "INSERT"
The result of your syntax errors is that the game stops reading anything within the file upon encountering the first fatal syntax error. You had three in that chunk of code. I did not look to see if you have errors of a similar sort elsewhere in the code.
I've tested the XML version of the code and know it to work. Any troubles you are having are in translation to SQL.
So, I followed your advice. I checked for all three problems.
I fixed the TraitModifiers line into Modifiers.
I checked the whole thing for both the mistake of an extra ";" and made sure all the lines had the proper ending as well as verifying all the tags had 'these' around them properly.
I then fixed the code to include the null as you said.
After that I plugged the edited code in to the GameDefines SQL file.
This time the civilization was able to actually launch, but still did not have the bonus food that the trait should be giving.
I went through and checked the references in the other files as well as in the rest of the game defines file, correcting them as needed, checking after the changes to make sure if it was working or not. After that I verified that the trait that was originally in the template was working to make sure that it was properly loading any traits, finding that to work.
After that I checked the code again, but still no luck
One weird thing throughout all of this is that when the civilization was loading, all the custom information about the civilization disappeared. So trying to follow that thread I checked the references in the GameText file, which isn't SQL (further compounding confusion thanks to this template), All of the text references seemed correct from what I could tell. I also checked the Config file, the references in that file seemed correct as well.
So in the end, the corrected code looks like this
Spoiler:
INSERT INTO Types
(Type, Kind)
VALUES ('TRAIT_X', 'KIND_TRAIT');
You're missing a comma between 'MODIFIER_PLAYER_CITIES_ATTACH_MODIFIER' and null. Database.log would have reported this syntax error. You can't usefully test anything in-game if you have database syntax errors.
Use "code" instead of "spoiler" to wrap your code on the forum. It's much easier to read code in a code-box than in a spoiler.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.