Quick Modding Questions Thread

As these codes are not working, anyone has any idea to write a compensate code on traitmodifier or somewhere else to realize similar functions?
Code:
<Replace Name="CIVIC_COST_PERCENT_CHANGE_AFTER_GAME_ERA" Value="20" />
        
        <Replace Name="CIVIC_COST_PERCENT_CHANGE_BEFORE_GAME_ERA" Value="-20" />
 
Any idea why this is happening ?

On first setup, everything's fine
Spoiler :
upload_2020-4-16_10-3-35.png


Launching a game, exit back to main menu then go to setup:
Spoiler :
upload_2020-4-16_10-9-11.png


In game the player color is always white, but all other players use the correct colors.

The test was made with or without Prismatic.
 

Attachments

  • upload_2020-4-16_10-8-57.png
    upload_2020-4-16_10-8-57.png
    1.5 MB · Views: 156
Is there an easy way to open other peoples mods that I've downloaded from the workshop? Because of Visual Studio's "solution" based projects, I can't just open a directory of code and change it, it seems. Do the solutions ship with the mods themselves?

I'm just starting with modding, and right now I'm learning by editing mods locally. Unfortunately that means copy and pasting all files
 
The solutions are never uploaded to Steam Workshop. Nor when zipped and posted to a file sharing site like CFC's mod download section are the solutions included.

Mods that are uploaded to Steam Workshop (or anywhere else) have a main folder for the mod, and within that folder there might or might not be sub-folders depending on the scope of the mod. But in the first and primary folder of the mod is a file called XXX.modinfo -- this is just a text only file organized as an XML file. It can be opened using any text editor, as can any of the xml, sql, or lua files contained within a mod. The modinfo file contains the instructions to the game as to what the game should do with the files contained within the mod. The modinfo file does not exist as a file within a Modbuddy project -- it is created by Modbuddy when the mod author uses the Modbuddy Project to create a usable mod (this process is referred to as "Build" of the mod in the Modbuddy menus).

Other files such as dds files and the like often require a program like GIMP or Photoshop to open. But since these are image files they would need to be edited in an image editing application like GIMP or Photoshop (which is why you need something like one of these to open the file). Other Art/Animation files can really only be opened by the SDK Asset Previewer tool.

But you can't take a mod you've downloaded (from whatever Site source), plop the mod folder into your Modbuddy folder in MyDocuments, and then open that mod as a Modbuddy Project in Modbuddy because there's nothing to open. There's no project file, no solution file, etc. This is because these only exist for the creator of a mod within their project on their computer. What is shared via Steam or other file-sharing methods is the "Built" version of the mod, which never contains any of the modbuddy project files or solution files because the version of the mod the game uses (the Built version) does not need them and they would just be extra clutter and download size bloating.
 
Last edited:
Any idea why this is happening ?

On first setup, everything's fine


Launching a game, exit back to main menu then go to setup:


In game the player color is always white, but all other players use the correct colors.

The test was made with or without Prismatic.
Ok.

So...

One XML file was not (re?)loading because of that :
Code:
[2286600.398] [ColorManager] ERROR: UNIQUE constraint failed: Colors.Type
[2286600.398] [ColorManager]: While executing - 'insert into Colors('Type', 'Color') values (?, ?);'
[2286600.398] [ColorManager]: In XMLSerializer while inserting row into table insert into Colors('Type', 'Color') with  values (COLOR_UNKNOWN, 255,255,255,255, ).
[2286600.398] [ColorManager]: In XMLSerializer while updating table Colors from file [...]/Documents/My Games/Sid Meier's Civilization VI/Mods/YnAMP - Basic Modern Civilizations/Data/Colors.xml.

but... Colors.xml was using only <Replace> tags, and no "COLOR_UNKNOWN" string in the file...

:hmm:

moved from xml to sql for that file, seems fine on return to main menu and in game now.
 
Cannot it be Jersey system doing some updates of its own or something? I don't quite understand this, but I know issues with it has been mentoined previously.
 
Are LOC texts from R&F and GS also in the Cache/DebugLocalization.sqlite database? The file is the same size no matter if I run a game with standard rules, rise and fall or gathering storm. It's always 59.8MB.
Thanks for help.
 
No, they are not added to it. Also from experimentation done by various people, UPDATE or REPLACE statements for LOC_KEYS added by RaF and GS don't implement properly. Generally it is necessary to redirect a "Name", "Description", etc. to an entirely new Tag and then add that new Tag to the Localization Database from your mod's <UpdateText> action.

All the X.sqlite files in the "Cache" folder appear to be just copies of what the game interenally actually uses, and we do not have direct access to these. DebugConfiguration.sqlite and DebugGameplay.sqlite properly reflect anything added by the two expansions, but DebugLocalization.sqlite does not. From experimentation it appears that DebugLocalization.sqlite is re-generated after Vanilla and the DLC load but then is not "handled" anymore for Firaxis content so we get bupkiss for the stuff added by the two expansions. But everything added by community-made mods is reflected in DebugLocalization.sqlite so all these different "handling" methods are just a recipe to make all modders want to :gripe: and :wallbash: :badcomp: :wallbash:
 
Is there an easy way to open other peoples mods that I've downloaded from the workshop? Because of Visual Studio's "solution" based projects, I can't just open a directory of code and change it, it seems. Do the solutions ship with the mods themselves?

I'm just starting with modding, and right now I'm learning by editing mods locally. Unfortunately that means copy and pasting all files

That is exactly what you need to do if you want to modify someone else's mod, such as by tweaking a value or names etc. Personally, I use notepad++ if I'm going to do this (there are a few mods that are designed to be tweaked, such as Radiant's presets), rather than dealing with the overhead of running Modbuddy.

If you want to seriously create a mod by modelling off of someone else's, create a new mod in Mod Buddy and copy/Paste into files there. Technically, I believe you can do it *all* via Notepad++ or something similar, but then you'd need to generate your own random string for mod ID and a whole lot of other tedious crap. Personally, I've taken to writing up new files in Notepad++ for my initial draft (keep it nice and big/visible), then when I'm satisfied with my setup, copy and paste into a file in ModBuddy.
 
No, they are not added to it. Also from experimentation done by various people, UPDATE or REPLACE statements for LOC_KEYS added by RaF and GS don't implement properly. Generally it is necessary to redirect a "Name", "Description", etc. to an entirely new Tag and then add that new Tag to the Localization Database from your mod's <UpdateText> action.

All the X.sqlite files in the "Cache" folder appear to be just copies of what the game interenally actually uses, and we do not have direct access to these. DebugConfiguration.sqlite and DebugGameplay.sqlite properly reflect anything added by the two expansions, but DebugLocalization.sqlite does not. From experimentation it appears that DebugLocalization.sqlite is re-generated after Vanilla and the DLC load but then is not "handled" anymore for Firaxis content so we get bupkiss for the stuff added by the two expansions. But everything added by community-made mods is reflected in DebugLocalization.sqlite so all these different "handling" methods are just a recipe to make all modders want to :gripe: and :wallbash: :badcomp: :wallbash:
Just a side note, we can alter the Configuration Database during setup and the changes are reflected on refresh (which occurs when you change a setting on screen or when they are initialized)

(using SQL queries from a moddified AdvancedSetup.lua, not tried to edit the DebugConfiguration.sqlite directly with an editor, so I don't know if the changes are applied on a DB in memory or the debug file)
 
Hey y'all...hoping this is a quick question. I tried to build a mod with the following update statement:

Code:
UPDATE Units SET BuildCharges = 4 WHERE UnitType = 'UNIT_BUILDER';

But when I go to load my game, builder build charges are still set at 3.

DebugGameplay.sqlite indicates that nothing has changed:

Code:
sqlite3> select buildcharges from units where unittype='UNIT_BUILDER';
3

I set LoadOrder in the modinfo XML, and that appears to be working as Mods.sqlite shows it last in the list in the ModFiles table:

Code:
<LoadOrder>990</LoadOrder>

Database.log shows no errors.

Modding.log shows no obvious errors (at least none that were obvious to me).

I'm just curious if anyone's run into this before and if I'm missing something stupid obvious. I'm old hat at Civ4 modding but I'm completely new to Civ6 and the structure's really thrown me for a loop.
 
I set it under the Mod -> Properties tags, so that's probably setting it globally for the mod.

Wouldn't that have the same effect?

Alternatively, what's the UpdateDatabase action? That's the first I've heard of it... >_>
 
I set it under the Mod -> Properties tags, so that's probably setting it globally for the mod. Wouldn't that have the same effect?
No, you used to be able to set a global LoadOrder and it would work, but it was changed in one of the patches. Now it needs be set for each individual InGameAction (e.g. Database, Text, Icons, Art, etc.).
Alternatively, what's the UpdateDatabase action? That's the first I've heard of it... >_>
In your modinfo file - the LoadOrder properties need to be set under each subsection.

Spoiler :
3cTrKSY.png
 
Just a side note, we can alter the Configuration Database during setup and the changes are reflected on refresh (which occurs when you change a setting on screen or when they are initialized)

(using SQL queries from a moddified AdvancedSetup.lua, not tried to edit the DebugConfiguration.sqlite directly with an editor, so I don't know if the changes are applied on a DB in memory or the debug file)
Yeah it seems that whenever anything at all is changed in any of the Pregame menus (like adding a mod to the list of enabled mods) the entire FrontEnd Database is recreated. This lua "change" to the database also appears as you've observed from changes in settings in the game setup screens as near as I can tell.

The result for one thing is LoadOrder settings for FrontEnd Actions aren't very reliable.
 
I set it under the Mod -> Properties tags, so that's probably setting it globally for the mod.

Wouldn't that have the same effect?

Alternatively, what's the UpdateDatabase action? That's the first I've heard of it... >_>
Simply adding a file to a mod does not make the game do anything with the file.

Given your message your root problem is almost certainly that you have never told the game what to do with your file(s) so it does nothing with them.

See the chapter on creating a simple "New Building" mod in the Modding Guide linked in my signature. The chapter goes through the steps needed in modbuddy to activate the contents of a file in-game. The chapter also covers how to create the same simple mod if not using modbuddy.
 
Given your message your root problem is almost certainly that you have never told the game what to do with your file(s) so it does nothing with them.

Annnnnnnd this is precisely the sort of thing I expected - something simple and dumb that I missed.

Thank you for the tutorial link, that's extremely helpful - and answered a lot of my questions. You guys rock.

Now if only that had resolved my problem! :)
 
Last edited:
See the chapter on Dependancies, References, LoadOrders, and Blocks. Add a LoadOrder value of at least 300 to your InGame UpdateDatabase action and see if that does not cure the issue.

If not, start a new thread so that a more-detailed help discussion can be made and upload your mod as a zipped archive attached to your OP.

Boiler Plate Instructions:
  1. Zip the version of the mod the game is actually trying to use, which will be found as a sub-folder in ~\Documents\My Games\Sid Meier's Civilization VI\Mods. Zip the whole sub-folder for your mod.
    • Do not (unless specifically asked by someone trying to help diagnose your problem) zip the modbuddy project folder
      Spoiler why not :
      1. This is useless in most cases and requires us to dump it into our modbuddy folder and then start modbuddy and then attempt to analyse what you are doing wrong.
      2. If we cannot spot the issue we then have to create the built and usable version of the mod on our end, which is what we really needed in the 1st place.
      3. And in all this process we have to hope that we are not wasting our time in the event the modbuddy project does not contain the same code as the built version of the mod that is non-functional
      4. People completely corrupt via fix-attempts the built version of the mod in the game's MODS folder and then package and send the modbuddy solution all the time. This results in what we see being different from what the novice mod-maker is seeing in-game.
  2. To attach the zip to a forum post, look for a button called Upload A File when composing your thread reply: this button opens a browse menu where you can select the zipped folder to attach directly to a forum post.
  3. If the zipped folder is too large for the forum to accept then upload the zipped mod to a file-sharing site such as dropbox and provide a link where the mod can be downloaded.
    • Mediafire is not really a very good choice any more because they have become rife with spam and malware, as well as attempts to get you to download unwanted and uneeded kludge by confusing the layout of the download pages. You'll note for example that Mediafire links are no longer allowed on Steam, whereas CFC (this site) and dropbox links are still allowed.
 
You're gonna laugh...once I added in the UpdateDatabase action and started and it wasn't working, I was so frustrated that I almost gave up entirely. But for kicks I opened Database.log and at that moment saw that another mod had an error - and nothing loaded after that.

So once I fixed that error everything worked like a charm. :)
 
Is it possible to create mods with the Development Tool without downloading the 37 GB Asset pack? The Civ Wiki seems to say that you do not need this asset pack, but when I try to build my mod in Modbuddy, it provides an error that there is no Civ VI SDK Asset Path.

If it is possible to mod without the Asset Pack, what do I need to set this SDK Asset Path to?
 
Back
Top Bottom