World of Banished

MODS Garage => Tips and Help => Topic started by: slink on September 26, 2014, 11:04:08 AM

Title: Important Registry Information For Beta 1.0.4 Modding
Post by: slink on September 26, 2014, 11:04:08 AM
Using mods appears to create entries in the Banished registry which are not correctly updated under some circumstances, possibly involving game crashes.  If for some reason you are unable to use a mod which previously worked, and all other causes are ruled out, check the registry.  There may be a series of entries beginning with "Mod".  There are two entries for each mod, one involving whether or not the mod loads with the game, and one involving some index number.  Deleting all of these in my case caused a mod to begin working again that had failed after several uses (RedKetchup's Decorative Items).  In several tests since I have not seen any new entries made, so I suspect these entries are meant to be temporary and were left in place when the game crashed during mod development.  Their absence has not affected my use of working mods.
Title: Re: Important Registry Information For Beta 1.0.4 Modding
Post by: RedKetchup on September 26, 2014, 12:34:24 PM
so if someone has a problem when he change from v 1.2 to v 1.3 deleting those registry keys would help to resolve issues ?
Title: Re: Important Registry Information For Beta 1.0.4 Modding
Post by: slink on September 26, 2014, 12:58:20 PM
It might.  It's worth a try and doesn't hurt anything.
Title: Re: Important Registry Information For Beta 1.0.4 Modding
Post by: RedKetchup on September 26, 2014, 01:03:45 PM
k, then i ll recommend it when people tell me ... help i m crashing !!!!
Title: Re: Important Registry Information For Beta 1.0.4 Modding
Post by: rkelly17 on September 27, 2014, 07:43:49 AM
@slink, when I fire up regedit I see entries that are ModEnabled_[mod name] and ModIndexed_[mod name] of type REG_SZ. The ModEnabled are either true or false and the ModIndex have a numerical value (not all of which are unique). Are these the entries you deleted?
Title: Re: Important Registry Information For Beta 1.0.4 Modding
Post by: slink on September 27, 2014, 08:26:05 AM
@rkelly17, yes.
Title: Re: Important Registry Information For Beta 1.0.4 Modding
Post by: rkelly17 on September 27, 2014, 10:32:50 AM
Thank you. I am working hard to learn the insides of the game and am going to try my hand at modding again.
Title: Re: Important Registry Information For Beta 1.0.4 Modding
Post by: Paeng on September 28, 2014, 07:04:18 AM
Quote from: rkelly17 on September 27, 2014, 07:43:49 AMThe ModEnabled are either true or false and the ModIndex have a numerical value (not all of which are unique).

Though they should be - it's an index counting your installed mods from 0 to xx (so if you have 20 mods installed, it counts 0 to 19)... if you have identical index numbers (like numerous #3 or such - do you really?) it probably means that you still have an older version in there as well (?)...


I been trying hard to understand this system, as I still get that dang runtime error under certain conditions, I'm trying to really pinpoint which condition triggers it  :o

Like Slink said, you can delete all these entries... however, when you install/enable mods again, they will also be written again in your registry (enabled=true, disabled=false). I think I found one cause for these crashes - do NOT just delete mods out of your [WinData] folder - that seems to really screw up the registry  :(

What works for me -

While in-game, open the mod menu and disable all mods.
Quit the game (NOT Exit!), check your mod menu again - great, your mods are still flagged enabled (green), so disable them all again.
Now you can Exit the game, and delete your Mods in the [WinData] folder...

Tedious, I know - but it's (so far) the only way for me to go. Any deviation, and I sure get a runtime error the next time I hit "New" game... or else need to go and clean the registry again and again and again...

Go figure  :-\


* Oh, btw - I have today upgraded to the latest version (BanishedPatch_Any_To_1.0.4.140925.Beta only, not the ModKit)... the runtime error problem still persists...

Title: Re: Important Registry Information For Beta 1.0.4 Modding
Post by: rkelly17 on September 28, 2014, 07:19:48 AM
Quote from: Paeng on September 28, 2014, 07:04:18 AM
Though they should be - it's an index counting your installed mods from 0 to xx (so if you have 20 mods installed, it counts 0 to 19)... if you have identical index numbers (like numerous #3 or such - do you really?) it probably means that you still have an older version in there as well (?)...

The problem began for me when I started playing around with different map-generation mods. I would move all but one out of my WinData and try a map. The game would either crash on save, quit or exit, or load. I'd terminate the crashed Banished process (I use Process Hacker for this--much better than built-in Windows program) and try another. By the time I went back to the original--which had not caused crashes before--it did the same thing. Even @slink's Overrides caused crashes. When I went into the registry all the mods were still listed (either true or false depending on which were enabled) and indexed, some with duplicate numbers. The registry even had entries for mods that were no longer in my WinData folder at all. I partially did what @slink recommended (deleted the obsolete entries) and did have fewer crashes, but it still crashed every so often.  Finally I deleted them all as @slink recommended and no crashes so far. The system for writing to the registry is obviously not perfect.

And I learned my lesson: Always pay attention to what @slink says and follow her instructions completely!  ;D
Title: Re: Important Registry Information For Beta 1.0.4 Modding
Post by: slink on September 28, 2014, 07:23:04 AM
It sounds as if the beta has a problem with not deleting old data from the registry, similar to the one it has with not clearing out the bin directory in mod compilations.  That's why it's a beta, I guess.   :)
Title: Re: Important Registry Information For Beta 1.0.4 Modding
Post by: Pangaea on September 28, 2014, 03:03:29 PM
There are many duplicates in my registry as well. I suspect this is because we have two versions of the game, normal game and the modkit, but only one registry entry. Sometimes I just load a mod in the modkit version to check it out, especially if I've made something myself, and other times I copy it to the main game's WinData folder. Right now I have three with index0, six with index1, three with index2, and two with index3. After that it looks better. I know that several of these have only been used in the modkit version of the game.

I don't have crashing issues right now, except when trying to "Quit" to generate a new map with one of the map mods, which may be linked to this index problem, so in case deleting many of the indexes cause a problem with the 'proper' save I'm playing, I'll just leave it for now.