I am creating a game which all takes place on a single scene, over the course of a day. As such, the “state” of the scene changes multiple times.
For instance, in the morning the sun will have so and so an intensity and be at such an angle, and doors X, Y, and Z will be locked, while door A will be standing open, and at noon the sun will be in a different state and all of the doors might be locked or all opened.
I want to be able to load these different scenes from the editor for playtesting. What I have done so far is modify my save game code, which remembers the state of all of the doors and the position and intensity of the sun in the game, to also be able to save all of that data to objects I can drop around the level. Then, in the blueprints there are editor events I can use to save all the stuff in the scene or load the data into the scene.
This works. But the problem is that the in editor scene doesn’t update to reflect the changes. While loading a game works fine and correctly will open/close the doors that are opened or closed, updating all of the doors states from an editor function doesn’t actually update their states. That is, while the boolean will appropriately be checked as “open”, the door will not actually be open until the game runs. Apparently, the constructor script on blueprints is not called when updating a value from C++ code?
This is difficult for me to playtest with because I would like to be able to load any state like that and see how it looks - what doors are opened and where the sun is, etc. This is how I was planning on lighting each part of the game, but if the sun doesn’t actually update, I can’t see how each part is lit.
Has anyone handled something like this before?
In case I was not clear above: I need a way to save/load from the editor the state of certain objects in my game, including the positioning and intensity and color of the sun, etc, and have that stuff actually update when their values are loaded.