Quick Modding Questions Thread

can anyone tell me how to update a schema file (Expansion2_Schema.sql) with a mod? I tried to use import but it didn't work. I'm not familiar with sql, and I'm gonna insert a new column into an existing table.
use "alter table" in a sql file loaded before the file(s) that set the values for that new column, for example:
Code:
ALTER TABLE Units ADD COLUMN Personnel integer DEFAULT '0';
Of course you'll have to handle what to do with your new column in Lua scripts.
 
Last edited:
I'm creating a new unit class and with it. promotions. This class 'Tank' uses Promotions 'Armor Piercing' and 'Reactive Armor' which already a promo of Heavy Cavalry.

So what are correct command codes when changing this promotions to those of tank? What Should I use? 'Update' or 'Delete & Row' in <UnitPromotions>, <UnitPromotionPrereqs> and other associating tables in Mod_UnitGameplayPromotions.xml ?

Code:
<Row UnitPromotionType="PROMOTION_ARMOR_PIERCING" Name="LOC_PROMOTION_ARMOR_PIERCING_NAME" Description="LOC_PROMOTION_ARMOR_PIERCING_DESCRIPTION" Level="3" Specialization="" Column="1" PromotionClass="PROMOTION_CLASS_HEAVY_CAVALRY"/>
       <Row UnitPromotionType="PROMOTION_REACTIVE_ARMOR" Name="LOC_PROMOTION_REACTIVE_ARMOR_NAME" Description="LOC_PROMOTION_REACTIVE_ARMOR_DESCRIPTION" Level="3" Specialization="" Column="3" PromotionClass="PROMOTION_CLASS_HEAVY_CAVALRY"/>
 
Is there some knowledge on how the syncing in MP works, and how to fix desyncing problems with a mod?
 
desyncs from using mods or happening without mods?

if the later, AFAIK the only solution would be a bug report to Firaxis with your logs folder.
 
As someone that prefers R&F to GS but likes to include GS leaders when playing (R&F), I've created a mod that is (so far) functional for that. I've excluded the GS dependencies, the front-end/leader-selections are good, and the in-game art/animations/audio are working just fine, but I'm embarrassed to say that I'm having trouble figuring out how to reference the GS leader icons in-game. I have a similar issue with the civilopedia references that I haven't yet looked into yet, but I'm thinking I have a work-around for that (that may not be needed if the in-game leader icon solution ends up being fairly straight-forward). Does anyone know how I can reference the built-in GS leader icon atlases/definitions?
 
desyncs from using mods or happening without mods?

if the later, AFAIK the only solution would be a bug report to Firaxis with your logs folder.

Ye, it only happens with mods .-.
Not possible to debug that?
 
Ye, it only happens with mods .-. Not possible to debug that?
You can start the process: isolate the bug by testing various combinations of used mods. Leave out the culprit(s) and report to the creator(s) of the mod(s). If you are lucky, it is just one.
 
Last edited:
Ye, it only happens with mods .-.
Not possible to debug that?
if it's only with mods then you'll have to check the mods that use Lua scripts for gameplay effect.

there is one or two log files related to MP synchronization IIRC, can't remember their names, it's possible to analyse them and compare them between human players.
 
You can start the process: isolate the bug by testing various combinations of used mods. Leave out the culprit(s) and report to the creator(s) of the mod(s). If you are lucky, it is just one.
I know it, it's City Lights https://steamcommunity.com/sharedfiles/filedetails/?id=2190389813

others report it too, I just wanted to take a look at it and maybe figure out what exactly is making the desync happen, since the dev says he can't reproduce/test it.

if it's only with mods then you'll have to check the mods that use Lua scripts for gameplay effect.

there is one or two log files related to MP synchronization IIRC, can't remember their names, it's possible to analyse them and compare them between human players.

I took a quick gander at the log files of a few rounds and it's always the same three variables that get desynced (and an autoarchive? Or does that contain the variables?)...

I just wanted to get a bit of experience for this kind of issue mainly, so if I encounter it with an own mod, I can try and fix it.
 
Last edited:
Unless I'm wrong, there is no Lua scripts in City Lights, meaning it could be an issue with the game's engine highlighted by the mod, not the mod itself.
 
Unless I'm wrong, there is no Lua scripts in City Lights, meaning it could be an issue with the game's engine highlighted by the mod, not the mod itself.
Hmm ok, thanks for your patience nonetheless.
 
  1. Download an SQL database viewer program off the net. There are several good ones you can get for free. I use SQLite Viewer You can get it from this link
  2. Open file DebugGameplay.sqlite in your "documents" folders at
    ~\Documents\My Games\Sid Meier's Civilization VI\Cache
  3. Choose the "Browse Data" tab and select "DynamicModifiers". This will give you a list of all the ModifierTypes the game already has based off the expansions and dlc you are using. (Note that with a different SQL database viewer program the name of the tab you need to select might be a bit different but I think it should be pretty straightforward to figure out)
  4. You can also choose the "GameEffects" table which will include all of the CollectionTypes, RequirementTypes, RequirementSetTypes, and EffectTypes the game recognizes and from which the ModifierTypes and RequirementTypes such as REQUIREMENT_CITY_IS_POWERED and MODIFIER_ALL_CITIES_ATTACH_MODIFIER are constructed
 
Last edited:
Is it possible to add a new command to a unit?
yes, but it's not a simple task, see some of the scenarios.

a starting point for example (there are also some UI files involved):
\Sid Meier's Civilization VI\DLC\CivRoyaleScenario\Scripts\CivRoyaleScenario_UnitCommands.lua
 
Well my earlier post got ignored so I guess it was too long. Here's a simpler question: where do you go to customize the turns and years settings? Can't find a reference anywhere.

Thanks!
 
The relevant tables would be <GameSpeeds> and <GameSpeed_Turns> if I understand correctly what you are looking for. The data are contained in the Base Game file GameSpeeds.xml

Pulling the data for the "Standard" gamespeed from those tables
Code:
	<GameSpeeds>
		<Row>
			<GameSpeedType>GAMESPEED_STANDARD</GameSpeedType>
			<Name>LOC_GAMESPEED_STANDARD_NAME</Name>
			<Description>LOC_GAMESPEED_STANDARD_HELP</Description>
			<CostMultiplier>100</CostMultiplier>
			<CivicUnlockMaxCost>100</CivicUnlockMaxCost>
			<CivicUnlockPerTurnDrop>10</CivicUnlockPerTurnDrop>
			<CivicUnlockMinCost>20</CivicUnlockMinCost>
		</Row>
	</GameSpeeds>
	<GameSpeed_Turns>
		<Row>
			<GameSpeedType>GAMESPEED_STANDARD</GameSpeedType>
			<MonthIncrement>480</MonthIncrement>
			<TurnsPerIncrement>75</TurnsPerIncrement>
		</Row>
		<Row>
			<GameSpeedType>GAMESPEED_STANDARD</GameSpeedType>
			<MonthIncrement>300</MonthIncrement>
			<TurnsPerIncrement>60</TurnsPerIncrement>
		</Row>
		<Row>
			<GameSpeedType>GAMESPEED_STANDARD</GameSpeedType>
			<MonthIncrement>240</MonthIncrement>
			<TurnsPerIncrement>25</TurnsPerIncrement>
		</Row>
		<Row>
			<GameSpeedType>GAMESPEED_STANDARD</GameSpeedType>
			<MonthIncrement>120</MonthIncrement>
			<TurnsPerIncrement>50</TurnsPerIncrement>
		</Row>
		<Row>
			<GameSpeedType>GAMESPEED_STANDARD</GameSpeedType>
			<MonthIncrement>60</MonthIncrement>
			<TurnsPerIncrement>60</TurnsPerIncrement>
		</Row>
		<Row>
			<GameSpeedType>GAMESPEED_STANDARD</GameSpeedType>
			<MonthIncrement>24</MonthIncrement>
			<TurnsPerIncrement>50</TurnsPerIncrement>
		</Row>
		<Row>
			<GameSpeedType>GAMESPEED_STANDARD</GameSpeedType>
			<MonthIncrement>12</MonthIncrement>
			<TurnsPerIncrement>120</TurnsPerIncrement>
		</Row>
		<Row>
			<GameSpeedType>GAMESPEED_STANDARD</GameSpeedType>
			<MonthIncrement>6</MonthIncrement>
			<TurnsPerIncrement>60</TurnsPerIncrement>
		</Row>
	</GameSpeed_Turns>
If you sum all the values for TurnsPerIncrement you get 500. The game processes the "Years" passed based on the order in which the rows are entered into table GameSpeed_Turns. 480 months = 40 Years. Every turn in the first increment thus represents 40 years. 40 Years x 75 turns = 3000 total years in the increment.[table=head]Increment # | Months | Turns | Years/Turn | Total Turns | Start Year | End Year | Years In Increment
# 1 | 480 | 75 | 40 | 75 | -4000 | -1000 | 3000
# 2 | 300 | 60 | 25 | 135 | -1000 | +500 | 1500
# 3 | 240 | 25 | 20 | 160 | +500 | +1000 | 500
# 4 | 120 | 50 | 10 | 210 | +1000 | +1500 | 500
# 5 | 60 | 60 | 5 | 270 | +1500 | +1800 | 300
# 6 | 24 | 50 | 2 | 320 | +1800 | +1900 | 100
# 7 | 12 | 120 | 1 | 440 | +1900 | +2020 | 120
# 8 | 6 | 60 | 1/2 | 500 | +2020 | +2050 | 30[/table]

I assume the Relive World Wars mod adds a new gamespeed and calendar to the game or else just re-jiggers the stock gamespeeds and their calendars to coincide with the intent of the mod.

The original turn showing as 4000 BC is probably just inherent in the way the game's User Interface code is written to display the starting year. Unless the maker of that mod also rewrites the relevant file then the game will probably want to start at 4000 BC regardless of the other settings for the Calendar made by the mod. Sometimes it is just better to live with little no-meaning visual annoyances of this type than to spend the time to rework something the game may or may not cooperate in doing anyway.

Civ5 was notorious for wanting to booger people's carefully crafted alterations to the User Interface Calendar display for scenarios and the like, especially when a game was saved and then reloaded later. Most of us simply gave up on this since you could not actually control whether or not the game's User Interface was going to bugger and revert to something sort of like it usually wants to display.
 
Thanks so much LeeS - that's exactly what I was looking for. Got your point about year 4000 too - not too bothered about that, was just curious. Appreciate the assist.

Thanks!
 
Back
Top Bottom