Quick Modding Questions Thread

@alknicteos
Code:
[1870812.551] [Gameplay] ERROR: no such column: Amount
[1870812.551] [Gameplay]: In Query - UPDATE ModifierArguments SET "Amount" = ? WHERE "ModifierId" = ?;
This error message was not related to any of the code you posted in your message. There is no Update command anywhere within the code you posted on message # 718

However, the error messages are quite correct. There is no Column called "Amount" in any of the game's tables, especially none in table ModifierArguments. "Amount" is an argument value for column "Name". It is the "Value" column which needs to be changed in an Update, but only where the "Name" argument matches to "Amount" and the "ModifierId" argument matches to the correct modifier as well. Using an Update to change data in a row while only matching the "Where" conditions to a ModifierId is likely to fail with interesting results pretty much all the time.
 
I wanted my encampments to have an airslot - so I just added it in directly to the Expansion2_Districts.xml like so:

Code:
<Update>
            <Where DistrictType="DISTRICT_ENCAMPMENT"/>
            <Set>
                <Airslots>1</Airslots>
            </Set>
        </Update>

It works correctly, my only issue is that it now displays the little airslot icon from the beginning of the game (before flight is discovered) and replaces the health bar. Is there a quick/easy way to get rid of that? I tried looking for the way it works for a city, unable to find that though.
It's going to be buried in one of the User Interface lua files.
 
Stupid question, but I'm having trouble finding out what the modifier is for a flat increase (+5/turn) to city loyalty for a custom building, as well as how to increase a city's outgoing loyalty pressure. Any help would be appreciated!
 
It's going to be buried in one of the User Interface lua files.
yea looks like ive got bigger problems anyway, looks like it's not just removing the health bar but ranged attack capability as well. the health mechanic is still there, needs to be attacked and have its wall then health brought down before it can be occupied, but ranged attack is gone. Wish there was a nice quick and easy way to give it an airslot in the same way a city has one, just as a sort of default with no marker
 
oh, rofl. Many thanks LeeS. It's of course value, ... and I wondered why the diplomat goverment loyality malus for foreign cities hasn't changed... I felt 2 was too low, and changed it to 6. So, my database log doesn't show any error anymore. So, could you help me, again ? So, that each kind of power plant increase the regional range of power plants ( or what it is current, industrial and entertainment, my base was the mexico city bonus range ) ?
 
not understanding why this is not working. Specifically am I using the update or where command wrong?

Code:
<GameData>
    <Buildings>
        <Update>
        <!--Science-->
            <Where BuildingType = "BUILDING_LIBRARY"/>
            <Set Maintenance = "10"/>
          
            <Where BuildingType = "BUILDING_UNIVERSITY"/>
            <Set Maintenance = "20"/>
          
            <Where BuildingType = "BUILDING_MADRASA"/>
            <Set Maintenance = "20"/>
          
            <Where BuildingType = "BUILDING_RESEARCH_LAB"/>
            <Set Maintenance = "30"/>
      
        <!--CULTURE-->
            <Where BuildingType = "BUILDING_AMPHITHEATER"/>
            <Set Maintenance = "10"/>
          
            <Where BuildingType = "BUILDING_MUSEUM_ART"/>
            <Set Maintenance = "20"/>
          
            <Where BuildingType = "BUILDING_MUSEUM_ARTIFACT"/>
            <Set Maintenance = "20"/>
          
            <Where BuildingType = "BUILDING_BROADCAST_CENTER"/>
            <Set Maintenance = "30"/>
      
        <!--FAITH-->
            <Where BuildingType = "BUILDING_SHRINE"/>
            <Set Maintenance = "10"/>
          
            <Where BuildingType = "BUILDING_TEMPLE"/>
            <Set Maintenance = "20"/>
          
        </Update>
    </Buildings>
</GameData>
 
Hello. I'm trying to get an effect for a Great General but am having problems.

Does anyone know if it's possible to have a GG give a unit on retirement, but have it be a random choice of say 3 different units?

I'm using SQL.

Thank you in advance for any help you can give.
 
has anyone encountered ERROR: near "Effects": syntax error? what does it mean? I understand that this error is common for sql but i'm getting this using and xml file.
 
Last edited:
has anyone encountered ERROR: near "Effects": syntax error? what does it mean? I understand that this error is common for sql but i'm getting this using and xml file.

It means you have a syntax error near the term "Effects" in your code. Search your code for that term and check the syntax just prior to each instance.
 
I have tried to edit the technologies files a bit to make the game go by a bit slower in terms of the pace in which yourself and the AI gets through the tech tree.
I am trying to edit the file found at:
Sid Meier's Civilization VI > Base > Assets > Gameplay > Data > Technologies

It changes the science needed for techs in the ancient, classical, medieval and information eras.
But the science needed for techs in the Renaissance, industrial, modern and atomic eras stay the same.

Anyone able to explain why this is the case?
I have all the expansions, so not sure if there's another file that I am supposed to edit instead.
 
...
It changes the science needed for techs in the ancient, classical, medieval and information eras.
But the science needed for techs in the Renaissance, industrial, modern and atomic eras stay the same.
Do you edit vanilla data or a seperate mod ? If it is a mod, then it may help to change the id in the modinfo. I had a similar problem, and I believe some things are getting cached. If you change the id in the modinfo, you have to turn the mod on again. If you mod vanilla data, then there are some cost updates in dlc data area too.

this works well for me
Spoiler :

Code:
UPDATE Technologies SET Cost = Cost*1.5 WHERE EraType ='ERA_ANCIENT';
UPDATE Technologies SET Cost = Cost*2.5 WHERE EraType ='ERA_CLASSICAL';
UPDATE Technologies SET Cost = Cost*3 WHERE EraType ='ERA_MEDIEVAL';
UPDATE Technologies SET Cost = Cost*3.5 WHERE EraType ='ERA_RENAISSANCE';
UPDATE Technologies SET Cost = Cost*4 WHERE EraType ='ERA_INDUSTRIAL';
UPDATE Technologies SET Cost = Cost*5 WHERE EraType ='ERA_MODERN';
UPDATE Technologies SET Cost = Cost*5 WHERE EraType ='ERA_ATOMIC';
UPDATE Technologies SET Cost = Cost*5 WHERE EraType ='ERA_INFORMATION';
UPDATE Technologies SET Cost = Cost*5 WHERE EraType ='ERA_FUTURE';
UPDATE TechnologyRandomCosts SET Cost=Cost*5;
UPDATE Civics SET Cost = Cost*1.5 WHERE EraType ='ERA_ANCIENT';
UPDATE Civics SET Cost = Cost*2.5 WHERE EraType ='ERA_CLASSICAL';
UPDATE Civics SET Cost = Cost*3 WHERE EraType ='ERA_MEDIEVAL';
UPDATE Civics SET Cost = Cost*3.5 WHERE EraType ='ERA_RENAISSANCE';
UPDATE Civics SET Cost = Cost*4 WHERE EraType ='ERA_INDUSTRIAL';
UPDATE Civics SET Cost = Cost*5 WHERE EraType ='ERA_MODERN';
UPDATE Civics SET Cost = Cost*5 WHERE EraType ='ERA_ATOMIC';
UPDATE Civics SET Cost = Cost*5 WHERE EraType ='ERA_INFORMATION';
UPDATE Civics SET Cost = Cost*5 WHERE EraType ='ERA_FUTURE';
UPDATE CivicRandomCosts SET Cost=Cost*5;
UPDATE Eras SET GreatPersonBaseCost = GreatPersonBaseCost*1.5 WHERE EraType = 'ERA_ANCIENT';
UPDATE Eras SET GreatPersonBaseCost = GreatPersonBaseCost*1.5 WHERE EraType = 'ERA_CLASSICAL';
UPDATE Eras SET GreatPersonBaseCost = GreatPersonBaseCost*1.5 WHERE EraType = 'ERA_MEDIEVAL';
UPDATE Eras SET GreatPersonBaseCost = GreatPersonBaseCost*1.5 WHERE EraType = 'ERA_RENAISSANCE';
UPDATE Eras SET GreatPersonBaseCost = GreatPersonBaseCost*1.5 WHERE EraType = 'ERA_INDUSTRIAL';
UPDATE Eras SET GreatPersonBaseCost = GreatPersonBaseCost*1.5 WHERE EraType = 'ERA_MODERN';
UPDATE Eras SET GreatPersonBaseCost = GreatPersonBaseCost*1.5 WHERE EraType = 'ERA_ATOMIC';
UPDATE Eras SET GreatPersonBaseCost = GreatPersonBaseCost*1.5 WHERE EraType = 'ERA_INFORMATION';
UPDATE Eras SET GreatPersonBaseCost = GreatPersonBaseCost*1.5 WHERE EraType = 'ERA_FUTURE';
UPDATE Resource_Consumption SET CO2perkWh = CO2perkWh/4;


UPDATE GlobalParameters SET Value = Value*1.5 WHERE Name = 'CITY_GROWTH_MULTIPLIER';
UPDATE GlobalParameters SET Value = Value*1.1 WHERE Name = 'CITY_GROWTH_EXPONENT';
 
does anyone know, how to change the required unit xp for level up on game speeds ? I can't find anything related to this ....
 
I have tried to edit the technologies files a bit to make the game go by a bit slower in terms of the pace in which yourself and the AI gets through the tech tree.
I am trying to edit the file found at:
Sid Meier's Civilization VI > Base > Assets > Gameplay > Data > Technologies

It changes the science needed for techs in the ancient, classical, medieval and information eras.
But the science needed for techs in the Renaissance, industrial, modern and atomic eras stay the same.

Anyone able to explain why this is the case?
I have all the expansions, so not sure if there's another file that I am supposed to edit instead.


If you are using Gathering Storm, some tech costs were updated, they may be overwriting your changes depending on LoadOrder. Also Future tech now has variable cost and use a new table.

This very topic was discussed recently here https://forums.civfanatics.com/threads/problem-with-increase-technology-mod.658117/
 
does anyone know, how to change the required unit xp for level up on game speeds ? I can't find anything related to this ....
Just offhand, I know there's an "EXPERIENCE_NEEDED_FOR_NEXT_LEVEL_MULTIPLIER" in the GlobalParameters table.
 
does anyone know, how to change the required unit xp for level up on game speeds ? I can't find anything related to this ....


EXPERIENCE_NEEDED_FOR_NEXT_LEVEL_MULTIPLIER found in GlobalParameters.xml can change the XP multiplier. The default value is 5, which is then multiplied by the I believe hard-coded XP value for each level.
 
I have changed it the multiplier to 3, and 27 xp for lvl 1 on marathon looks good. Even if I never play faster than epic, normally marathon, how could i tie this only to marathon speed?
 
also another issue ... I want to have a base malus for each great people from -2 . can MODIFIER_PLAYER_ADJUST_GREAT_PERSON_POINTS be negative ? this
Code:
<TraitModifiers>
        <Row TraitType="TRAIT_LEADER_MAJOR_CIV" ModifierId="BASE_GP_NERF_PROPHET"/>
    </TraitModifiers>
 
    <Modifiers>
        <Row>
            <ModifierId>BASE_GP_NERF_PROPHET</ModifierId>
            <ModifierType>MODIFIER_PLAYER_ADJUST_GREAT_PERSON_POINTS</ModifierType>
        </Row>
    </Modifiers>
 
    <ModifierArguments>
        <Row>
            <ModifierId>BASE_GP_NERF_PROPHET</ModifierId>
            <Name>GreatPersonClassType</Name>
            <Value>GREAT_PERSON_CLASS_PROPHET</Value>
        </Row>
    </ModifierArguments>
 
    <ModifierArguments>
        <Row>
            <ModifierId>BASE_GP_NERF_PROPHET</ModifierId>
            <Name>Amount</Name>
            <Value>-2</Value>
        </Row>
    </ModifierArguments>
seems not to work. the base template is a great person policy card

... the longer story is, that I have changed the base cost of settlers to 200 but only +20 instead of +30 for each settler. But with this the first great persons are earned to fast. And so I would like to introduce some basic resistance of -2 to great people, except maybe artists and musicians

edit: I guess I will look into a game with this
Code:
UPDATE Eras SET GreatPersonBaseCost = GreatPersonBaseCost*3 WHERE EraType = 'ERA_ANCIENT';
UPDATE Eras SET GreatPersonBaseCost = GreatPersonBaseCost*2.5 WHERE EraType = 'ERA_CLASSICAL';
UPDATE Eras SET GreatPersonBaseCost = GreatPersonBaseCost*2 WHERE EraType = 'ERA_MEDIEVAL';
UPDATE Eras SET GreatPersonBaseCost = GreatPersonBaseCost*1.5 WHERE EraType = 'ERA_RENAISSANCE';
and 1.5 also after renaissance
 
Last edited:
Ok.

So...

One XML file was not (re?)loading because of that :
Code:
[2286600.398] [ColorManager] ERROR: UNIQUE constraint failed: Colors.Type
[2286600.398] [ColorManager]: While executing - 'insert into Colors('Type', 'Color') values (?, ?);'
[2286600.398] [ColorManager]: In XMLSerializer while inserting row into table insert into Colors('Type', 'Color') with  values (COLOR_UNKNOWN, 255,255,255,255, ).
[2286600.398] [ColorManager]: In XMLSerializer while updating table Colors from file [...]/Documents/My Games/Sid Meier's Civilization VI/Mods/YnAMP - Basic Modern Civilizations/Data/Colors.xml.

but... Colors.xml was using only <Replace> tags, and no "COLOR_UNKNOWN" string in the file...

:hmm:

moved from xml to sql for that file, seems fine on return to main menu and in game now.
Hi, I have encountered this problem multiple times, got no clues why this bug happened, and there is a chance that it disappeared randomly. Are there other ways to fix this problem?
 
Back
Top Bottom