UE4 How to save and load using Widget buttons in Blueprints, like if you change any material of object or movement. Ex: You have multiple objects and in save1 you are adding object1 with different material and in save2 object1 with original material or object2. Then how to save and load them?
Could you clarify if you want to save and load within the same session or save to load in other sessions? In the first case, you can store data about the actors in variables. In the second case, you should use the Save Game object. Also, specify if the “objects” are Static Mesh Actors or other classes. Then I’ll describe the solution in more detail.
So, I want the data to be stored on different widget button slots, like you create a button to save one object and a different ui button to save the other position or object in realtime. The objects are static mesh actors. More like a archviz pattern, like saving a furniture with different material on one ui button and loading it from that button and other on a different button slot and loading it from that slot.
I’m not sure if I understood you correctly. Therefore, I will show how to make buttons for spawning a Static Mesh Actor with predefined parameters. I hope this helps.
Make a template button widget with needed data variables.
Make a controlling widget, place template buttons, and set data variables.
Add events for spawning.
A slightly different approach is required if you want to change materials, static meshes, or the position of existing actors. However, I still don’t understand what exactly you want to do.
So, I wanted to create a save and load system where I could save the changes that I make during runtime in a save slot and load it from the slot by using a widget. To be precise, like if I am adding a cube at a particular location, with a particular material and want to save that, then by clicking on a save widget button, I can save that as Save1 . Then, if suppose I am changing the location of the object or material, then I can do that and Save it as Save2, but the previous design I created will also be stored and visible in a scrollable widget, so that I can load that and edit it anytime I want.
For example: If I have a furniture and 4 different materials, I apply material 1 click on the Save button and the design gets saved as Save1 to a scrollable widget which is visible on right side of the game view scene, where I can later go and click on the saved design whenever I want to load and edit it. I apply material 2 change the location of the object, click on save then the design gets saved as Save2. I can load the saved objects whenever I want to.
Now everything is clear to me. I will try to show you how to implement it with an example of a level blueprint
Create a loading button template
Create a controlling widget
Create a save game blueprint where you will store the list of saved states
Create a save game blueprint where you will store the states
In the level blueprint, build a widget and subscribe to its events. Next, build the save-load logic.
Thank you so muchhh
Could you tell me where did you get SavedList variable from in point 5(level bp)?
Thank you for your help!
Example Project Link