[BNW] BABY SIMPLE MODDING ERRORS

Erebras

Prince
Joined
May 2, 2010
Messages
383
Location
Western North Carolina
PLEA FOR HELP
I am doing something very basic to not cause my mod changes to load or take effect. I have read Kael's modders' guide. I have read the various postings from the likes of whoward69 and LeeS and others so I get a sense of what is easily accomplished. I modded CivIII, so I am not a stranger to working with and tweaking game files, but the .xml and .sql stuff kept me away for years, and apparently with good reason.

At this point I just want to ask a few quick questions. I don't need to upload my files for people to see where I went wrong when someone can just say, "Pfft, of course you have to do this. What were you thinking?"
Synopsis: Create the mod in ModBuddy. Create an xml file under the Mod Solution. Under Mod Properties add OnModActivated action to UpdateDatabase with ModChange.xml file. Build Solution.

I don't know what Rebuild Solution or Clean Solution do, but Build Solution creates a mod file in the CiV game that I can then enable and start. The mod changes do not take effect.

For further clarity, is the .xml file and its associated action sufficient to activate the mod, or is the additional scripting required, such as in .lua or .sql or somewhere? My impression is that simple updates and changes don't require scripting events.

The .xml mod changes are not extraordinary. I can actually get it to delete technologies, but even with using the same wording as other published mods and DLC scenario .xml files, I cannot get the mod to load new technologies. Please keep in mind that I am not new to modding. Those new technologies I attempted to load had all the associated entries, from Help to Portrait to Icon Atlas to X and Y grid coordinates to Prerequisite Techs.

My impression is that somehow the mod is not getting that extra "ummph" to add the new techs to the tech tree. What am I failing to do?
 
Check the logs (see the link in my sig), as one tiny error in an XML file will cause the entire XML file to be discarded.

Also, check the stopwatch.log file and make sure that it's processing your XML file. If not, then you've either got something wrong in the mod properties (but it sounds like you've read my guide on what needs setting for what file types) or you've enabled the mod and then pressed Back on the next screen instead of Single Player (it looks like a menu title but is actually a button)

Other than that, usual response, we'll need the mod attaching :)
 
Apparently, not so baby simple. I was getting this odd error when I started a game that for some reason I could see the starting location of a computer opponent way across the map from me. I think ModBuddy did something to my core installed files, for I never encountered this before I started my attempts at modding. I went ahead and uninstalled the game and reinstalled the game (Steam). I even deleted the modded files from the Firaxis Modbuddy file. Well, that resolved the spycam satellite error letting me see my opponent, so there's that. I went ahead and enabled logging and validation in the config ini.

Just to see what would happen, I loaded up ModBuddy, rebuilt my mod, and it didn't appear in the Mods menu when I started the game. It seems odd, but I had to manually cut and paste the mod (version 1) I had just built and place it in the Mods file. When I loaded up the game and selected Mods, the mod I cut and paste was the only option (as expected). I clicked it, and played the first game. It did delete the techs I wanted it to delete -- to the point that the first turn started me with Rifleman instead of Warrior (no idea why) -- and also did not populate the deleted techs with the added ones.

The lua and xml files under Logs seemed normal. The database log was having a conniption because it couldn't find any of the deleted techs. Rightly so. So I suppose there is some error with updating the database to add the missing techs (as per my initial post on this thread).

So let me ask these questions.
1) Can adding an xml that deletes ALL of the technologies be enacted, and then followed with an xml that adds all the techs back in along with the new techs?
2) It is more tedious to use the update function to tell each tech where to be on the X Y grid and assign prerequisites (which at this point I am no longer even sure the <Set Prerequisite="TECH_XXX"< is a valid update command). I would rather delete the tech, and then copy and paste a new tech with all the deleted tech's information under the <Technologies> game data. Is this possible? It appears the game likes to default back whenever it can.
3. Several threads and postings suggests the game will compile a techtree by simply using the prerequisites you assign the mod. Does that mean it is not necessary to assign grid integers unless you need the tree to be finetuned for aesthetics or something?
 
1) Yes. But messing with the Tech Tree is not simple (as you've discovered)
2) Yes. Provided you know what you're doing and how the game will react, most things are possible. You may run into issues where the game assumes techs have sequential IDs starting from 0, but there are SQL scripts to sort that out.
3) Only if you have a mod that does this (some of the mods that add whole new eras move techs around semi-automatically with SQL), otherwise you need to manually set the X and Y values for techs.

Modding the tech tree is non-trivial. Start with a simple mod to add a new tech, then expand it to delete a tech, then if you need to expand upon that to alter eras. Just trying to delete all the techs and add in 10's or 100's of new ones will just lead to a huge bunch of inter-acting errors (just about everything in the game requires a functioning tech tree)
 
I started out small. I merely exchanged the roles of Archery and Animal Husbandry, just to see if the changes will take effect. Here is the xml file contents:
<GameData>
<!-- TODO: Insert table creation example here. -->

<!-- TODO: Insert table data example here.-->

<!-- Enter your Game Data here. -->
<Technologies>
<Update>
<Where Type="TECH_ARCHERY" />
<Set GridY="4" />
</Update>
<Update>
<Where Type="TECH_ANIMAL_HUSBANDRY" />
<Set GridY="6" />
</Update>
</Technologies>
<Technology_PrereqTechs>
<Update>
<Where TechType="TECH_TRAPPING" />
<Set PrereqTech="TECH_ARCHERY" />
</Update>
<Update>
<Where TechType="TECH_THE_WHEEL" />
<Set PrereqTech="TECH_ANIMAL_HUSBANDRY" />
</Update>
<Update>
<Where TechType="TECH_THE_WHEEL" />
<Set PrereqTech="TECH_ARCHERY" />
</Update>
</Technology_PrereqTechs>
</GameData>

The mod loads fine, but this is the error I end up with:
upload_2022-1-28_9-35-12.png


The database, lua, and xml logs are unremarkable. Just the usual blurb about SPECIAL landmarks and no barbarian horseman files. What should happen according to the xml tech changes is that The Wheel would require both Archery and Animal Husbandry, and Trapping would only require Archery (not two Archeries), and yet Animal Husbandry becomes a dead end tech. I attached a zip file of the mod if one would be kind enough to see where I went wrong. (Please keep in mind that my mod has nothing to do with exchanging Archery and Husbandry, I'm just trying to make it work before I move on to better modding.)
 

Attachments

  • Civ5Mod1.zip
    6.8 KB · Views: 38
I even used this configuration to see if it would make the correct associations, and the mod kicked out the xml entirely when I did.
<Update>
<Where TechType="TECH_THE_WHEEL" />
<Set PrereqTech="TECH_ANIMAL_HUSBANDRY" Set PrereqTech="TECH_ARCHERY" />
</Update>

This didn't work, either.
<Update>
<Where TechType="TECH_THE_WHEEL" />
<Set PrereqTech="TECH_ANIMAL_HUSBANDRY" />
<Set PrereqTech="TECH_ARCHERY" />
</Update>
 
Top Bottom