Quick Modding Questions Thread

However, when I open up regedit I see no \tools under \Firaxis:
Am I missing a very obvious step?

You need to create Tools folder yourself.
 
Is there a simple fix to kill Cleopatra from being the default leader screen, in favor of custom art? This video, along with a tweak from the comments, managed to help me create a civ- but the art is totally wonky.
 
Hi, thanks for the answer. I know about the Requirements and RequirementSets but the problem is I don't know if there is any ModifierType (the Effect) that affect how an improvement is built. Currently I am not aware of such. It would be wonderful if you know one

Table <Improvement_ValidResources> needs to be understood in the same way as table <Improvement_ValidFeatures> : it is essentially an over-ride of anything listed or missing in tables <Improvement_ValidTerrains> and <Improvement_ValidFeatures> : allowing the improvement if the specified resource is on the plot and "accessible" to the player, regardless of underlying terrain or feature.
I was browsing the DebugGameplay database for fun, as one does, and happened to notice something interesting in the improvements table:
Code:
<Row ImprovementType="IMPROVEMENT_OIL_WELL" ... EnforceTerrain="true" Appeal="-1"/>
<Row ImprovementType="IMPROVEMENT_OFFSHORE_OIL_RIG" ... EnforceTerrain="true" Appeal="-1" Domain="DOMAIN_SEA"/>
The oil improvements uniquely only go on oil + their terrain type, and are the only improvements int he game which have the "enforce terrain" column set to 1.
Didn't think about oil wells when you asked about improvements, but perhaps this is an easy answer to this issue.
 
I'm trying to change the text of a Civ Leader and it works in-game but it doesn't work when you are selecting the Civ before the game starts. I understand that this the different between "in-game" and front-end" stuff, but can I just put the text file in the "front-end" part of ModBuddy or do I need to do something else special?
 
I'm trying to change the text of a Civ Leader and it works in-game but it doesn't work when you are selecting the Civ before the game starts. I understand that this the different between "in-game" and front-end" stuff, but can I just put the text file in the "front-end" part of ModBuddy or do I need to do something else special?
Check out the linked time on this video. If it doesn't link loosely it's 26:30. He adds the front end actions for a custom civ mod.
Edit: Some of the video is outdated, apparently: although I can say that if you use either template and just build the solution, it doesn't seem to function in the front end at all, although the civ exists in game.
 
Last edited:
can I just put the text file in the "front-end" part of ModBuddy or do I need to do something else special?
Yes, you can list the text file in both FrontEndActions and InGameActions. Generally, though I will create a separate text config file that is only for game setup and contains only the text actually needed.
 
Trying to add my own custom civ, working off of Keniisu's template (it was the only template i saw updated for GS, I rewrote it into XML)
When I build the template and run the game, it appears as his does, a selectable, working civ.

Only Issue I have with both his template, and my own built from it, curiously, when I play as either of them, the tech tree shows up blank:
Spoiler Weird Tech Tree behavior :

upload_2019-11-9_17-50-5.png


The civics tree is completely normal. I can select techs from the main interface like normal, in fact everything is totally functional except for opening the tech tree. I cannot discern any difference in the data bases on what parameters differ between my civ and a basic one.
No errors in my database.log, which i making this hard to pin down. But I have the same behavior if I literally just grab Keniisu's template from his discord, build it in modbuddy, and run the game. Anyone had any experience with this?
 
I want to modify the starting units for one particular civ (Cree, make them start with their UU instead of a Warrior). I know how to modify them for all civs, but I don't see any way to do it with just 1 civ.

Am I going to have to use lua to convert the starting Warrior into a Scout, or is there a table for this I'm just not seeing?
 
Does anyone know an easy way to cause an effect to reduce a city's housing?
Trying to have an improvement reduce housing by 1. Negative arguments in an Improvement's Housing column seem to go to zero; negative arguments in something like MODIFIER_SINGLE_CITY_ADJUST_IMPROVEMENT_HOUSING appear to translate as an absolute value in game.

Alternatively, is there any easy parameter or proxy for improvement maintenance?
 
Alternatively, is there any easy parameter or proxy for improvement maintenance?
None that I can think of offhand. The closest you might get to this is a negative yield in table Improvement Yield Changes assuming it will implement a negative yield.
 
Last edited:
None that I can think of offhand. The closest you might get to this is a negative yield in table Improvement Yield Changes assuming it will implement a negative yield.
I have found that you can reduce a yield to zero but no further; of course most tiles don’t yield gold so that’s not a great choice. Although it is a good solution for something a la civ4's workshop improvement, which reduced :food: food in exchange for :hammers: production. (Is there a clean way to outright zero a tile's yield of a specific yield? Outside of making the entire tile "not workable."
Say, zeroing out the tile's food - it cannot be done via modifier; the modifer itself seems to defualt to minimum of zero, rather than the normal improvement yield change that hit the zero floor on the tile as a whole.)

Speaking of which, does your Dummy Building utility support detection of a route on a tile, like railroad tiles? I don't see an existing modifier or effect that is capable of knowing if the tile has a railroad, but it would be slick for replicating e.g. civ4's +1:hammers: to mines if they had a railroad under them.
 
Another quick one for you guys:
Civs that have traits granting extra district adjacency (like japan or indonesia) make use of trait modifiers. The modifiers then grant adjacency using MODIFIER_PLAYER_CITIES_X_ADJACENCY, where X might be DISTRICT (japan) TERRAIN (indonesia) or FEATURE (brazil.) This is to avoid placing those adjacencies into Adjacency_YieldChanges, which affects all players.

I am working on a unique ability that includes granting some districts +2 adj with the city center, similar to what harbors currently have.
Currently I have this set up as a trait modifier, with the same type of mechanical implementation as england's RNDY. (Except the requirement is just whether it's the district in question for that yield type + next to a city center district.) This functions correctly, the +2 counts properly as adjacency, can trigger historic moments for district adj, doubles with cards, is reflected in eg shipyard coal plant, but it does not display that +2 when you go to place the district down. The aforementioned effects of japan, brazil, indonesia do.
MODIFIER_PLAYER_CITIES_DISTRICT_ADJACENCY uses an effect, EFFECT_DISTRICT_ADJACENCY, but this applies as the adjacency for bonus for being next to any district at all - there is no way to narrow down what. So using that, for example, I end up with a district next to the city center getting +2 from any and all districts.

Question: is there a way to put together a modifier type to do this and make it show up when placing the district? Some way to restrict Adjacency_YieldChanges would work, but AFAIK there's no "inverse" option on ExcludedAdjacencies to make everyone but my leader get it. I guess the most shameless workaround would be to plug in a ton of traits to exclude everyone but my civ, but that would have zero mod compatibility :lol:
 
Does anyone know an easy way to cause an effect to reduce a city's housing?
Trying to have an improvement reduce housing by 1. Negative arguments in an Improvement's Housing column seem to go to zero; negative arguments in something like MODIFIER_SINGLE_CITY_ADJUST_IMPROVEMENT_HOUSING appear to translate as an absolute value in game.

Alternatively, is there any easy parameter or proxy for improvement maintenance?

I'm surprised that modifier doesn't take negative numbers, but you could try giving negative housing from a different source, like MODIFIER_PLAYER_CITIES_ADJUST_POLICY_HOUSING or MODIFIER_SINGLE_CITY_ADJUST_CITY_HOUSING_FROM_GREAT_PEOPLE, obviously retooling the former to work with just the single city. This will label the housing as coming from those other sources in the UI, but otherwise I don't think that matters?

No idea about maintenance.



Another quick one for you guys:
Civs that have traits granting extra district adjacency (like japan or indonesia) make use of trait modifiers. The modifiers then grant adjacency using MODIFIER_PLAYER_CITIES_X_ADJACENCY, where X might be DISTRICT (japan) TERRAIN (indonesia) or FEATURE (brazil.) This is to avoid placing those adjacencies into Adjacency_YieldChanges, which affects all players.

I am working on a unique ability that includes granting some districts +2 adj with the city center, similar to what harbors currently have.
Currently I have this set up as a trait modifier, with the same type of mechanical implementation as england's RNDY. (Except the requirement is just whether it's the district in question for that yield type + next to a city center district.) This functions correctly, the +2 counts properly as adjacency, can trigger historic moments for district adj, doubles with cards, is reflected in eg shipyard coal plant, but it does not display that +2 when you go to place the district down. The aforementioned effects of japan, brazil, indonesia do.
MODIFIER_PLAYER_CITIES_DISTRICT_ADJACENCY uses an effect, EFFECT_DISTRICT_ADJACENCY, but this applies as the adjacency for bonus for being next to any district at all - there is no way to narrow down what. So using that, for example, I end up with a district next to the city center getting +2 from any and all districts.

Question: is there a way to put together a modifier type to do this and make it show up when placing the district? Some way to restrict Adjacency_YieldChanges would work, but AFAIK there's no "inverse" option on ExcludedAdjacencies to make everyone but my leader get it. I guess the most shameless workaround would be to plug in a ton of traits to exclude everyone but my civ, but that would have zero mod compatibility :lol:

I have not found a way to do this either, but what you could do is create "Unique Districts" with the different adjacencies, and use SQL to copy all modifiers from vanilla/mods that were attached to the base districts, attaching them to your uniques. And all modifiers that merely reference or affect the base districts will work on yours, as long as you make them "replacements". This seems like a lot of work to me, when you could just live with what Firaxis has given (they use these modifiers on their own stuff, and get around it by listing them in the civilopedia entry instead of the tooltip).
 
I'm surprised that modifier doesn't take negative numbers, but you could try giving negative housing from a different source, like MODIFIER_PLAYER_CITIES_ADJUST_POLICY_HOUSING or MODIFIER_SINGLE_CITY_ADJUST_CITY_HOUSING_FROM_GREAT_PEOPLE, obviously retooling the former to work with just the single city. This will label the housing as coming from those other sources in the UI, but otherwise I don't think that matters?
The reason i had it at the improvement level was so i didn't need to count it up. But I wonder if the counting would matter if the Improvement had the modifier since presumably it would be per instance. Although some GP effects stack (john roebling) and some don't (avaro aalto.) I'll play with it and see if i can produce negative values in these modifiers. I was very surprised, since -1 food yield works, but directly setting housing to -1 in the building's definition doesn't.

RE maintenance you've give me the idea to see if I can bootleg the vanilla New Deal policy's use of MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_CHANGE. I'd just have to see if I can make it stack correctly.

I have not found a way to do this either, but what you could do is create "Unique Districts" with the different adjacencies, and use SQL to copy all modifiers from vanilla/mods that were attached to the base districts, attaching them to your uniques. And all modifiers that merely reference or affect the base districts will work on yours, as long as you make them "replacements". This seems like a lot of work to me, when you could just live with what Firaxis has given (they use these modifiers on their own stuff, and get around it by listing them in the civilopedia entry instead of the tooltip).
I had thought about this, but then there's the underlying assignment of art assets that would be a real chore, and custom buildings wouldn't work in them unless specifically defined - having just gotten a factory replacement to work that recycled existing factory art, ho boy. Well, if they give us the DLL in the near future, then someone (me or someone else as part of a utility) will create the effect + arguments needed. I'm gonna take a strong guess and say that EFFECT_DISTRICT_ADJACENCY is using the mechanism of "OtherAdjacentDistrict" in Adjacency_YieldChanges, and a variant would need only utilize the "AdjacentDistrict" mechanism instead. Having an inverse check in the ExcludedAdjacencies table would be even better, though. Come on DLL!!!
 
The reason i had it at the improvement level was so i didn't need to count it up. But I wonder if the counting would matter if the Improvement had the modifier since presumably it would be per instance. Although some GP effects stack (john roebling) and some don't (avaro aalto.) I'll play with it and see if i can produce negative values in these modifiers.
You can assign it to the improvement's modifiers. It should figure it out!

I was very surprised, since -1 food yield works, but directly setting housing to -1 in the building's definition doesn't.

You're talking about using that modifier, right? I am surprised it doesn't work. The table wouldn't surprise me, if that's what you're talking about.

RE maintenance you've give me the idea to see if I can bootleg the vanilla New Deal policy's use of MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_CHANGE. I'd just have to see if I can make it stack correctly.

For some silly reason I thought of workarounds for your other questions, but even though I did think of this workaround to the maintenance problem, I simply said I had nothing on maintenance. Maybe because the other 2 I've investigated myself and thus was willing to say "yeah I don't think it's doable either, here's a workaround" but for this one I was hoping someone else would come along with a real solution?


I had thought about this, but then there's the underlying assignment of art assets that would be a real chore, and custom buildings wouldn't work in them unless specifically defined - having just gotten a factory replacement to work that recycled existing factory art, ho boy. Well, if they give us the DLL in the near future, then someone (me or someone else as part of a utility) will create the effect + arguments needed. I'm gonna take a strong guess and say that EFFECT_DISTRICT_ADJACENCY is using the mechanism of "OtherAdjacentDistrict" in Adjacency_YieldChanges, and a variant would need only utilize the "AdjacentDistrict" mechanism instead. Having an inverse check in the ExcludedAdjacencies table would be even better, though. Come on DLL!!!

Yep, total pain and not worth it imo. Why wouldn't custom buildings work, though? Art not defined properly?

And I hope they release the DLL soon after the last expansion (which I think will be the next one...)! I understand they want to keep their active work proprietary, but I'm anxious to see what we can do with the game! It's a pretty good core game, it is just missing balance/chrome/whatever else your heart desires, which we could provide.
 
For some silly reason I thought of workarounds for your other questions, but even though I did think of this workaround to the maintenance problem, I simply said I had nothing on maintenance. Maybe because the other 2 I've investigated myself and thus was willing to say "yeah I don't think it's doable either, here's a workaround" but for this one I was hoping someone else would come along with a real solution?
For any curious onlookers:
Just responding to confirm that I did get this working correctly. The maintenance modifier that new deal used to carry is also found on Urban Planning, but to use it as maintenance for an improvement you need to make your own dynamic modifier and set the collectionType to "Owner City." If you reuse the existing modifierType, you'll get the maintenance amount for every copy of the improvement in every city. (So, if an Academy improvement costs 2 gold upkeep, building one would add -2 gold in every city you own.) It indeed allows yield output (at least for gold) in a city to go negative.
 
As FYI, "MODIFIER_SINGLE_CITY_ADJUST_CITY_YIELD_MODIFIER" and "MODIFIER_PLAYER_CITIES_ADJUST_CITY_YIELD_MODIFIER" both allow negative values in the "Amount" argument of the ModifierArguments table. These two modifiers are percentage changes to total city yields, however, rather than direct Yield-Amount changes. At least they accepted and implemented negative values when I experimented with them in Vanilla.

The first affects only one city whereas the second affects all of a player's cities.

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

@Sostratus : the Dummy Buildings code does not look to whether or not there is a route (road or railroad) through a tile. All it looks for is base terrain types of stuff as well as improvements to determine whether a city is eligible to receive a dummy building. The dummy then as a general rule will act as the "unlocker" for a real building which a mod-maker can add into the game (as well as its required dummy).

I'm hoping to have the GS & RaF compatible version of the mod up and available "soon".
 
Last edited:
Does anyone off hand know all the .dds sizes needed for icons with RF/GS?
I have: 32, 45, 50, 55, 64, 80,and 256. But I just found that my custom civ icon is missing for the world congress & emergency related stuff.
 
A check of the contents of file Expansion2_Icons_Civilizations.xml shows the following:
Code:
<GameInfo>
	<IconTextureAtlases>
		<Row Name="ICON_ATLAS_EXPANSION_2_CIVILIZATIONS" IconSize="22" IconsPerRow="8" IconsPerColumn="2"      Filename="XP2_CivSymbols22.dds"/>
		<Row Name="ICON_ATLAS_EXPANSION_2_CIVILIZATIONS" IconSize="30" IconsPerRow="8" IconsPerColumn="2"      Filename="XP2_CivSymbols30.dds"/>
		<Row Name="ICON_ATLAS_EXPANSION_2_CIVILIZATIONS" IconSize="32" IconsPerRow="8" IconsPerColumn="2"      Filename="XP2_CivSymbols32.dds"/>
		<Row Name="ICON_ATLAS_EXPANSION_2_CIVILIZATIONS" IconSize="36" IconsPerRow="8" IconsPerColumn="2"      Filename="XP2_CivSymbols36.dds"/>
		<Row Name="ICON_ATLAS_EXPANSION_2_CIVILIZATIONS" IconSize="44" IconsPerRow="8" IconsPerColumn="2"      Filename="XP2_CivSymbols44.dds"/>
		<Row Name="ICON_ATLAS_EXPANSION_2_CIVILIZATIONS" IconSize="45" IconsPerRow="8" IconsPerColumn="2"      Filename="XP2_CivSymbols45.dds"/>
		<Row Name="ICON_ATLAS_EXPANSION_2_CIVILIZATIONS" IconSize="48" IconsPerRow="8" IconsPerColumn="2"      Filename="XP2_CivSymbols48.dds"/>
		<Row Name="ICON_ATLAS_EXPANSION_2_CIVILIZATIONS" IconSize="50" IconsPerRow="8" IconsPerColumn="2"      Filename="XP2_CivSymbols50.dds"/>
		<Row Name="ICON_ATLAS_EXPANSION_2_CIVILIZATIONS" IconSize="64" IconsPerRow="8" IconsPerColumn="2"      Filename="XP2_CivSymbols64.dds"/>
		<Row Name="ICON_ATLAS_EXPANSION_2_CIVILIZATIONS" IconSize="80" IconsPerRow="8" IconsPerColumn="2"      Filename="XP2_CivSymbols80.dds"/>
		<Row Name="ICON_ATLAS_EXPANSION_2_CIVILIZATIONS" IconSize="128" IconsPerRow="8" IconsPerColumn="2"     Filename="XP2_CivSymbols128.dds"/>
		<Row Name="ICON_ATLAS_EXPANSION_2_CIVILIZATIONS" IconSize="200" IconsPerRow="8" IconsPerColumn="2"     Filename="XP2_CivSymbols200.dds"/>
		<Row Name="ICON_ATLAS_EXPANSION_2_CIVILIZATIONS" IconSize="256" IconsPerRow="8" IconsPerColumn="2"     Filename="XP2_CivSymbols256.dds"/>
	</IconTextureAtlases>
	<IconDefinitions>
		<Row Name="ICON_CIVILIZATION_HUNGARY"   Atlas="ICON_ATLAS_EXPANSION_2_CIVILIZATIONS" Index="0"/>
		<Row Name="ICON_CIVILIZATION_INCA"      Atlas="ICON_ATLAS_EXPANSION_2_CIVILIZATIONS" Index="1"/>
		<Row Name="ICON_CIVILIZATION_MALI"      Atlas="ICON_ATLAS_EXPANSION_2_CIVILIZATIONS" Index="2"/>
		<Row Name="ICON_CIVILIZATION_PHOENICIA" Atlas="ICON_ATLAS_EXPANSION_2_CIVILIZATIONS" Index="3"/>
		<Row Name="ICON_CIVILIZATION_OTTOMAN"   Atlas="ICON_ATLAS_EXPANSION_2_CIVILIZATIONS" Index="4"/>
		<Row Name="ICON_CIVILIZATION_MAORI"     Atlas="ICON_ATLAS_EXPANSION_2_CIVILIZATIONS" Index="5"/>
		<Row Name="ICON_CIVILIZATION_CANADA"    Atlas="ICON_ATLAS_EXPANSION_2_CIVILIZATIONS" Index="6"/>
		<Row Name="ICON_CIVILIZATION_SWEDEN"    Atlas="ICON_ATLAS_EXPANSION_2_CIVILIZATIONS" Index="7"/>
	</IconDefinitions>
</GameInfo>
 
Back
Top Bottom