Quick Modding Questions Thread

Here it is. So, how do i set the load order to be after the expansion? I read something about how to do it on your pdf guide, but i can't seem to find what is the load order value for expansion 2. I'm using Modbuddy btw.
 

Attachments

Last edited:
Could anyone tell me if something's wrong here?
Code:
INSERT INTO BuildingModifiers (BuildingType, ModifierId) VALUES
       ('BUILDING_JEBEL_BARKAL', 'BE_JEBEL_BARKAL_HOLY_SITE_BASE_YIELD_MODIFIER');

INSERT INTO Modifiers (ModifierId, ModifierType, RunOnce, Permanent, OwnerRequirementSetId, SubjectRequirementSetId) VALUES
       ('BE_JEBEL_BARKAL_HOLY_SITE_BASE_YIELD_MODIFIER', 'MODIFIER_PLAYER_DISTRICT_ADJUST_BASE_YIELD_CHANGE', 0, 0, NULL, 'DISTRICT_IS_HOLY_SITE_DESERT');

INSERT INTO ModifierArguments (ModifierId, Name, Value, Extra, SecondExtra) VALUES
       ('BE_JEBEL_BARKAL_HOLY_SITE_BASE_YIELD_MODIFIER', 'YieldType', 'YIELD_FAITH', NULL, NULL),
       ('BE_JEBEL_BARKAL_HOLY_SITE_BASE_YIELD_MODIFIER', 'Amount', '1', NULL, NULL);

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

INSERT INTO RequirementSetRequirements (RequirementSetId, RequirementId) VALUES
       ('DISTRICT_IS_HOLY_SITE_DESERT', 'REQUIRES_DISTRICT_IS_HOLY_SITE'),
       ('DISTRICT_IS_HOLY_SITE_DESERT', 'PETRA_YIELD_MODIFIER_REQUIRES_PLOT_HAS_DESERT');
Basically, what this part of my code is supposed to do is to give Holy Sites that are placed on either flat Desert or Desert Hills a 1 Faith base yield (similar to how the Royal Navy Dockyard gets 2 Gold when not on your home continent) when you build Jebel Barkal. Using SQLite Studio I checked that everything correctly loads into the database into the correct tables. 'REQUIRES_DISTRICT_IS_HOLY_SITE' and 'PETRA_YIELD_MODIFIER_REQUIRES_PLOT_HAS_DESERT' are already defined in the game.
However, the Holy Site does not gain any yields when testing it in-game. Built Jebel Barkal, placed the district on desert and finished construction. Even went to the next turn.
 
In order for MODIFIER_PLAYER_DISTRICT_ADJUST_BASE_YIELD_CHANGE to work the source needs to be table DistrictModifiers. There is no case where Firaxis uses MODIFIER_PLAYER_DISTRICT_ADJUST_BASE_YIELD_CHANGE in any other way.

Try MODIFIER_PLAYER_DISTRICTS_ADJUST_YIELD_CHANGE instead, which as far as I recall will work and allow SubjectRequirementSetId to be assigned to limit which disctrict and under which other conditions the affect should be applied, and does not need the source to be a DistrictModifier.
Code:
		<Row>
			<ModifierId>TRAIT_AQUEDUCT_FAITH</ModifierId>
			<ModifierType>MODIFIER_PLAYER_DISTRICTS_ADJUST_YIELD_CHANGE</ModifierType>
			<SubjectRequirementSetId>DISTRICT_IS_AQUEDUCT_FAITH</SubjectRequirementSetId>
		</Row>
 
Aha, thanks! I'll try that tomorrow.
Any idea what's the difference between these two modifiers?

EDIT: Your solution worked perfectly, thanks again!
 
Last edited:
Is it possible to code a ranged unit and siege unit with BOTH RangedCombat And Bombard In <Units> table in UnitGameplay.xml ? What will happens to any other modifiers or will it crash the game entirely?

If mod code RangedCombat to UNIT_ARTILLERY, As Level1 Unit. will it deals full damage against land units ?
 
Aha, thanks! I'll try that tomorrow.
Any idea what's the difference between these two modifiers?

EDIT: Your solution worked perfectly, thanks again!
The differences are
  1. the one is Singular (_PLAYER_DISTRICT) and the game infers that the district type that should be affected for that player is the same one the ModifierId is attached to in table DistrictModifiers. So the ModifierType MODIFIER_PLAYER_DISTRICT_ADJUST_BASE_YIELD_CHANGE fails when the source for attaching the modifier is not table DistrictModifiers.
  2. The other is Plural (PLAYER_DISTRICTS) and the game applies the affect to all districts the player own unless a set of requirements is attached to the ModifierId that limits what District should qualify for the effect, and any additional limiting requirements if any that ought to be met. And the ModifierId can be "sourced" from any X-Modifiers game table.
 
Hi i am new to SQL. It seems the word and "column" has specific meaning in SQL, how to define it in SQL if the game xml file is using column ?

Example base game xml below which use column:-
Code:
<Row UnitPromotionType="PROMOTION_RANGER" Name="LOC_PROMOTION_RANGER_NAME" Description="LOC_PROMOTION_RANGER_DESCRIPTION" Level="1" Column="1" Specialization="" PromotionClass="PROMOTION_CLASS_RECON"/>

Thanks.
 
Last edited:
Hi i am new to SQL. It seems the word "value" and "column" has specific meaning in SQL, how to define them in SQL if the game xml file is using value or column ?

Example base game xml below which use value and column:-
Code:
<Row>
      <ModifierId>TOWERDEFENSE_ZOMBIE_COMBAT_STRENGTH_FROM_PROPERTY</ModifierId>
      <Name>Scalar</Name>
      <Value>.5</Value>
</Row>

<Row UnitPromotionType="PROMOTION_RANGER" Name="LOC_PROMOTION_RANGER_NAME" Description="LOC_PROMOTION_RANGER_DESCRIPTION" Level="1" Column="1" Specialization="" PromotionClass="PROMOTION_CLASS_RECON"/>

Thanks.
Code:
INSERT INTO ModifierArguments (ModifierId, Name, Value) VALUES
        ('TOWERDEFENSE_ZOMBIE_COMBAT_STRENGTH_FROM_PROPERTY', 'Scalar', '0.5');

INSERT INTO UnitPromotions (UnitPromotionType, Name, Description, Level, Column, Specialization, PromotionClass) VALUES
        ('PROMOTION_RANGER', 'LOC_PROMOTION_RANGER_NAME', 'LOC_PROMOTION_RANGER_DESCRIPTION', '1', '1', NULL, 'PROMOTION_CLASS_RECON');
if you insert something new or
Code:
UPDATE ModifierArguments SET Value='1000' WHERE ModifierId='TOWERDEFENSE_ZOMBIE_COMBAT_STRENGTH_FROM_PROPERTY' AND Name='Scalar';

UPDATE UnitPromotions SET Column='3' WHERE UnitPromotionType='PROMOTION_RANGER' AND PromotionClass='PROMOTION_CLASS_RECON';
if you want to edit existing stuff.
There's nothing special about "Value" or "Column" here, they're just the names of the table columns in the database table. SQL doesn't have any problems with it.
 
There's nothing special about "Value" or "Column" here, they're just the names of the table columns in the database table. SQL doesn't have any problems with it.

Many thanks, it is fun to learn modding in civ6. Before this i directly alter the xml files, but it is difficult to track and troublesome to redo after every game update.
 
Yep, I used to do the same. SQL is pretty good once you get the hang of it.
It can also be a good idea to take a look at other mods and see how they do certain stuff. It can help you a lot (at least it did help me :D ).
 
When cities are captured the buildings are pillaged. Is there any way to edit the sql to prevent this?
If not, is there any way for you to be able to repair a building you haven't researched yet?
 
So, i've been brainstorming a few ideas of what mod to work on next, and i figured since a lot of you are more experienced than i in modmaking, you'd have a clearer idea of what is possible to change with mods and what isn't. I'm wondering if it's theoretically possible to build a mod that blocks you from hiring great people if the game didn't reach a certain age yet, or if you haven't reached a certain age yet. Also if it's possible to make it so that the same great person could be offered over and over again. What are your opinions?
 
So, i've been brainstorming a few ideas of what mod to work on next, and i figured since a lot of you are more experienced than i in modmaking, you'd have a clearer idea of what is possible to change with mods and what isn't. I'm wondering if it's theoretically possible to build a mod that blocks you from hiring great people if the game didn't reach a certain age yet, or if you haven't reached a certain age yet. Also if it's possible to make it so that the same great person could be offered over and over again. What are your opinions?
I'm not sure if it is possible to dynamicly disable a Player from hiring a certain GP Type, but you can use "EFFECT_ADJUST_NO_GREAT_PERSON_POINTS" and specify the GP Type, with any requirement applicable, like "REQUIREMENT_PLAYER_ERA_AT_LEAST", to stop a Player from acquiring GPP for a certain GP Type, but the Unit will still be acquirable via Gold or Faith.

There is also "MODIFIER_PLAYER_UNIT_BUILD_DISABLED" to dynamicly enable/disable the instruction to build a Unit Type (all the different GP Types are also different UnitTypes), but I think this only applies to buildable Units, which GP aren't.

About the second question: I'm not sure about that. Maybe it is possible, but you will have to use Lua for that. I guess you have to just test this.

When cities are captured the buildings are pillaged. Is there any way to edit the sql to prevent this?
If not, is there any way for you to be able to repair a building you haven't researched yet?
There is this Global Parameter "PILLAGE_BUILDING_REPAIR_PERCENT" with Value: 25. Try changing the Value and see how it's working. Perhaps 100 will reverse the pillaging damage.
You can instantly repair pillaged Buildings by using Lua though.
 
I'm not sure if it is possible to dynamicly disable a Player from hiring a certain GP Type, but you can use "EFFECT_ADJUST_NO_GREAT_PERSON_POINTS" and specify the GP Type, with any requirement applicable, like "REQUIREMENT_PLAYER_ERA_AT_LEAST", to stop a Player from acquiring GPP for a certain GP Type, but the Unit will still be acquirable via Gold or Faith.

There is also "MODIFIER_PLAYER_UNIT_BUILD_DISABLED" to dynamicly enable/disable the instruction to build a Unit Type (all the different GP Types are also different UnitTypes), but I think this only applies to buildable Units, which GP aren't.

About the second question: I'm not sure about that. Maybe it is possible, but you will have to use Lua for that. I guess you have to just test this.


There is this Global Parameter "PILLAGE_BUILDING_REPAIR_PERCENT" with Value: 25. Try changing the Value and see how it's working. Perhaps 100 will reverse the pillaging damage.
You can instantly repair pillaged Buildings by using Lua though.
100 and 0 did not reverse the damage unfortunately. still wondering if there is a way to prevent a building from being pillaged after the city has been captured.
 
Could someone point me in a right place if I want to add my own 3D model as a custom leaderhead?
I have been working on one and just cant seem to figure out where to start.
I recently got back to this and my old mod has just a 2D picture..

I'm still in the process of trying to get that working on Gathering Storm but still I thought I could ask already since
I will most likely need some tips on this as I'm not the most experienced with coding, mostly 3D modeler / animator :crazyeye:

Thanks and sorry for this question in case it's stupid!
 
Any way to display the experience bar on a spy, great person, or settler?
edit: apparently the experience bar is linked to a unit having combat strength
 
Last edited:
How will the game resolves the combat under situations.
1. There are two antagonizing tag classes; Tank class and Antitank class. The Antitank class has a default Antitank ability (+10 strenghts VS Tank class unit, affecting tag)
2. Antitank class uses Ranged promotion class, Tank class uses its own promo tree.
3. A tank class unit earned a promotion similiar to Barding. (same protection against ranged attack)
4. An antitank unit shoot at the same Tank class unit.

How will damage is dealth? How will the game calculates damage numbers dealth?
And is it sitll neccessary to give Antitank unit its own promo tree?
 
Back
Top Bottom