Fallout 4
0 of 0

File information

Last updated

Original upload

Created by

DarthWayne

Uploaded by

DarthWayne

Virus scan

Safe to use

About this mod

This is a simple tutorial showing you how to add custom categories to the workshop menu using scripts WITHOUT producing compatibility issues.

Permissions and credits
Changelogs
Donations
This is a simple tutorial showing you how to add custom categories to the workshop menu using scripts without producing compatibility issues. No more compatibility patches!

With this template you can:

- Add new workshop menus and categories without conflicts!
- Add new crafting categories without conflicts!
- Add weapons to leveled lists without conflicts!
- Add whatever you want to whatever formlist you want without conflicts!


As you may know, the workshop categories are defined in formlists. If you want to add a category, you have to add kewords and/or other formlists to the vanilla ones. If two mods edit the same formlist, you will automatically have a compatibility problem.

>>> NEVER EVER EDIT VANILLA FORMLISTS! <<<


So what else can you do? Formlists can also be edited with scripts (see CK wiki for details). That way multiple mods can add categories to the same menu without conflicting to each other. The only problem is, that you somehow need to automatically run your script. That is what this template was made for. It adds a quest to the game that runs on startup. Here you can add all your categories to the crafting menu.



How to use this template in your mod

  • Open up this file and your workshop mod in xEdit.
  • Copy the quest WorkshopAddCategoriesTemplate to your mod.
  • Now switch to CK and fill the properties. Add more if needed.
  • Adjust the script to your needs and rename it. See comments in source code for details.
  • Don't forget to also implement the uninstall function and test disabling your mod!


How to implement an uninstall function

This is important. If you want to uninstall or disable a mod that adds new menus or categories with a script, you have to add an uninstall functionality. Otherwise users will loose the edited menu, as the forms you previously added to them will be "none" then. There are basically three ways you could implement this:

  • Use an uninstall chem, that can be crafted at the chem station. This method will only work before disabling the mod.
  • Use a while loop to check if your mod is still active and remove all "none" values from the vanilla formlist if not.
  • Use the fixer quest, that runs every time you start the game and remove all "none" values from all formlists.
  • Special cases: In my mod Build your own Vault I add the categories when the player enters the vault and remove them if he leaves the vault again.

>>> IMPLEMENT THE UNINSTALL FUNCTION! <<<

Source Code

All source codes are included in the download. You have to adjust the CustomCategoriesInstallerScript a bit to fit your needs.


Credits

Thanks to ad3d0 and steve40 for giving me very important hints regarding the uninstall functions!