alex1

Chieftain
Joined
Nov 22, 2022
Messages
9
Hello everyone,

So I followed the guides on how to make a custom civ and its modifiers, but I'm really confused on that last part. I searched through the root files of the game, and found the IDs. Unfortunately, I couldn't get my traits to work, and I really find it hard to implement them. I used Josh Atkin's video, Toussaint10326's fixed guide and NycholusV's modifiers guide, besides other random topics.

My leader and civilization have the following mechanics and exclusive features:
  • +1 production on all tiles with an adjacent campus, per campus.
  • Once the research "Computers" is completed, all campuses gain +10% science.
  • The university is replaced with a custom exclusive building, which grants +3 extra gold and science, and gives the Eureka boost to all computer-related research tecnologies, but food production/yield is reduced by -5 (this is still WIP).
  • The unique and exclusive units are:
    1. A special kind of soldier that gains extra defense when it's inside the civ's territory, and boosts district yields in the same tile.
    2. A powerful unit that can freeze enemy units for 1 turn and can cause natural disasters. (this is still WIP, I want to make some sort of "superhero" that has "superpowers").
  • Finally, this is kind of optional, I would like to use GS and R&F agendas, but I can't find the ones I need within the game files (can't decide if I want to use Amanitore, Hammurabi or T.R. Bull Moose's).
Sorry if I'm being too ambitious, but I had this planned for quite a while and I don't really know how to implement most of these.
 
I am also doing my first mod now, this trait is still too hard for me.
I only wrote a modifier that all cities gains +10% science production as computers technology is researched. This is based on Korean leader's ability.


INSERT INTO TraitModifiers (TraitType, ModifierId) VALUES
('TRAIT_CIVILIZATION_YOURCIV', 'SCIENCE_BOOST_COMPUTER_TECH');

INSERT INTO Modifiers (ModifierId, ModifierType, RunOnce, Permanent, NewOnly, OwnerRequirementSetId, SubjectRequirementSetId) VALUES
('SCIENCE_BOOST_COMPUTER_TECH', 'MODIFIER_ALL_CITIES_ADJUST_CITY_YIELD_CHANGE', 0, 0, 0, NULL, 'REQSET_TECH');

INSERT INTO ModifierArguments (ModifierId, Name, Value) VALUES
('SCIENCE_BOOST_COMPUTER_TECH', 'Amount', '10'),
('SCIENCE_BOOST_COMPUTER_TECH', 'YieldType', 'YIELD_SCIENCE');



INSERT INTO RequirementSets (RequirementSetId, RequirementSetType) VALUES
('REQSET_TECH', 'REQUIREMENTSET_TEST_ALL');

INSERT INTO RequirementSetRequirements (RequirementSetId, RequirementId) VALUES
('REQSET_TECH', 'HAS_TECH_COMPUTER');



INSERT INTO Requirements (RequirementId, RequirementType) VALUES
('HAS_TECH_COMPUTER', 'REQUIREMENT_PLAYER_HAS_TECHNOLOGY');

INSERT INTO RequirementArguments (RequirementId, Name, Value) VALUES
('HAS_TECH_COMPUTER', 'TechnologyType', 'TECH_COMPUTERS');




The TraitType (TRAIT_CIVILIZATION_YOURCIV) should be already defined in your project.
 
First trait: first step: "MODIFIER_ALL_DISTRICTS_ATTACH_MODIFIER" + subjectREQ"REQUIREMENT_PLAYER_TYPE_MATCHES" second step: "EFFECT_ADJUST_PLOT_YIELD" + subjectREQ"REQUIREMENT_PLOT_ADJACENT_TO_OWNER".
First unit: 1. "EFFECT_ADJUST_DEFENDER_STRENGTH_MODIFIER" + ownerREQ"REQUIREMENT_UNIT_IN_OWNER_TERRITORY". 2. "EFFECT_ADJUST_DISTRICT_YIELD_MODIFIER" + owerREQ"REQUIREMENT_PLOT_HAS_ANY_DISTRICT" & "REQUIREMENT_UNIT_IN_OWNER_TERRITORY".

I think the first ability of the second unit might be able to implement through "MODIFIER_UNIT_ADJUST_NUM_ATTACKS" & "MODIFIER_PLAYER_UNIT_ADJUST_MOVEMENT"?
 
  1. A special kind of soldier that gains extra defense when it's inside the civ's territory, and boosts district yields in the same tile.
  2. A powerful unit that can freeze enemy units for 1 turn and can cause natural disasters. (this is still WIP, I want to make some sort of "superhero" that has "superpowers").
I can already tell you that these won't work. We can only really add traits listed in Modifiers.xml files across the 'Base' and 'DLC' folders, in a way they're meant to be used (so pretty much, we can only copy what other units are already capable of doing in-game and slightly manipulate it. Creativity is often punished, as the traits either crash your game or have no in-game effect).

While extra defense when the unit is inside the civ's territory should be technically possible with Berserker's trait + certain policy card buff, boosting yields of the district with that unit in it would work probably with city centers only, or at least, I can't recall any other ability that would work with a tile considered as a district that's not a city center.

As for freezing enemies, it's straight up impossible to do. Causing natural disasters is also, most likely, impossible. From my experience, very little mods that involve natural disasters tend to work for some reason.
 
I can already tell you that these won't work. We can only really add traits listed in Modifiers.xml files across the 'Base' and 'DLC' folders, in a way they're meant to be used (so pretty much, we can only copy what other units are already capable of doing in-game and slightly manipulate it. Creativity is often punished, as the traits either crash your game or have no in-game effect).

While extra defense when the unit is inside the civ's territory should be technically possible with Berserker's trait + certain policy card buff, boosting yields of the district with that unit in it would work probably with city centers only, or at least, I can't recall any other ability that would work with a tile considered as a district that's not a city center.

As for freezing enemies, it's straight up impossible to do. Causing natural disasters is also, most likely, impossible. From my experience, very little mods that involve natural disasters tend to work for some reason.

Yes, maybe I was too ambitious with the custom unit, but I thought it'd be worth a try.
 
I am also doing my first mod now, this trait is still too hard for me.
I only wrote a modifier that all cities gains +10% science production as computers technology is researched. This is based on Korean leader's ability.


INSERT INTO TraitModifiers (TraitType, ModifierId) VALUES
('TRAIT_CIVILIZATION_YOURCIV', 'SCIENCE_BOOST_COMPUTER_TECH');

INSERT INTO Modifiers (ModifierId, ModifierType, RunOnce, Permanent, NewOnly, OwnerRequirementSetId, SubjectRequirementSetId) VALUES
('SCIENCE_BOOST_COMPUTER_TECH', 'MODIFIER_ALL_CITIES_ADJUST_CITY_YIELD_CHANGE', 0, 0, 0, NULL, 'REQSET_TECH');

INSERT INTO ModifierArguments (ModifierId, Name, Value) VALUES
('SCIENCE_BOOST_COMPUTER_TECH', 'Amount', '10'),
('SCIENCE_BOOST_COMPUTER_TECH', 'YieldType', 'YIELD_SCIENCE');



INSERT INTO RequirementSets (RequirementSetId, RequirementSetType) VALUES
('REQSET_TECH', 'REQUIREMENTSET_TEST_ALL');

INSERT INTO RequirementSetRequirements (RequirementSetId, RequirementId) VALUES
('REQSET_TECH', 'HAS_TECH_COMPUTER');



INSERT INTO Requirements (RequirementId, RequirementType) VALUES
('HAS_TECH_COMPUTER', 'REQUIREMENT_PLAYER_HAS_TECHNOLOGY');

INSERT INTO RequirementArguments (RequirementId, Name, Value) VALUES
('HAS_TECH_COMPUTER', 'TechnologyType', 'TECH_COMPUTERS');




The TraitType (TRAIT_CIVILIZATION_YOURCIV) should be already defined in your project.
So I took a break and decided to continue. It does work when "Computers" is completed, but instead of giving me +25% science, it gives me +25 science. I don't know how to make it a percentage.

As for freezing enemies, it's straight up impossible to do. Causing natural disasters is also, most likely, impossible. From my experience, very little mods that involve natural disasters tend to work for some reason.
I changed that a little bit, I decided to use Peter's blizzard protection, but for those unique units only (within my empire, of course). I'm still figuring it out, I'm not sure how to implement it either.
 
Top Bottom