Hm... just some random thoughts about mods...
If you want to make your mod switchable (on/off) you will meet several questions.
- First. How to determine the moment when the game started? Yes, "features" function on menu elements is nice, but there are some special moments... What if you have none elements in the menu? Ok, let's suppose what you have something in menu, but you need to make something after generation of the dungeon is finished (place special monsters or replace/move some tiles)...
- Well, in that case, you can use kts.SetRespawnFunction(f). But only one mod (as I suppose) can use this in the same time. So, if you decided to "install" your custom respawn function, others won't be able to do it... or even you will "lose" your already installed respawn function if someone else needs this function too. Because while using hooks, you can find an old hook function and manually call it after your function... but here is no kts.GetRespawnFunction.
- Hm... but you can make some plugin what will claim this function for himself and send to registered mod some kind of notification about respawn event. Well, I have thought about adding such feature to my Toolbox mod (in the same way as hooks were implemented in it)... But it can't (as far as I know) call kts.SetRespawnFunction because this mod doesn't have any elements in the menu, lol...
- I am not talking about using existing hooks, because if you want to generate monsters in the dungeon - it is a bad idea to wait until someone will be hurt/step on some special tile etc. etc.
- The second question is how to determine the fact what the game already finished? So, you can delete all your hooks, free data tables, etc? Because there is a strong chance what in the next match your mod will be disabled, but you will get no notification about that... so, in some cases (excluding custom respawn function, initial mosters and other "auto-disabling" options) your mod will be acting as enabled. How to avoid such situation?