[R&F] Extremely basic modding workflow / debugging question

Bringa

King
Joined
Jan 23, 2006
Messages
677
Hi!

Just trying to figure out very basic things in Civ 6 modding. I've read a couple of guides, but I'm sure I must be doing something very basic wrong since I was trying to do something so simple and couldn't even get that to work.

What I was trying to do: I was trying to make a basic change to terrain yields just to see if I could make a mod and successfully load it into the game.

What happens: With the mod enabled, the game crashes on startup with error 3045188730 (which seems to be a generic "mod done fudged up" error)

Step by step:

Installed modbuddy and made a new empty mod.

Ctrl+O to Open File, navigated to {steamapps}\common\Sid Meier's Civilization VI\Base\Assets\Gameplay\Data

Open Terrains.xml to get the terrains definitions from the base game in.

Moved the file from Miscellaneous Files to my mod folder (where it was copied under Mod.Art.xml)

Opened the file and made this change:
<Row TerrainType="TERRAIN_PLAINS" YieldType="YIELD_PRODUCTION" YieldChange="2"/>

(the 2 obviously used to be a 1)

In the properties of my mod, under In-Game Actions, added an UpdateDatabase action, named it SetYields, added the file Terrains.xml to it.

Set some text in the description to make sure the correct mod shows up in my additional content.

Used the Build menu to build the mod.

Opened the game, disabled all mods except for mine, started a new game on a duel sized map.

Before the game even shows me what leader I have, it reports error 3045188730


So where did I go wrong? My understanding was that the steps I took above should have just changed the Terrains.xml file in my mod to give plains one more production. Why didn't that work?

And to get to the second part of my question, how would I even find out what's actually going on without bothering all of you here? I looked through the logs folder, particularly at Modding.log, but none of that seemed to actually tell me anything that went wrong.
 
Database.log is where you should be looking.

You would have created a unique constraint error as what you are doing would repeat a combination of TerrainType and YieldType that the base game is already adding to table <Terrain_YieldChanges>. I doubt you are getting that far if you 'dragged' or 'copied' the file from some other folder into the mod-folder rather than using ModBuddy's File->ADD->Existing menus for 'copying' a file into a Modbuddy project.

What you really want to do is perform an update
Code:
<GameInfo>
	<Terrain_YieldChanges>
		<Update>
			<Where TerrainType="TERRAIN_PLAINS" YieldType="YIELD_PRODUCTION" />
			<Set YieldChange="2"/>
		</Update>
	</Terrain_YieldChanges>
</GameInfo>
Instead of copying the entire contents of a base game file and attempting to reload all the same data into the database.
 
Thank you! That's what I was missing. I was making some assumptions there about what would happen if a mod defined stuff that already exists in the base game. This makes sense!
 
Top Bottom