Quick Modding Questions Thread

i literally just converted a wav to wem in wwise, renamed it according to the music bank text file, and dragged and replaced it into Sid Meier's Civilization VI\Base\Platforms\Windows\audio. I know it worked because that audio is now silent in game, but my song is not playing instead. just silence.
I have no idea what publishing in wwise entails, and I do not have any lua related to this.

By publishing I mean build your music bank, or how is said, that then I believe you added correctly. Try to run playsound By lua. If not are you adding for a civ? You add at civilization. Artdef
 
By publishing I mean build your music bank, or how is said, that then I believe you added correctly. Try to run playsound By lua. If not are you adding for a civ? You add at civilization. Artdef
so to explain, i'm not adding for a civ. I'm attempting to REPLACE the civs that are already in the game with new music. I have no music bank. I just drag the music into the game folder myself, like I explained. :)
 
so to explain, i'm not adding for a civ. I'm attempting to REPLACE the civs that are already in the game with new music. I have no music bank. I just drag the music into the game folder myself, like I explained. :)

Never tried like that, the only way I know to debug it is to play it manually.
 
is there any way to lower the duration of trade routes outside of game speed? I tried lowering TRADE_ROUTE_TURN_DURATION_BASE but it isn't enough
also tried upping traders' movement.
 
I've had a report that my City Original Owner Info mod "interferes with Industry and Corporation icons from the latest update!"

I don't know what these new features are, as I stopped playing the game a while back because Firaxis haven't provided the game with any good map scripts.

The mod inserts three sections of code into the CityBannerManager.lua file, and includes a replacement of this file.

As with the last time I updated the mod, I found the latest version of the game's CityBannerManager.lua file - located in Sid Meier's Civilization VI\DLC\Expansion2\UI\CityBanners, since it's only compatible with the Gathering Storm expansion - and then copied it, while re-inserting the mod's bits of code.

Loading up an old save, it seemed to be working okay, but my old save doesn't have the new Industries and Corporations stuff.

Here's a screenshot of the mod, with the additional icons in the city banner.

79DC7870FDEB122326DF6CFB31C5B728FE6EC187


Can anyone provide a screenshot of the Industries and Corporations icons so I can see what they are?
 
Last edited:
Hi, everyone!
I have a quick question which is not really important, and it might have already been answered somewhere else (apologies in advance if that is the case), though I couldn't find it yet.

I was wondering how/where the unit list order is defined in the production tab. I made a custom unit based entirely on the Roman Legion (it is exactly the same, only with some differences in texts and abilities) called "Armao de la Macarena", like I show below. It stands out to me how it is shown always the last in this list, instead of right after the Horseman as the Swordsman or the Roman Legion would be. I can't find anything on the xml files for units or civilizations.

upload_2021-2-14_1-49-17.png


As I said it is not essential so it is fine if I leave it like that, but ideally I would prefer if it followed the normal order.

Thanks everyone for this nice environment of collaboration, I usually read/grab useful info and never reply but I truly appreciate these forums immensely.
 
You can't really control the order in the list without a re-write of the lua file that controls the display of units that can be built/bought in a city.

Last time I looked at the relevant code, file ProductionPanel.lua looks through the list of Rows in table Units in order as they appear in the database and then "builds" the list based on what it finds in that same order and what is valid for that city/player. Anything you add to table "Units" will be placed in the database table last of anything else already added by the base game, DLC, expacs, etc., and any mods that have already added code to the game. So it's pretty normal for modded units to appear farther down the list than units that they are "like" or "similar to".
 
Hi all!
I'm working on a small mod and I want to give a domestic trade bonus if the origin city has an improvement (let's say a pasture).
I've search the sql and can't find a requirement like REQUIREMENT_CITY_HAS_IMPROVEMENT or anything like that.
I know how to give trade bonus and set requirements but I can't find which one I have to set.
Relate question: And if I want to give the same trade bonus PER improvement in the origin city?
Thanks :)
 
Hi all!
I'm working on a small mod and I want to give a domestic trade bonus if the origin city has an improvement (let's say a pasture).
I've search the sql and can't find a requirement like REQUIREMENT_CITY_HAS_IMPROVEMENT or anything like that.
I know how to give trade bonus and set requirements but I can't find which one I have to set.
Relate question: And if I want to give the same trade bonus PER improvement in the origin city?
Thanks :)
There is no "REQUIREMENT_CITY_HAS_IMPROVEMENT" but a "REQUIREMENT_PLAYER_HAS_IMPROVEMENT". A way to achieve what you want (both questions), might be to use "REQUIREMENT_PLOT_PROPERTY_MATCHES" (that has the arguments PropertyName(string) and PropertyMinimum(integer)) to check with lua if a City has the said Improvement and how much of it. Check the Pacal Mod by Luigi for reference.
 
Hi all!
I'm working on a small mod and I want to give a domestic trade bonus if the origin city has an improvement (let's say a pasture).
I've search the sql and can't find a requirement like REQUIREMENT_CITY_HAS_IMPROVEMENT or anything like that.
I know how to give trade bonus and set requirements but I can't find which one I have to set.
Relate question: And if I want to give the same trade bonus PER improvement in the origin city?
Thanks :)
Hi, Akarius, not sure if you are still working on this! I was working on something else and I came across Peacemaker's traits. "Favorable Terms" uses a bunch of modifiers like this:

Code:
        <Row>
            <ModifierId>TRAIT_TRADE_FOOD_FROM_CAMPS</ModifierId>
            <Name>Amount</Name>
            <Value>1</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_TRADE_FOOD_FROM_CAMPS</ModifierId>
            <Name>ImprovementType</Name>
            <Value>IMPROVEMENT_CAMP</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_TRADE_FOOD_FROM_CAMPS</ModifierId>
            <Name>YieldType</Name>
            <Value>YIELD_FOOD</Value>
        </Row>
        <Row>
            <ModifierId>TRAIT_TRADE_FOOD_FROM_CAMPS</ModifierId>
            <Name>Origin</Name>
            <Value>true</Value>
        </Row>

Any chance you could work with a domestic trade bonus depending on the improvements being in the destination city instead? It would be as easy as replacing that ImprovementType, I think.
Otherwise the way to go would probably be Zegangani's idea.
 
I was working on something else and I came across Peacemaker's traits. "Favorable Terms" uses a bunch of modifiers like this:
Yes, Poundmaker's trait uses the Modifier "MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_YIELD_PER_IMPROVEMENT_IN_TARGET" (without using any requirement(already included in the modifier)). There is also Samarkand CS's "MODIFIER_PLAYER_ADJUST_TRADE_ROUTE_YIELD_PER_IMPROVEMENT_AT_LOCATION_BABYLON", that grant +1 Gold for your outgoing international Trade Routes per Trading Dome at the origin.
 
I've been working on a a missionary UU that can build improvements, and most of it works, except I can only assign it certain valid improvements or else it all doesn't work, so far these are the ones that work no problem but adding more than these makes the unit unable to build anything (though the build option table still shows so it can destroy improvements.)
Code:
INSERT INTO Improvement_ValidBuildUnits
        (ImprovementType,        UnitType)
VALUES    ('IMPROVEMENT_MINE',    'UNIT_WEREJAGUAR'),
        ('IMPROVEMENT_QUARRY',    'UNIT_WEREJAGUAR'),
        ('IMPROVEMENT_FISHING_BOATS',    'UNIT_WEREJAGUAR'),
        ('IMPROVEMENT_PASTURE',    'UNIT_WEREJAGUAR'),
        ('IMPROVEMENT_PLANTATION',    'UNIT_WEREJAGUAR'),
        ('IMPROVEMENT_CAMP',    'UNIT_WEREJAGUAR'),
        ('IMPROVEMENT_LUMBER_MILL',    'UNIT_WEREJAGUAR'),
        ('IMPROVEMENT_OIL_WELL',    'UNIT_WEREJAGUAR'),
        ('IMPROVEMENT_OFFSHORE_OIL_RIG',    'UNIT_WEREJAGUAR'),
        ('IMPROVEMENT_BEACH_RESORT',    'UNIT_WEREJAGUAR'),
        ('IMPROVEMENT_COLOSSAL_HEAD',            'UNIT_WEREJAGUAR'        ),
        ('IMPROVEMENT_FARM',    'UNIT_WEREJAGUAR');
 
I've been working on a a missionary UU that can build improvements, and most of it works, except I can only assign it certain valid improvements or else it all doesn't work, so far these are the ones that work no problem but adding more than these makes the unit unable to build anything (though the build option table still shows so it can destroy improvements.)

Have you assigned the Units AiType as "UNITAI_BUILD" in the UnitAiInfos Table? And do you want to make the Unit as a Replacement for the Builder or it's a standalone Unit?
And are there any Errors in the Database and Modding Logs?
 
Have you assigned the Units AiType as "UNITAI_BUILD" in the UnitAiInfos Table? And do you want to make the Unit as a Replacement for the Builder or it's a standalone Unit?
And are there any Errors in the Database and Modding Logs?

It's a standalone, replacement for the missionary for a custom civ, I have it's ai set as a missionary for the assumption that the ai should probably use it more as a missionary than a builder, I haven't seend any errors for it in the logs so far
 
It's a standalone, replacement for the missionary for a custom civ, I have it's ai set as a missionary for the assumption that the ai should probably use it more as a missionary than a builder, I haven't seend any errors for it in the logs so far
Religious Units don't have AiTypes. If it's not hardcoded for only the Builder Unit to be able to build any Improvement, then assigning "UNITAI_BUILD" for the Unit may solve the Issue. And try also to give the unit "CLASS_BUILDER" in TypeTag Table. But I'm not sure how the AI gonna handle the Unit, using it for both relegious and builder actions or just one of them. You can also track the Unit with Lua using print command, if you want to see how the AI is using the Unit.
 
Hi all!

I tried to make the AI slightly more challenging by giving double military units.

Code:
INSERT OR IGNORE INTO Modifiers (ModifierId, ModifierType, OwnerRequirementSetId) VALUES
  ('HIGH_DIFFICULTY_DOUBLE_COMBAT_UNITS', 'MODIFIER_PLAYER_CITIES_ADJUST_EXTRA_UNIT_COPY_TAG', 'PLAYER_IS_HIGH_DIFFICULTY_AI');
INSERT OR IGNORE INTO ModifierArguments (ModifierId, Name, Type, Value) VALUES
  ('HIGH_DIFFICULTY_DOUBLE_COMBAT_UNITS', 'Tag', 'ARGTYPE_IDENTITY', 'CLASS_ALL_COMBAT_UNITS'),
  ('HIGH_DIFFICULTY_DOUBLE_COMBAT_UNITS', 'Amount', 'ARGTYPE_IDENTITY', 1);

Seems not to work. Any hints?

Edit: Also tried it this way...no success :(
Code:
INSERT OR IGNORE INTO Modifiers ("ModifierId", "ModifierType", "SubjectRequirementSetId") VALUES
  ('TEST_DOUBLE_UNITS', 'MODIFIER_ALL_PLAYERS_ATTACH_MODIFIER', NULL);
INSERT OR IGNORE INTO ModifierArguments (ModifierId, Name, Type, Value) VALUES
  ('TEST_DOUBLE_UNITS', 'ModifierId', 'ARGTYPE_IDENTITY', 'TEST_DOUBLE_COMBAT_UNITS_MODIFIER');

INSERT OR IGNORE INTO Modifiers (ModifierId, ModifierType) VALUES
  ('TEST_DOUBLE_COMBAT_UNITS_MODIFIER', 'MODIFIER_PLAYER_CITIES_ADJUST_EXTRA_UNIT_COPY_TAG');
INSERT OR IGNORE INTO ModifierArguments (ModifierId, Name, Type, Value) VALUES
  ('TEST_DOUBLE_COMBAT_UNITS_MODIFIER', 'Tag', 'ARGTYPE_IDENTITY', 'CLASS_ALL_COMBAT_UNITS'),
  ('TEST_DOUBLE_COMBAT_UNITS_MODIFIER', 'Amount', 'ARGTYPE_IDENTITY', 5);


Thanks in advance

Best regards
CypRyan
 
Last edited:
All I see is a definition of a Modifier, but I do not see where the Modifier is ever attached to any game element.
Code:
INSERT INTO TraitModifiers (TraitType, ModifierId)
VALUES ('TRAIT_LEADER_MAJOR_CIV', 'HIGH_DIFFICULTY_DOUBLE_COMBAT_UNITS' );
Which would attach the first modifier you posted to the default Trait all leaders of major civs have.
 
All I see is a definition of a Modifier, but I do not see where the Modifier is ever attached to any game element.
Code:
INSERT INTO TraitModifiers (TraitType, ModifierId)
VALUES ('TRAIT_LEADER_MAJOR_CIV', 'HIGH_DIFFICULTY_DOUBLE_COMBAT_UNITS' );
Which would attach the first modifier you posted to the default Trait all leaders of major civs have.
Oh my... THANK YOU! So easy. :)
I considered Traits to be optional modifier collections only (read something like that in a guide). Now I see what I missed.
Thank you so much! ^_^

Edit: I tried it but it does not seem to work. Tried it like that:
-- Double combat units
INSERT OR IGNORE INTO Modifiers (ModifierId, ModifierType) VALUES
('TEST_DOUBLE_COMBAT_UNITS', 'MODIFIER_PLAYER_CITIES_ADJUST_EXTRA_UNIT_COPY_TAG');
INSERT OR IGNORE INTO ModifierArguments (ModifierId, Name, Type, Value) VALUES
('TEST_DOUBLE_COMBAT_UNITS', 'Tag', 'ARGTYPE_IDENTITY', 'CLASS_ALL_COMBAT_UNITS'),
('TEST_DOUBLE_COMBAT_UNITS', 'Amount', 'ARGTYPE_IDENTITY', 1);
INSERT OR IGNORE INTO TraitModifiers (TraitType, ModifierId) VALUES
('TRAIT_LEADER_MAJOR_CIV', 'TEST_DOUBLE_COMBAT_UNITS');
So it should work for myself if I start a new game and build a warrior.
However, some other things work with adding the modifier to the trait. Strange :/
Can you help me out, again?

Edit2: Maybe I should have tried 'MODIFIER_PLAYER_UNITS_ADJUST_EXTRA_UNIT_COPY_TAG'. Gonna test this later :)

Edit3: Worked! Thank you! :p
 
Last edited:
Okay one more question.
I tried to create a 'MODIFIER_SINGLE_CITY_GRANT_YIELD' modifier to run by ProjectCompletionModifiers and add food (for city growth).
Code:
INSERT INTO "Types" ("Type", "Kind") VALUES
  ('MODIFIER_SINGLE_CITY_GRANT_YIELD', 'KIND_MODIFIER');

INSERT INTO "DynamicModifiers" ("ModifierType", "CollectionType", "EffectType") VALUES
  ('MODIFIER_SINGLE_CITY_GRANT_YIELD', 'COLLECTION_OWNER', 'EFFECT_GRANT_YIELD');

INSERT INTO "Modifiers" ("ModifierId", "ModifierType", "RunOnce", "Permanent", "SubjectRequirementSetId") VALUES
  ('VILLAGE_COMMUNITY_FEAST_COMPLETION_FOOD', 'MODIFIER_SINGLE_CITY_GRANT_YIELD', '1', '0', NULL);
 
INSERT INTO "ModifierArguments" ("ModifierId", "Name", "Type", "Value") VALUES
  ('VILLAGE_COMMUNITY_FEAST_COMPLETION_FOOD', 'Amount', 'ARGTYPE_IDENTITY', '25'),
  ('VILLAGE_COMMUNITY_FEAST_COMPLETION_FOOD', 'Scale', 'ARGTYPE_IDENTITY', '1'),
  ('VILLAGE_COMMUNITY_FEAST_COMPLETION_FOOD', 'YieldType', 'ARGTYPE_IDENTITY', 'YIELD_FOOD');
 
INSERT INTO "ProjectCompletionModifiers" ("ProjectType", "ModifierId") VALUES
  ('PROJECT_VILLAGE_COMMUNITY_FEAST', 'VILLAGE_COMMUNITY_FEAST_COMPLETION_FOOD');
But nothing just happened when the project finished (except the yield per production effects). Do you have any hint again?
 
Last edited:
Back
Top Bottom