Quick Modding Questions Thread

I'm changing the way the spec ops unit works and I'm wondering 2 things about it:

1 - is there a way to give a unit 2 ranged attacks? like, 1 "bombard" and 1 "ranged"? So that the ranged attack would be weaker than the bombard but the bombard would have a range of basically 1 (thinking along the lines of an in-and-out chopper raid (far ranged) vs like, "planting a charge" (close range "bombard"))

I'm also curious if there's a way to change the ranged attack so that it looks more like a chopper raid - the unit turns into the attack chopper skin, but then runs over to the target and shoots it then returns back to its original hex, like a plane animation
 
Could you inspect Lua scripts about new yield? In fact, I ask a question about it a few month ago. But nobody respond my question, so I upload entire files in this thread. My issue is new yield does not increase, there are any changes about it though. I could use all the help I could get.
 

Attachments

What is the ModifierId of granting one-time busts of yields (for example,instantly 50 Gold,Science,Culture…)
 
What is the ModifierId of granting one-time busts of yields (for example,instantly 50 Gold,Science,Culture…)

My first thought was the Goody Huts...within the GoodyHuts.xml there are some configured. As an example, there's one called GOODY_GOLD_LARGE_MODIFIER which grants the player 120 Gold. I think the key parameter is RunOnce="true" being configured within the Modifiers table. I expect using that logic it would be easy enough to configure something similar - triggering it would be done using the appropriately-configured requirements.
 
A few quick-fire questions, if I may:

1. Can the distance between two civilizations' territory borders be used as a requirement? I have a loose idea for a UA/trait that grants a culture yield for a tile that is within X distance of another civilization's territory but no idea if this is possible.

2. Is it possible to have a modifier trigger based on a diplomatic deal being reached? Another loose idea - a culture-per-turn boost for the duration of an Open Borders agreement.

3. Is it possible to identify territory of a civilization that a player is at war with, such that you provide a modifier to units who are in that territory? That one's a bit fiddly in terms of language - in simple terms, let's say we want to grant all units of a civilization the ABILITY_KNARR_IGNORE_EMBARK_DISEMBARK_COST, but we only want it to apply when in enemy territory (i.e. someone they are at war with). Is this possible?

4. Is it possible to trigger a modifier based on a unit being fortified? Again, a loose idea, but I'd like to grant a specific type of ability to a unit, but only when it is fortified.

On all of the above, I'm not after detailed do-it-for-me answers - just trying to understand if the building blocks exist to allow for these, if anyone happens to know off-hand.

Edited: To add #4.
 
Last edited:
1 and 2 should be doable with lua.
3. There is couple of requirements: 'REQUIREMENT_UNIT_IN_ENEMY_TERRITORY' and 'REQUIREMENT_UNIT_IN_OWNER_TERRITORY'.
4 There is only 'REQUIREMENT_OPPONENT_IS_FORTIFIED' .
 
Could someone give me a quick rundown on .dds files? I see they are being referenced in certain parts of the code, but I cannot find these files anywhere in the civ game folder. Where are they? Is it possible to edit them?

For the most part, they're not 'exposed' to us as part of the base-game. They are, however, part of the SDK Assets that can be downloaded via Steam.

In general, the DDS files are used alongside TEX files, which are then 'cooked' via a proprietary method (which uses an XLP file parsed by ModBuddy, at least in the modding world) into BLP files. Those BLP files are within the Base\Platforms\ folder - but they can't be edited directly as far as I know.

Once you have the DDS files as part of the SDK Assets, however, the world is your oyster and you can take them and edit them to your heart's content. Editing them won't change anything in-game, though - you'd need to replace through mods I believe, if your goal is to change something in that way.

I, for one, am using the base-game leader DDS files to try and make my own leader artwork now - a small part asset-borrowing, a large part image manipulation (Photoshop).
 
Trying to create a district. How does one set the art for a district? As in the art that will appear in game and populate the map? I want to use the industrial zone if possible. Am using modbuddy.
 
Anyone has an idea why my alternate civ colors do not appear in game? It's not even possible to open the color selection drop-down menu for my civ...

My color update file bellow is set to be triggered triggered by the UpdateColors front-end and in-game actions. The leader ID also matches the leader ID for my civ.

Code:
INSERT INTO Colors
        (Type,                                         Red,     Green,     Blue,     Alpha)
VALUES    ('COLOR_PLAYER_RENE_LEVESQUE_PRIMARY',         10,        70,        170,    255), -- #0A46AA
        ('COLOR_PLAYER_RENE_LEVESQUE_SECONDARY',     250,    250,    250,    255); -- #FAFAFA

INSERT INTO PlayerColors
        (
            Type,
            Usage,

            PrimaryColor,
            SecondaryColor,

            Alt1PrimaryColor,
            Alt1SecondaryColor,

            Alt2PrimaryColor,
            Alt2SecondaryColor,

            Alt3PrimaryColor,
            Alt3SecondaryColor
        )
VALUES
        (
            'LEADER_RENE_LEVESQUE',
            'Unique',

            'COLOR_PLAYER_RENE_LEVESQUE_PRIMARY',
            'COLOR_PLAYER_RENE_LEVESQUE_SECONDARY',

            'COLOR_PLAYER_RENE_LEVESQUE_SECONDARY',
            'COLOR_PLAYER_RENE_LEVESQUE_PRIMARY',

            'COLOR_STANDARD_MAGENTA_DK',
            'COLOR_STANDARD_WHITE_LT',

            'COLOR_STANDARD_AQUA_MD',
            'COLOR_STANDARD_WHITE_LT'
        );

upload_2020-5-31_15-29-47.png



But in-game the drop down menu to select the alternate color for my civ is greyed out and won't open, and the colors in-game appear to be randomly selected...

Thanks in advance!
 
I always format my Colors table insert as follows:

Code:
INSERT INTO    Colors
        (Type,                                Color                )
VALUES    ('COLOR_MC_PRIMARY_A',        '255,255,255,255'        );

I did a quick lookup and it seems using Red, Blue, Green, Alpha should also be valid. But as a quick thing to try, perhaps worth it.

I always define each colour as a separate entity, so that the eight PlayerColors Type entries are different. Again, this is likely inefficient on my part, but I've never had an issue.

The code itself all looks fine to me.
 
I always format my Colors table insert as follows:

Code:
INSERT INTO    Colors
        (Type,                                Color                )
VALUES    ('COLOR_MC_PRIMARY_A',        '255,255,255,255'        );

I did a quick lookup and it seems using Red, Blue, Green, Alpha should also be valid. But as a quick thing to try, perhaps worth it.

I always define each colour as a separate entity, so that the eight PlayerColors Type entries are different. Again, this is likely inefficient on my part, but I've never had an issue.

The code itself all looks fine to me.


Thanks, that did the trick! It was actually the RGBA separated values in the Insert that caused the issue. For the rest, using some entries from Color several times in the PlayerColors doesn't cause any problem. Cheers! :)
 
Last edited:
Hi, I'm having an issue, and I hope, that somebody could help me :)

I want to increase range of power range of plants by building any power plant
so here is my attempt for this ( similar to oil and uran then)
Code:
    <BuildingModifiers>
         <Row>
            <BuildingType>BUILDING_COAL_POWER_PLANT</BuildingType>
            <ModifierId>CP_RANGE_BONUS</ModifierId>
         </Row>
    </BuildingModifiers>

    <Modifiers>
        <Row>
            <ModifierId>CP_RANGE_BONUS</ModifierId>
            <ModifierType>MODIFIER_PLAYER_DISTRICTS_ADJUST_EXTRA_REGIONAL_RANGE</ModifierType>
            <SubjectRequirementSetId>DISTRICT_IS_INDUSTRIAL_ZONE_OR_ENTERTAINMENT_COMPLEX</SubjectRequirementSetId>
        </Row>
    </Modifiers>

    <ModifierArguments>
        <Row>
            <ModifierId>CP_RANGE_BONUS</ModifierId>
            <Name>Amount</Name>
            <Value>1</Value>
        </Row>
    </ModifierArguments>

it is quite similar to a change a made with another building and it gives me :
[1870812.551] [Gameplay] ERROR: no such column: Amount
[1870812.551] [Gameplay]: In Query - UPDATE ModifierArguments SET "Amount" = ? WHERE "ModifierId" = ?;

... and another thing would be, to delete the QUEST_SEND_TRADE_ROUTE for city states ... i was only able to delete them all, ctd or no effect :(
 
@alknicteos - Unless you're tying it to a trait, policy, or something else that would require a modifier, I'd imagine the simplest way to achieve what you want would be something like:
Code:
UPDATE Buildings SET RegionalRange = RegionalRange + 1
WHERE BuildingType LIKE 'BUILDING_%_PLANT';
 
Many Thanks Laurana
, I have tried it on an existing game and it hasn't an effect there. Therefor I like xml. I still don't understand, how and where it caches the data, and so i always prefer xml. And I want it as an trait, it shall increase the range by one with each power plant, so building 3 coal, 2 fossil, 1 uran power plant -> +6 range in sum.
 
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.
 
Back
Top Bottom