Rainbowdesign Posted July 2, 2019 Share Posted July 2, 2019 What are the best positions in the code for a harmony patch to get an entry point when a new game is generated and what is the best position for an entry point when the map has finished loading? Link to comment Share on other sites More sharing options...
Nightinggale Posted July 2, 2019 Share Posted July 2, 2019 Game.SetGameStarted() looks interesting. It appears to not be saved and it starts as false and this method sets it to true. It can't revert to false. Together with Game.GameStarted(), it adds something, which sounds really useful in multiple cases. I just found it, but I'm already wondering if I can use it in OnSpawn. Link to comment Share on other sites More sharing options...
SuperCorgi Posted July 2, 2019 Share Posted July 2, 2019 I followed the Game.SetGameStarted() to where its used. It seems to work great for knowing when the map has finished loading. If what you need is specifically when a new game first has its map loaded, another possible candidate is the WattsonMessage class. WattsonMessage.OnActivate() will always be called when a new world is finished generating and the dupes have been selected. Hooking a prefix into that method would likely work great. Link to comment Share on other sites More sharing options...
Rainbowdesign Posted July 3, 2019 Author Share Posted July 3, 2019 I tried [HarmonyPatch(typeof(Game), "SetGameStarted", null)] It seems like its never called. [HarmonyPatch(typeof(WattsonMessage), "OnActivate", null)] Seems to work great however. Link to comment 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.