I am looking for a way to run a function as soon as the map is told to change levels (before some actors start getting destroyed). I want to save some game states right before switching maps and trying to find a way to get the functions to always execute at the correct time.
There are many things that could call open level, going through a door to exit the map, touching a combatant which launches a fight in another map …etc . The goal is I can easily assign my object to a delegate instead of remembering to add conditional code to see if level has items to save state on and then save them. I would much rather just listen for a callback.