The Elder Scrolls V: Skyrim

The Elder Scrolls V: Skyrim

Imp's More Complex Needs
This topic has been locked
Imp  [developer] Sep 7, 2013 @ 2:34pm
Creating Compatibility Patches
For now (i.e. for IMCN v0.31) it's pretty easy to make a food compatible with IMCN. You just need to add a couple of keywords to it either via the Creation Kit or TES5Edit. I'd recommend using TES5Edit unless you're comfortable with setting the master flag for .esp files that need to be treated as masters (you need TES5Edit anyway to set that flag if you want to use the CK to do the editing.)


If you're familiar with TES5Edit:

1. Create a patch file with overrides of each food from your mod.

2. Add one of the IMCNgeneric... keywords from Imp's More Complex Needs.esp to each food override. There are 25 to choose from in v0.31, things like IMCNgenericTea, IMCNgenericCheese, IMCNgenericMeatCooked, etc., just pick one and the food will get that nutrition info.

3. Also add the IMCNisGenericFood keyword from Imp's More Complex Needs.esp to each of those overrides. This lets IMCN know that it should look for an IMCNgeneric... keyword when trying to look up nutrition info for that food.



If you're not so familiar with TES5Edit (detailed instructions):

1. Open TES5Edit, and load Skyrim.esm, Imp's More Complex Needs.esp, and your mod. The load order doesn't really matter.

2. In the window on the left, click the '+' to the left of your mod's name to expand it, and then expand the "Ingestibles" subcategory to see the foods your mod adds.

3. Right click the first food you'd like to make compatible, and select "Copy as Override into..."

4. Select "New File" when prompted and click Ok.

5. Enter a name for the patch. I've been using "IMCN - Mod Name" for compatibility patches, and Mod Name - IMCN for compatible versions of mods like the one for Babette's Feast, but you can use whatever makes sense to you.

6. When prompted to add Skyrim.esm and the patched mod as masters, click OK.

7. In the window on the left, right click the newly created patch and select "Add Masters".

8. Put a check next to "Imp's More Complex Needs.esp" and select Ok. This will let your patch use keywords from IMCN.

9. Add the keyword "IMCNisGenericFood" to the new food override in your patch to let IMCN know it's a generic food.
To add a keyword:
A. Highlight the food in either your mod's "Ingestibles" list or in the patches.
B. In the window on the right, look for the line "KWDA - Keywords".
C. Right click the empty cell in that row and under your patch's column, and select "Add". A new keyword entry will be created just below it, initially set to "NULL".
D. Click that new entry once to select it, then (with enough of a pause for it not to register as a double click) click again, and you'll get a dropdown menu with keywords in alphabetical order.
E. Scroll down to the IMCN keywords, highlight "IMCNisGenericFood", and hit enter.
10. Repeat steps A through E to also add one of the several IMCNgeneric... keywords to the food, letting IMCN know which kind of food to base the nutrition info on. There are 25 to choose from in v0.31, things like IMCNgenericTea, IMCNgenericCheese, IMCNgenericMeatCooked, etc., just pick one and the food will get that nutrition info.

11. Repeat steps 3 through 10 for each food you're making compatible, but choose the new patch file you've created rather than "New File" when prompted in step 4.

12. Exit TES5Edit, and let it save the patch you've created. If you've accidentally edited any other files and want to prevent those changes, uncheck them in the file list that popped up before clicking Ok.

13. The patch should load later than Imp's More Complex Needs.esp and the file it's patching.


Important: Because the patch has .esp files in its masters list (Imp's More Complex Needs.esp, as well as the mod it patches if that mod is an .esp), attempting to edit it in the Creation Kit will break it unless you've set the ESM flag on those .esp files. Either do all editing of the patch in TES5Edit, or set those ESM flags before working on it in the CK. Don't forget to clear your mod's ESM flag again before uploading to the Nexus or people will be complaining about load order issues and/or mod manager warnings.

There are additional steps involved if you want the food to also spoil, but I'd hold off on doing that for now since spoilage is currently broken, and because those steps will be changing after the update (meaning you'd need to remake the patch.)

There is also the more involved process of creating new nutrition information, which involves creating new scripted activator objects with information stored as properties, but that process will be changing significantly with the upcoming update, so I'd hold off on doing it since it's a fair amount of work, and would need to be redone after the update.

If you create a patch for your mod, feel free to upload it. Let me know and I'll add you to my compatible mods list, and/or host the patch here if you want (though I can lag a bit sometimes, don't take it personal.) If you create a patch for another author's mod, you have my permission to upload, but be sure to get their permission as well if required. Also be aware that I might want to take over responsibility for compatibility with some mods if there's an opportunity for more intricate compatibility features, though I'm willing to work with you, I'm definitely open to anything that reduces my workload.