Download

HOW do I save the value of more than 1 actor ?


It does not have to be 100 page 200 pic tutorial and it will still help !


THIS THING > How do I use the SaveGame flag? - UE4 AnswerHub

What you need to do is array’s. For something like this I would probably use 2 array’s. One for location (vector) and one for whether the door is open (bool).

I would then get the door to load the saved locations array and see if it’s location is located any where inside it, if so what index. I would then use the index to find corresponding saved bool at the given index for the mesh. If it’s location isn’t found then save it in the locations array and set the corresponding bool array to closed (false)(or open if that’s what you want the default to be).

If the player was to open the door I would repeat the above steps but instead of getting the array’s I would set them.

Hope this helps.

Also I made a basic introduction to saving in UE4 for on my blog so check it out. If you’ll like I’ll try make a more advanced one covering the concept I’ve outlined above? (may be a few days though)

No need I am using arrays , the idea was if there was an “automatic” way for the engine to create the array and assign index without me needing to care.

Now I have 4 vars (arrays) per Quest and each quest has to have a unique name (aka index for the arrays) . This adds clutter to the blueprint , and is prone to errors because you can forget to set the unique name OR the name is the same as one in other quest .

From pretty much the nodes shown below and a little bit in the level BP I could easily place hundreds of doors in a level and have them all get there open/close state saved. With one small tweak in the Level BP I can get it to save based on the level too. With this initial setup I don’t ever need to think about saving this data again as it’ll just do it. Is this the type of stuff your talking about?

My Door BP: