ttdly Posted June 19, 2023 Share Posted June 19, 2023 Hi, I want to make a mod that adds new story traits. I tried adding new configuration files under worldgen\storytraits, but it didn't work. Do I need to add any additional configuration somewhere else? Link to comment https://forums.kleientertainment.com/forums/topic/148562-help-add-new-storytraits/ Share on other sites More sharing options...
SGT_Imalas Posted June 19, 2023 Share Posted June 19, 2023 you need to instantiate a new Story and register it via AddStoryMod in Stories via Db.Initialize Postfix example: [HarmonyPatch(typeof(Db))] [HarmonyPatch(nameof(Db.Initialize))] public static class AddCustomStory { static void Postfix() { var yourStoryTrait = new Story("{StoryID}", "storytraits/{templateFileName}", -1) .SetKeepsake("keepsake_test"); ///if you add any keepsake Db.Get().Stories.AddStoryMod(yourStoryTrait); } } Link to comment https://forums.kleientertainment.com/forums/topic/148562-help-add-new-storytraits/#findComment-1642307 Share on other sites More sharing options...
ttdly Posted June 19, 2023 Author Share Posted June 19, 2023 6 hours ago, SGT_Imalas said: you need to instantiate a new Story and register it via AddStoryMod in Stories via Db.Initialize Postfix example: [HarmonyPatch(typeof(Db))] [HarmonyPatch(nameof(Db.Initialize))] public static class AddCustomStory { static void Postfix() { var yourStoryTrait = new Story("{StoryID}", "storytraits/{templateFileName}", -1) .SetKeepsake("keepsake_test"); ///if you add any keepsake Db.Get().Stories.AddStoryMod(yourStoryTrait); } } Amazing!!! It seems work, but I still get some errors. I will try my best to fix it. Thank you very mutch. Link to comment https://forums.kleientertainment.com/forums/topic/148562-help-add-new-storytraits/#findComment-1642355 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.