Purpose of m_addedScenes in LoadAdditiveScene?
Posted: Thu Sep 10, 2020 11:06 pm
Hello,
My game revolves around areas that can change fairly drastically depending on what conditions have been met. Not sure if this is best practice necessarily, but the solution I landed on was having a "base" scene, and then any permutations are stored in separate scenes that I add on top of the base with an additive scene load when the player first enters the base scene. These loads are stored in dialogue system triggers on a main controller that triggers a LoadLevel sequence on start if the proper conditions are met.
However, this was causing issues because with the save system active, LoadLevel executes SaveSystem.LoadAdditiveScene, which adds the scene to an m_addedScenes list, preventing the additive scene from being loaded again if I reload the base scene. Not adding the additive scene to that list solved the issue.
So, I'm not super familiar with how the save system works, so before I continue forward with this approach, I wanted to ask -- what is the purpose of m_addedScenes? Will I be causing further headaches down the line if I don't add to that list? Would a better solution be to write some kind of custom LoadLevel sequence that first calls UnloadAdditiveScene?
Any guidance would be appreciated.
Thank you!
My game revolves around areas that can change fairly drastically depending on what conditions have been met. Not sure if this is best practice necessarily, but the solution I landed on was having a "base" scene, and then any permutations are stored in separate scenes that I add on top of the base with an additive scene load when the player first enters the base scene. These loads are stored in dialogue system triggers on a main controller that triggers a LoadLevel sequence on start if the proper conditions are met.
However, this was causing issues because with the save system active, LoadLevel executes SaveSystem.LoadAdditiveScene, which adds the scene to an m_addedScenes list, preventing the additive scene from being loaded again if I reload the base scene. Not adding the additive scene to that list solved the issue.
So, I'm not super familiar with how the save system works, so before I continue forward with this approach, I wanted to ask -- what is the purpose of m_addedScenes? Will I be causing further headaches down the line if I don't add to that list? Would a better solution be to write some kind of custom LoadLevel sequence that first calls UnloadAdditiveScene?
Any guidance would be appreciated.
Thank you!