• We are currently performing site maintenance, parts of civfanatics are currently offline, but will come back online in the coming days. For more updates please see here.

[GS] Need help, how to properly alter dlc content?

Seilven

Chieftain
Joined
Mar 10, 2019
Messages
5
Hello i'm new to modding so i'm sorry if this has been posted a million times :)

I'm trying to alter how polders and some other features function but i cant get it to work.
I followed this guide and came up with this code:
Code:
Update Improvements
SET Housing=2
WHERE ImprovementType='IMPROVEMENT_POLDER';

When i edit the default xml files in the game it works fine or something from the base game like this does seem to take effect:
Code:
UPDATE Improvements
SET Housing=2
WHERE ImprovementType='IMPROVEMENT_FARM';

Is there something else you need to do to alter dlc content? Or am i missing something? Thanks in advance
 
For dlc content your action will almost always need a LoadOrder setting in the Action's Properties. Most likely your UPDATE is executing before the DLC even adds a thing called 'IMPROVEMENT_POLDER' to the game, so there's nothing for the update to match the "WHERE" clause to when your code is executed.

You can add a LoadOrder value in Modbuddy or you can do it directly to your modinfo file using Notepad, Notepad++, or any other text editor program that you know reliably does not ever add hidden formatting characters to a file. Your modinfo file's Action needs to look like this for a LoadOrder setting of "150"
Code:
  <InGameActions>
	<UpdateDatabase id="SQL_Changes">
		<Properties>
			<LoadOrder>150</LoadOrder>
		</Properties>
		<File>MyCiv6SQL_Changes.sql</File>
	</UpdateDatabase>
      ....etc....
 
For dlc content your action will almost always need a LoadOrder setting in the Action's Properties. Most likely your UPDATE is executing before the DLC even adds a thing called 'IMPROVEMENT_POLDER' to the game, so there's nothing for the update to match the "WHERE" clause to when your code is executed.

You can add a LoadOrder value in Modbuddy or you can do it directly to your modinfo file using Notepad, Notepad++, or any other text editor program that you know reliably does not ever add hidden formatting characters to a file. Your modinfo file's Action needs to look like this for a LoadOrder setting of "150"
Code:
  <InGameActions>
    <UpdateDatabase id="SQL_Changes">
        <Properties>
            <LoadOrder>150</LoadOrder>
        </Properties>
        <File>MyCiv6SQL_Changes.sql</File>
    </UpdateDatabase>
      ....etc....
Thank you for your quick reply,
I tried your solution but i cant load into a new game with my mod, however adding the loadorder to an existing mod and polders added does seem to work on existing saves but not new ones.
This is my sql file:
Code:
-- Improved_Polders
-- Author: Seilven
-- DateCreated: 10-Mar-19 8:15:35
--------------------------------------------------------------

UPDATE Improvements
SET Housing=4
WHERE ImprovementType='IMPROVEMENT_POLDER';
And my modinfo file:
Code:
<?xml version="1.0" encoding="utf-8"?>
<Mod id="90dbfb5a-fc0c-46b4-acd3-2778f36f5f14" version="1">
  <Properties>
    <Name>Improved Polders</Name>
    <Description>Improves Polders</Description>
    <Teaser>Improves Polders</Teaser>
    <Authors>Seilven</Authors>
  </Properties>
  <FrontEndActions />
  <InGameActions>
    <UpdateDatabase id="Improved Polders.sql">
      <Properties>
        <LoadOrder>150</LoadOrder>
      </Properties>
      <File>Improved Polders.sql</File>
    </UpdateDatabase>
  </InGameActions>
  <Files>
    <File>Improved Polders.sql</File>
  </Files>
</Mod>

What could be causing the crash?
 
Last edited:
I got it working!

I had a look at the database.log and the problem seemed to be the space in Improved Polders so i edited the files to exclude it.
Thanks for the help i didn't know about the LoadOrder thing :)
 
Yes, you cannot have spaces in Action "id" names. Nor can you start them with a number.

Period symbols I am not sure of but I would not use them in the "id" name for an action. They're required of course in the actual file-name your action is executing.

And also yes as a general rule I advise people not to have spaces in SQL, XML, DDS, or LUA filenames.
 
Back
Top Bottom