fluffy-mods / ColonyManager

Colony manager for RimWorld
Other
71 stars 39 forks source link

Addition of save game patches, enables save game compatability #118

Closed CBornholdt closed 6 years ago

CBornholdt commented 6 years ago

I've added a save game patch for the additional work type. Now with my Save Game Patches mod loaded, you can try this mod on any saved game.

FYI mod load order does not matter with my Save Game Patches mod.

FluffierThanThou commented 6 years ago

Is the new work type actually added to the back of the list upon enabling the mod? If not, this will stop errors, but change work priorities. I suppose it's an improvement, but I would probably rather inject a priority for managing specifically.

I like the idea of your mod in general though! RimWorld should have triggers for installing/removing mods to allow mods to setup/cleanup save games.

CBornholdt commented 6 years ago

When I attempted to insert into the '17th' element in that list for my new work type, I discovered that the list is not stored by naturalPriority, only sorted that way. Looking now, I see its actually stored in Pawn_WorkSettings as a DefMap<WorkTypeDef, int>, which makes the order dependant on the order in the DefDatabase? Wow ... I wish I knew about DefMap before but that's actually worse than being saved in priority order.

After adding a new work type to my mod

The best part of all this is I will probably be removing that additional work type from my own mod ... anyways thanks for the great mods!

FluffierThanThou commented 6 years ago

re: storing by defDatabase order; I know - this is what's given me huge headaches in the past with storing my own Work Tab priorities. I finally resorted to storing workgiver+priority pairs, then resolve them on load, adding/removing when needed.

I'm going to close this, as I don't think it's a good solution to the problem. I will be looking at using your Save Game Patches in the future though, thanks for making me aware of it!