Quick Modding Questions Thread

The reason code of laws is the first is that it has four available policies, and therefore gives enough policies to select from to fill available policy-slots after you 'discover' Code of Laws. Otherwise, the player(s) that have an extra policy slot as part of a UA cannot satisfy the slot-selection menu and you can get stuck on the interface page. An AI playing as Tommyris (?) also is able to fill their cards -- without enough available policies to select-from, the game might crash as soon as such an AI player 'learns' their first civic.
on vanilla it seems the selection menu (auto) open only when yo have enough policies to fill the slots.
 
Updating or Deleting the StartingCivics value worked. The problem is now that adding lesser cost civics before Code Of Laws causes the civics tree to build erratically. Sometimes it's what I expect, sometimes not. The tech tree doesn't have this problem. I've tried changing the cost of Code Of Laws and still have the problem.

I'm guessing there's a pattern it's just going to take me a few more tries to see what it is.
 
The tree is build dynamically and placement on the Y axis is determined by the cost. Placement of X axis is specified in DB via UITreeRow field (-3..+4).
I am not sure what you want to do, but if you want to add Civics that are in the same column as Code Of Laws then they must have the same cost.
 
Hello. I was looking for how to do a couple things with a civilization I'm creating. The first is to have a unit gain combat strength based on the number of cities following your religion. The second is to double the yields from your trade routes. Are either of these possible to do? And if so, where would I be able to go to find examples or how to do them? I've tried searching the forums for it (both manually and with the search function), but can't seem to find anything.
 
Hello. I was looking for how to do a couple things with a civilization I'm creating. The first is to have a unit gain combat strength based on the number of cities following your religion. The second is to double the yields from your trade routes. Are either of these possible to do? And if so, where would I be able to go to find examples or how to do them? I've tried searching the forums for it (both manually and with the search function), but can't seem to find anything.
Have a look in Modifiers.xml and see if you can find something similar to what you want to do.
 
I need to find out what controls what units barbarians can spawn and the requirements. I seem to have barbarians spawning Cogs at the start of the game instead of when the required tech has been researched.
 
I need to find out what controls what units barbarians can spawn and the requirements. I seem to have barbarians spawning Cogs at the start of the game instead of when the required tech has been researched.
What's the required tech ?

Some have a <BarbarianFree> property (Sailing, Bronze Working, Shipbuilding)
 
Sailing. But I should not need this anymore. I found out it was caused by another mod that disabled the requirement for Barbarians to have Shipbuilding.

Thanks for you help though, I did not know about the BarbarianFree property, which is most likely what this other mod used.
 
@Zerienga , This is probably possible, the only hang-up might be the requirement for your religion... If you have, say, a Civilization ability that does this, all you have to do is make a Modifier with the type MODIFIER_PLAYER_CITIES_ATTACH_MODIFIER, then have it attach another modifier with the type MODIFIER_PLAYER_UNITS_ATTACH_MODIFIER, then have that attach yet another modifier with the type MODIFIER_UNIT_ADJUST_COMBAT_STRENGTH. On the first modifier, you need to set a SubjectRequirementSet that restricts it to just your religion, though I'm not sure which one would work. Look at the existing beliefs, and try out their requirements, see what works.
 
I need to know how to have a file load only when using the expansion (or not using the expansion, either way works but I need one of them), so I can add/remove/change content, ie the unit and building moments when the player is using R&F. I feel like I'm close, but I can't get it to work...
 
Makes an Action only load when R&F is enabled:
Code:
  <ActionCriteria>
    <Criteria id="Expansion1">
      <GameCoreInUse>Expansion1</GameCoreInUse>
    </Criteria>
  </ActionCriteria>
  <InGameActions>
    <UpdateIcons id="Icons_XP">
      <Criteria>Expansion1</Criteria>
      <File>sql/IconUpdate_XP.sql</File>
    </UpdateIcons>
  </InGameActions>
Example taken from the excellent Unique District Icons mod by Leugi, Sukritact, etc.
 
I am not sure If anyone will notice it here but better than making new thread because of minor question: How to change yields per Citizen?

I am talking about the automatic bonus City gains per Citizen, such as 0.7 Science per Citizen.

I would like to modify:
  • What specific yields City gains per citizen (science, culture, faith etc.)
  • How much they get per Citizen
Normally, I explore the XML files, searching for key words, values; to find out what exact value needs changing. However I cannot find any reference to this or 0.7 being explicitly defined somewhere. Not even Global Parameters has this. And Google Search usually just pops results talking about what is Science and people conteplating about wide vs tall, even when word "mod" is specified.

This is really important to me, I am heavily modifying the game to my standard and I balanced the entire growth aspect heavily around 4Population powerspikes, plus I take Food, Production and Gold as tile yields while I take Science, Culture and Faith as Citizen yields. As such I need +0.5 Science/Culture/Faith per Citizen.

There is so much details you can modify I didn't expect this to be such hard-to-find problem so I am surprised and it kinda screws over me.

If anyone knows I will really appreciate the answer.
 
@Jeppetto - In GlobalParameters you want to look at
  • "SCIENCE_PERCENTAGE_YIELD_PER_POP" Value="70"
  • "CULTURE_PERCENTAGE_YIELD_PER_POP" Value="30"
You would update those two lines to 50 to get what you want. However, if you're playing R&F the Science yield has already been adjusted to 50/0.5. For Faith, offhand I'd say you'd need to create a modifier using 'EFFECT_ADJUST_CITY_YIELD_PER_POPULATION', and depending on the Collection used, attach it to a District like 'DISTRICT_CITY_CENTER' or a Trait like 'TRAIT_LEADER_MAJOR_CIV'.
 
Last edited:
@Jeppetto - In GlobalParameters you want to look at
  • "SCIENCE_PERCENTAGE_YIELD_PER_POP" Value="70"
  • "CULTURE_PERCENTAGE_YIELD_PER_POP" Value="30"
You would update those two lines to 50 to get what you want. However, if you're playing R&F the Science yield has already been adjusted to 50/0.5.

Thanks for the quick answer. I must've been blind not to notice that, though it does seems strange it is worded as percentage of 1 unit.

Anyway given that it is like this, I don't assume there would be easy way to additionally give 0.5 Faith per Citizen?
 
Anyway given that it is like this, I don't assume there would be easy way to additionally give 0.5 Faith per Citizen?
There isn't a row in the GlobalParameters table to give Faith per pop. I edited my post above with how I believe you'd go about adding that yield.
 
There isn't a row in the GlobalParameters table to give Faith per pop. I edited my post above with how I believe you'd go about adding that yield.

Thanks again. I'll look into that and see If it'll work.
 
So I've been looking into Modifiers.xml but can't find EFFECT_ADJUST_CITY_YIELD_PER_POPULATION defined there.
EDIT: And it's not in GameEffects.xml either. Is it defined or do I have to make some script myself?
 
Last edited:
see https://docs.google.com/spreadsheet...6oDAtqNuXVW_2zHRn13epMYXY/edit#gid=1391246980

Firaxis for whatever reason removed a lot of the defines of the Effects, Requirements, Modifier Types from the viewable xml files and moved them into a packed and inaccessible file the location of which I don't think anyone has figured out as yet. But we don't need to know where they moved all that to since it all gets added to the game's database and we can open a 'debug' version of the game's database that is created every time the game loads. All that is needed to view the debug database is a free database viewer program such as SQLite Viewer.
 
Last edited:
  • Like
Reactions: cvb
i have written this code to add healing per turn ability to all units of america civ
but when i try to play a game the game wont start and show an error like: error starting game disable mod...
my code is :

INSERT INTO Types (Type, Kind) VALUES ('TRAIT_LEADER_ROOSEVELT_HEAL', 'KIND_TRAIT');
INSERT INTO LeaderTraits (LeaderType, TraitType) VALUES ('LEADER_T_ROOSEVELT', 'TRAIT_LEADER_ROOSEVELT_HEAL');
INSERT INTO TraitModifiers (TraitType, ModifierId) VALUES ('TRAIT_LEADER_ROOSEVELT_HEAL', 'ALL_UNITS_HEAL_PER_TURN');
INSERT INTO Modifiers (ModifierId, ModifierType, SubjectRequirementSetId) VALUES ('ALL_UNITS_HEAL_PER_TURN', 'MODIFIER_PLAYER_UNITS_ADJUST_HEAL_PER_TURN', NULL);
INSERT INTO ModifierArguments (ModifierId, Name, Value) VALUES ('TRAIT_HEAL_PER_TURN', 'Type', 'ALL');
INSERT INTO ModifierArguments (ModifierId, Name, Value) VALUES ('TRAIT_HEAL_PER_TURN', 'Amount', 20);


i would be thankful if anyone could help
 
Back
Top Bottom