Quick Modding Questions Thread

I thought the OP was moving BOTH abilities to the Telecom tech to completely remove the icon from Computers and place it on another tech. What I'd do is:
Code:
UPDATE TechnologyModifiers
SET TechnologyType = 'TECH_TELECOMMUNICATIONS'
WHERE ModifierId = 'TECH_GRANT_SPY';

UPDATE TechnologyModifiers
SET TechnologyType = 'TECH_TELECOMMUNICATIONS'
WHERE ModifierId = 'COMPUTERS_BOOST_ALL_TOURISM';

UPDATE Technologies
SET Description = NULL
WHERE TechnologyType = 'TECH_COMPUTERS';

UPDATE Technologies
SET Description = 'LOC_MY_TECH_TELECOMMUNICATIONS_DESCRIPTION'
WHERE TechnologyType = 'TECH_TELECOMMUNICATIONS';

And then add your description to an UpdateText file:
Code:
INSERT INTO LocalizedText
       (Language, Tag, Text)
VALUES ('en_US', 'LOC_MY_TECH_TELECOMMUNICATIONS_DESCRIPTION', 'Grants the ability to construct an additional Spy. +100% [ICON_Tourism] Tourism across your empire.');

Or, you could do as Lee suggested and just place the text in the tech description update statement instead of using a LOC tag.
 
Yes I am trying to remove both the +1 spy and +tourism% ability entirely from computers and place them both in telecoms

I thought the OP was moving BOTH abilities to the Telecom tech to completely remove the icon from Computers and place it on another tech. What I'd do is:
Code:
UPDATE TechnologyModifiers
SET TechnologyType = 'TECH_TELECOMMUNICATIONS'
WHERE ModifierId = 'TECH_GRANT_SPY';

UPDATE TechnologyModifiers
SET TechnologyType = 'TECH_TELECOMMUNICATIONS'
WHERE ModifierId = 'COMPUTERS_BOOST_ALL_TOURISM';

UPDATE Technologies
SET Description = NULL
WHERE TechnologyType = 'TECH_COMPUTERS';

UPDATE Technologies
SET Description = 'LOC_MY_TECH_TELECOMMUNICATIONS_DESCRIPTION'
WHERE TechnologyType = 'TECH_TELECOMMUNICATIONS';

And then add your description to an UpdateText file:
Code:
INSERT INTO LocalizedText
       (Language, Tag, Text)
VALUES ('en_US', 'LOC_MY_TECH_TELECOMMUNICATIONS_DESCRIPTION', 'Grants the ability to construct an additional Spy. +100% [ICON_Tourism] Tourism across your empire.');

Or, you could do as Lee suggested and just place the text in the tech description update statement instead of using a LOC tag.
 
Code:
UPDATE TechnologyModifiers
SET TechnologyType = 'TECH_TELECOMMUNICATIONS'
WHERE TechnologyType = 'TECH_COMPUTERS';

UPDATE Technologies
SET Description='LOC_TECH_COMPUTERS_DESCRIPTION'
WHERE TechnologyType = 'TECH_TELECOMMUNICATIONS';

UPDATE Technologies
SET Description = NULL
WHERE TechnologyType = 'TECH_COMPUTERS';
Since you want to move everything you may as well move everything whole-cloth.

Or you could use LOC_MY_TECH_TELECOMMUNICATIONS_DESCRIPTION as suggested by L.K.
 
@Lonecat Nekophrodite

LOC_BOOST_TRIGGER_STIRRUPS already is defined in the game's vanilla localization files. You cannot attempt to do this
Code:
<Row Tag="LOC_BOOST_TRIGGER_STIRRUPS" Text="Own 3 Heavy Chariots." Language="en_US"/>
because there is already a Tag called LOC_BOOST_TRIGGER_STIRRUPS.

You can generally do this with stuff already in the Vanilla Base game
Code:
<Replace Tag="LOC_BOOST_TRIGGER_STIRRUPS" Text="Own 3 Heavy Chariots." Language="en_US"/>
But you cannot do this
Code:
<Row Tag="LOC_BOOST_TRIGGER_STIRRUPS" Text="Own 3 Heavy Chariots." Language="en_US"/>
Good it works as it should.

upload_2020-6-13_11-7-51.png


Finally!

Right now the tech is 'dummy' because i haven't add associating unit in game yet because i have to re-work on this mod from ground up... one faulty asset did ruin an entier mod.
But now it worked out to support things to add later on.
 
Is there a way to quickly find all Child tables associated with a Parent table in SQLite?

Example: I'm using CTRL-F in the text editor to find all occurrences of "REFERENCES Buildings" in GameplaySchema.sql. I get:

Building_CitizenYieldChanges
Building_GreatPersonPoints
Building_GreatWorks
Building_RequiredFeatures
Building_ValidFeatures
Building_ValidTerrains
Building_YieldChanges
...
bunch of other stuff.

Is there an easier way to get this info?
 
Code:
UPDATE TechnologyModifiers
SET TechnologyType = 'TECH_TELECOMMUNICATIONS'
WHERE TechnologyType = 'TECH_COMPUTERS';

UPDATE Technologies
SET Description='LOC_TECH_COMPUTERS_DESCRIPTION'
WHERE TechnologyType = 'TECH_TELECOMMUNICATIONS';

UPDATE Technologies
SET Description = NULL
WHERE TechnologyType = 'TECH_COMPUTERS';
Since you want to move everything you may as well move everything whole-cloth.

Or you could use LOC_MY_TECH_TELECOMMUNICATIONS_DESCRIPTION as suggested by L.K.

Worked like a charm - thanks

now for the next thing!

I'm trying to slow down City State border growth. As I understand it, A city state grows whenever it receives an envoy from a major Civ. I was trying to maybe half or third that, but I don't think it's really something that can be broken down like that. Regardless, I'm unable to find exactly where this 1-to-1 "envoy for a tile" formula is. I found a mod called "polite city states" that pinpoints some of this:

Code:
UPDATE CivilizationLevels SET CanAnnexTilesWithReceivedInfluence = 0, CanAnnexTilesWithGold = 0, CanAnnexTilesWithCulture = 0
WHERE CivilizationLevelType = 'CIVILIZATION_LEVEL_CITY_STATE';

But as you could guess this reduces the city state's ability to grow AT ALL to zero, and remains a city tile with 6 around it for the entire game. Now I thought maybe I could keep the influence annexation off and flip them over to being culture growth - but I'd still need them to have reduced culture overall. I poked around in Zee's Distance Is A Good Thing and found this:

Code:
-- Increased tile growth by culture
UPDATE GlobalParameters SET Value = 1.2 WHERE Name = 'CULTURE_COST_LATER_PLOT_EXPONENT';         -- default 1.3
UPDATE GlobalParameters SET Value = 5    WHERE Name = 'CULTURE_COST_LATER_PLOT_MULTIPLIER';        -- default 6

Tile growth via culture is a global parameter, so not sure how I'd go about increasing a tile's culture cost just for a city state.

I also thought maybe I could simply remove a city-state's default palace as well, but I can't seem to find that anywhere either (or any of the auto-generated buildings a city-state gets, like their walls, etc)

Anyone have any insight on how I could shrink city-states? I'd just prefer them to take up less real estate, particularly late-game.
 
The GlobalParameters you are looking at are indeed Global -- they effect everyone.

City-States do not have custom versions of Buildings such as Palace or Walls. They get the same ones everyone uses.

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

"DynamicModifiers"
[table=head]ModifierType | CollectionType | EffectType
MODIFIER_ALL_CITIES_CULTURE_BORDER_EXPANSION | COLLECTION_ALL_CITIES | EFFECT_ADJUST_CITY_CULTURE_BORDER_EXPANSION[/table]
"Modifiers"
[table=head]ModifierId | ModifierType
RELIGIOUS_SETTLEMENTS_CULTUREBORDER | MODIFIER_ALL_CITIES_CULTURE_BORDER_EXPANSION[/table]
"ModifierArguments"
[table=head]ModifierId | Name | Value
RELIGIOUS_SETTLEMENTS_CULTUREBORDER | Amount | 15[/table]
You ought to be able to use this as a template to
  1. Create a new "ModifierType" in table "DynamicModifiers" where the "CollectionType" is "COLLECTION_PLAYER_CITIES" instead of "COLLECTION_ALL_CITIES"
  2. Create a ModifierId in table "Modifiers" using this new "ModifierType" argument.
  3. Give a negative Value for the "Amount" in table "ModifierArguments"
    • Assuming a negative amount is implemented. Very often negative amount values are implemented as desired, and other often times they are not. It's a dice-roll for any given type of modifier whether a negative value in table "ModifiersArguments" for the "Amount" argument will be implemented correctly by the game.
  4. Add the ModifierId in step #2 to the City-State default "leader" in table "TraitModifiers" by using the following as the TraitType
    Code:
    TraitType="MINOR_CIV_DEFAULT_TRAIT"
    All City-States "inheret" anything given to that Trait.
 
The GlobalParameters you are looking at are indeed Global -- they effect everyone.

City-States do not have custom versions of Buildings such as Palace or Walls. They get the same ones everyone uses.

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

"DynamicModifiers"
[table=head]ModifierType | CollectionType | EffectType
MODIFIER_ALL_CITIES_CULTURE_BORDER_EXPANSION | COLLECTION_ALL_CITIES | EFFECT_ADJUST_CITY_CULTURE_BORDER_EXPANSION[/table]
"Modifiers"
[table=head]ModifierId | ModifierType
RELIGIOUS_SETTLEMENTS_CULTUREBORDER | MODIFIER_ALL_CITIES_CULTURE_BORDER_EXPANSION[/table]
"ModifierArguments"
[table=head]ModifierId | Name | Value
RELIGIOUS_SETTLEMENTS_CULTUREBORDER | Amount | 15[/table]
You ought to be able to use this as a template to
  1. Create a new "ModifierType" in table "DynamicModifiers" where the "CollectionType" is "COLLECTION_PLAYER_CITIES" instead of "COLLECTION_ALL_CITIES"
  2. Create a ModifierId in table "Modifiers" using this new "ModifierType" argument.
  3. Give a negative Value for the "Amount" in table "ModifierArguments"
    • Assuming a negative amount is implemented. Very often negative amount values are implemented as desired, and other often times they are not. It's a dice-roll for any given type of modifier whether a negative value in table "ModifiersArguments" for the "Amount" argument will be implemented correctly by the game.
  4. Add the ModifierId in step #2 to the City-State default "leader" in table "TraitModifiers" by using the following as the TraitType
    Code:
    TraitType="MINOR_CIV_DEFAULT_TRAIT"
    All City-States "inheret" anything given to that Trait.

Am I even close with this lol:

Code:
<GameData>
<DynamicModifiers>
        <Row>
            <ModifierType>MODIFIER_CITY_STATE_BORDER</ModifierType>
            <CollectionType>COLLECTION_PLAYER_CITIES</CollectionType>
                        <EffectType>EFFECT_ADJUST_CITY_CULTURE_BORDER_EXPANSION</EffectType>
        </Row>
   </DynamicModifiers>
   <Modifiers>
                <Row>
                        <ModifierId>CITY_STATE_BORDER_GROWTH</ModifierId>
            <ModifierType>MODIFIER_CITY_STATE_BORDER</ModifierType>
        </Row>
   </Modifiers>
   <ModifierArguments>
                <Row>
            <ModifierId>CITY_STATE_BORDER_GROWTH</ModifierId>           
                        <Name>BuildingType</Name>
            <Value>BUILDING_PALACE</Value>
        </Row>
                <Row>
            <ModifierId>CITY_STATE_BORDER_GROWTH</ModifierId>           
                        <Name>YieldType</Name>
            <Value>YIELD_CULTURE</Value>
        </Row>
                <Row>
            <ModifierId>CITY_STATE_BORDER_GROWTH</ModifierId>           
                        <Name>Amount</Name>
            <Value>-2</Value>
        </Row>
   </ModifierArguments>
   <TraitModifiers>
      <Row TraitType="MINOR_CIV_DEFAULT_TRAIT" ModifierId="CITY_STATE_BORDER_GROWTH"/>
   </TraitModifiers>
</GameData>

It's not working as far as I can tell (city state grows a tile same time I do still)
 
All you need is the Amount in table ModifierArguments. You do not want the BuildingType nor YieldType

And the Amount value is a percentage, so -2% is going to be hard to see.
 
All you need is the Amount in table ModifierArguments. You do not want the BuildingType nor YieldType

And the Amount value is a percentage, so -2% is going to be hard to see.

ah so its applied to overall culture? Or overall growth? that's where I'm lost, I dont see where in this code it's telling the game where to apply the number
 
It is applied to city culture border expansion rate. So it affects the normal parameters for how much culture is needed for border expansion.

EFFECT_ADJUST_CITY_CULTURE_BORDER_EXPANSION

It's the same one used by the Belief Religious Settlements that increases the rate of a player's border expansion. It does not affect the amount of culture a player's cities accumulate -- just how fast that accumulated culture results in tile expansion by the cultural expansion mechanism.
 
I'm trying to understand how are images in DDS files actually read by the game.

There's an IconSize and the number of rows/columns are given. Since all icons are squares it will know where the centre of an icon is and be able to search an index of images. It then reads the image outward from the centre of the square, unless different pixel coordinates are given via OffsetV/H.

3ob9JI2.png


Then there's a third one called Baseline which I can't even speculate about what it does. Defaults to zero.

Maybe I can get around not knowing this stuff but I'd rather have a basic understanding of what's actually going on.
 
2nd question:

Is there a way for me to figure out the gradient/opacity/fill and exact colour code being used for the resource icon? I was hoping there would be a copy of each (Bonus, Strat, Lux, Gray) in the game files but I can't find them. Basically the exact icon above but without a turtle over it.
 
Here I attach 3 screenshots of resources256 icon atlas (fragment).
One on white background (255, 255, 255, 255),
one on pink background (255, 0, 255, 255),
one on black background (0, 0, 0, 255).

But I don't know how to remove the background so that you get correct color values with alpha. Tell me if you know how to do it :)

Baseline is the parameter to adjust vertical icon alignment when used in text.

My question is: Is there a way to force all expansions, dlcs and scenarios to load so that I can access any icon atlas/texture/image present in the game? Game data like units, civs etc can be whatever.
 

Attachments

  • res_black.png
    res_black.png
    846.2 KB · Views: 76
  • res_pink.png
    res_pink.png
    885.8 KB · Views: 72
  • res_white.png
    res_white.png
    891.2 KB · Views: 27
Last edited:
Here I attach 3 screenshots of resources256 icon atlas (fragment).
One on white background (255, 255, 255, 255),
one on pink background (255, 0, 255, 255),
one on black background (0, 0, 0, 255).

But I don't know how to remove the background so that you get correct color values with alpha. Tell me if you know how to do it :)

Baseline is the parameter to adjust vertical icon alignment when used in text.

My question is: Is there a way to force all expansions, dlcs and scenarios to load so that I can access any icon atlas/texture/image present in the game? Game data like units, civs etc can be whatever.

Thanks, but what I'm looking for is this:

W2w4huZ.png


I don't know if there are other empty icons in the art assets folders with the purple / yellow / red transparency.

Naturally I can make an approximation of the original colours used in the game, but I would rather use the EXACT colour tone if possible.

My main issue is that the background is gradient. You can see in the coloured versions that the bottom is darker than the top. That complicates things a bit and I don't want to go through the trouble if the empty icons already exist somewhere.

The one above was copied from a file from Sukritact's resource mod. I don't know if he copied it from the game assets folder or if he made it himself.

Edit: I may have figured out a way.
 
Last edited:
I think I got it, though this is an entirely oblique way to go about it. The exact spot of layer opacity seems to be 60%. Thankfully the gradient is vertical:

59AYVF4.png


On each of these images, the left side is the edited purple, the right is the original purple. At the points where the colours meet, both at the top and bottom, they seem to match perfectly.
 
How can I search an entire database for a given entry? I feel like this should be obvious but I can't do it.

SELECT * FROM GreatPersonIndividuals WHERE GreatPersonIndividualType like '%spilsbury%'; -> Gives me all occurrences of Spilsbury within that table.

SELECT * FROM * WHERE GreatPersonIndividualType like '%spilsbury%'; doesn't work.
SELECT * WHERE GreatPersonIndividualType like '%spilsbury%'; also doesn't work.

Edit: Nvm there's a search tab at the top :coffee:
 
Last edited:
Back
Top Bottom