Quick Modding Questions Thread

Quick question: Do you have to toss every icon you're using into the ImportFiles Action in a Modbuddy project? It's reallllly tedious having to put files in one at a time from a drop down menu.
 
i am using a mod to combine leaders and civs but it seems that some abilities do not stack
like jadwiga and the kongo's relic bonuses
how to fix that
 
I've been doing some more tinkering with my mod, all using modbuddy and everything.

Before starting the present game, I rebuilt the mod. The files all look fine (at the location of the mod, not in modbuddy), and the Units.xml and Buildings.xml files are applied fine, however the entire Districts.xml file seems to not be applied. Neither base cost changes, nor CostProgressionModel changes, nor CostProgressionParam1 changes. Modbuddy gives no errors (which, I know, doesn't mean there aren't any; but I couldn't find any while checking, eithre) and the In-Game Action is set up correctly.

Anyone know what could be causing this?

EDIT: It appears adjusting CostProgressionModel is what screwed things up.
 
Last edited:
I remember an incident that happened in the early days of GS. At that time, thanks to some civilizations with technological deformities, barbarians spawned GDRs and then wiped out civilizations. I really liked this gimmick. It reminded me of Machine Rebellion and Rogue AI. However, in the initial patch, this was removed due to balance issues, and is never coming back.

I was hoping some people would restore this while going through the GS and Frontier Passes, but I am the only one who wants this. So I have one question to ask. Even examining the XML and SQL files I can't figure out which syntax prevents barbarians and minor CIVs from owning and spawning GDRs. The only thing I suspect is 'UNITTYPE_MAJOR_CIV_ONLY' in UnitAiInfos which only applies to GDR.

So, without ignoring the example, I would like to ask the following question. If it is the following SQL data, is it possible to disable the syntax so that barbarians and minor CIVs use GDR? Or am I doing something wrong or forgetting something?

DELETE FROM UnitAiInfos WHERE UnitType = 'UNIT_GIANT_DEATH_ROBOT'
AND AiType='UNITTYPE_MAJOR_CIV_ONLY';​
PS1: I tried this syntax but still barbarians can't use GDR. The only successful case at this time has been to unilaterally add units without Era distinction using <BarbarianTribe_ExtraUnits> as XML code.
PS2: found the new syntax and tried it. But still, GDR doesn't come back to the barbarians.

UPDATE Units_XP2
SET MajorCivOnly = 'false'
WHERE UnitType = 'UNIT_GIANT_DEATH_ROBOT';​
 
Hi,
I'm trying to mod the Hermitage so that it allows Art Museums to be auto themed once filled, but it doesn't seem to work.

Code:
INSERT INTO BuildingModifiers (BuildingType, ModifierId) VALUES
        ('BUILDING_HERMITAGE', 'BE_HERMITAGE_AUTO_THEME'),
        ('BUILDING_HERMITAGE', 'BE_HERMITAGE_ART_MUSEUM_AUTO_THEME');

INSERT INTO Modifiers (ModifierId, ModifierType, RunOnce, Permanent, OwnerRequirementSetId, SubjectRequirementSetId) VALUES
        ('BE_HERMITAGE_AUTO_THEME', 'MODIFIER_PLAYER_ADJUST_AUTO_THEMED_BUILDING', 0, 0, NULL, NULL),
        ('BE_HERMITAGE_ART_MUSEUM_AUTO_THEME', 'MODIFIER_PLAYER_ADJUST_AUTO_THEMED_BUILDING', 0, 0, NULL, NULL);

INSERT INTO ModifierArguments (ModifierId, Name, Value, Extra, SecondExtra) VALUES
        ('BE_HERMITAGE_AUTO_THEME', 'BuildingType', 'BUILDING_HERMITAGE', NULL, NULL),
        ('BE_HERMITAGE_ART_MUSEUM_AUTO_THEME', 'BuildingType', 'BUILDING_MUSEUM_ART', NULL, NULL);
This is the relevant code I'm using. As you can see, I do the same for the Hermitage wonder itself and here, it works. Once it's filled, the Hermitage is themed, no matter what kind of Great Works of Art I put in there. When I try to do the same with any Art Museum, it doesn't work, however. I'm not sure what I'm doing wrong here. Do the inherent theming rules for Art Museums interfere somehow?
 
Hi,
I'm trying to mod the Hermitage so that it allows Art Museums to be auto themed once filled, but it doesn't seem to work.

Code:
INSERT INTO BuildingModifiers (BuildingType, ModifierId) VALUES
        ('BUILDING_HERMITAGE', 'BE_HERMITAGE_AUTO_THEME'),
        ('BUILDING_HERMITAGE', 'BE_HERMITAGE_ART_MUSEUM_AUTO_THEME');

INSERT INTO Modifiers (ModifierId, ModifierType, RunOnce, Permanent, OwnerRequirementSetId, SubjectRequirementSetId) VALUES
        ('BE_HERMITAGE_AUTO_THEME', 'MODIFIER_PLAYER_ADJUST_AUTO_THEMED_BUILDING', 0, 0, NULL, NULL),
        ('BE_HERMITAGE_ART_MUSEUM_AUTO_THEME', 'MODIFIER_PLAYER_ADJUST_AUTO_THEMED_BUILDING', 0, 0, NULL, NULL);

INSERT INTO ModifierArguments (ModifierId, Name, Value, Extra, SecondExtra) VALUES
        ('BE_HERMITAGE_AUTO_THEME', 'BuildingType', 'BUILDING_HERMITAGE', NULL, NULL),
        ('BE_HERMITAGE_ART_MUSEUM_AUTO_THEME', 'BuildingType', 'BUILDING_MUSEUM_ART', NULL, NULL);
This is the relevant code I'm using. As you can see, I do the same for the Hermitage wonder itself and here, it works. Once it's filled, the Hermitage is themed, no matter what kind of Great Works of Art I put in there. When I try to do the same with any Art Museum, it doesn't work, however. I'm not sure what I'm doing wrong here. Do the inherent theming rules for Art Museums interfere somehow?

Have you tried attaching 'BE_HERMITAGE_ART_MUSEUM_AUTO_THEME' via MODIFIER_PLAYER_CITIES_ATTACH_MODIFIER?
Like add a Modifier Id=BE_HERMITAGE_ART_MUSEUM_AUTO_THEME_ATTACH and ModifierType=MODIFIER_PLAYER_CITIES_ATTACH_MODIFIER, use BE_HERMITAGE_ART_MUSEUM_AUTO_THEME as ModifierArgument for BE_HERMITAGE_ART_MUSEUM_AUTO_THEME_ATTACH.
 
Quick question about AI modding and settling.
I am trying to understand what exactly these AiFavoredItems do:
  • SETTLEMENT_MIN_VALUE_NEEDED
  • SETTLEMENT_DECAY_TURNS
  • SETTLEMENT_DECAY_AMOUNT
  • SETTLEMENT_CITY_VALUE_MULTIPLIER
  • SETTLEMENT_CITY_MINIMUM_VALUE
  • SETTLEMENT_ADDITIONAL_VALUE_PER_CITY
Is it something like
Code:
Settle IF
#cities * SETTLEMENT_CITY_VALUE_MULTIPLIER - (#turns_since_last_settled/SETTLEMENT_DECAY_TURNS * SETTLEMENT_DECAY_AMOUNT) .. whatever?
I don't seem to fully get it :o
 
Does anyone know what this means in GlobalParameters:

"TRADE_ROUTE_TRANSPORTATION_EFFICIENCY_SCORE_MULTIPLE_DOMAINS"

Is it an added efficiency bonus for trade routes moving through different infrastructure tiles (tunnels, canals, railroads), on top of the other efficiency bonuses?
 
Have you tried attaching 'BE_HERMITAGE_ART_MUSEUM_AUTO_THEME' via MODIFIER_PLAYER_CITIES_ATTACH_MODIFIER?
Like add a Modifier Id=BE_HERMITAGE_ART_MUSEUM_AUTO_THEME_ATTACH and ModifierType=MODIFIER_PLAYER_CITIES_ATTACH_MODIFIER, use BE_HERMITAGE_ART_MUSEUM_AUTO_THEME as ModifierArgument for BE_HERMITAGE_ART_MUSEUM_AUTO_THEME_ATTACH.
I haven't, but I'll try when I have time. Don't think it'll work though, as the modifier type "MODIFIER_PLAYER_ADJUST_AUTO_THEMED_BUILDING" works for players and not individual cities.
 
I haven't, but I'll try when I have time. Don't think it'll work though, as the modifier type "MODIFIER_PLAYER_ADJUST_AUTO_THEMED_BUILDING" works for players and not individual cities.
Oh sorry I didn't atentively think this through. Isnt there a attach_player variant? You could also check if you can create a new dynamic modifier targeting cities. Sorry if I couldn't give any useful hint.
 
How to get type of the unit? For example, "UNIT_LINE_INFANTRY". Tried unit:GetType(), but it gives number
 
Is there a way to make it so that once a certain turn has been reached (preferably variable by game speed), it activates a code in a mod?
 
Hey, really simple question, hopefully - i'm trying to change the base cost of all civics/techs by a flat %

My code is below - adapted from someone elses mod which works for changing building/unit costs. It doesn't seem to work with tech/civic costs though. Any idea what is wrong with it and if i'm going about this the wrong way, what code might help to add a flat % increase to the costs of techs and civics that works in multiplayer matches? Any help would be greatly appreciated. Thanks!

(It's a / in the code rather than * as the original building mod was to decrease costs and used / - i've tried with both * and / to no effect)

UPDATE Civics
SET Cost = Round(Cost /0.8)
WHERE Cost > 1;

UPDATE Technologies
SET Cost = Round(Cost /0.8)
WHERE Cost > 1;
 
Is it somehow possible to force an era change via a button or something like that?
things like UPDATE Eras_XP1 SET GameEraMinimumTurns = 38, GameEraMaximumTurns = 45 WHERE EraType = 'ERA_RENAISSANCE';
or UPDATE StartEras SET Year = -1000 WHERE EraType = 'ERA_MEDIEVAL'; -- default 500
dont seem to work
 
I'm wondering what is the meaning of the column "Repeatable" in table "Modifiers".

Anyone knows that?
 
How to change AI's behaviors? I saw @Infixo made some AI fix mods, but I can't understand how they work. Tables like BehaviorTreeNodes and TreeData are hard to understand.
 
How to change AI's behaviors? I saw @Infixo made some AI fix mods, but I can't understand how they work. Tables like BehaviorTreeNodes and TreeData are hard to understand.
The Civ's AI is a pretty broad area. You may take a look at https://forums.civfanatics.com/threads/real-strategy-ai.640452/post-15324159 to better understand how the core system work. Behavior trees manage tactical level and are more difficult as there is virtually no documentation. Those two tables contain actual definition of the trees, the first contains the trees (nodes and relations) and the 2nd all required params.

Edit. Actually you should first check the table NodeDefinitions. There are short comments on what each node does.
 
Last edited:
Back
Top Bottom