Is there an up-to-date demo of this somewhere? the old demo projects are no longer available.
The link is on Marketplace page for demo project:
(Solved)
Hi there
I have configured a simple slot and set it to load instance
I’m a little stuck on how to setup my own UMG slot screen - in the instructions its showing that it is using a reference to Savior
How am I referencing that?
Here is the example:
Does my UMG widget need to be passed that savior reference? is there maybe a get savior on the player controller?
I’m probably missing something obvious here
Any help or advice on this would be much appreciated.
UPDATE: I’m an idiot - and have seen that it has the slot refs under the default values.
The slot is a rooted object, so you can reference a slot asset directly from your defaults picker.
It’s weird, but saves a lot of headaches when dealing with UMG
Would it be possible to see a simple example of this?
Getting a bit lost!
Setup a simple keypress save here. Have set ‘savegame’ as one of the tags on my primary actor
for some reason its not kicking in
Can you do a quick demo of that defaults picker setup on a basic widget?
do I need to fire up anything when spawning the widget?
Thanks in advance!
If you’re not using the async nodes you have to create an instance of the slot object before you use it:
Hi
Thanks for the assistance on this - so i set this up on the player controller - and still no dice - the fail print screens are hit. Must be something key I’m missing?
I think something strange is afoot - any ideas?
thanks!
(PS. I think i need to follow a setup guide again - i had this working a while back with an earlier version of savior - is there a setup doc I can grab a link too - im sure its something obvious im missing ! )
Look in your output log panel… There should be something in there, a warning or error about something.
Turn on “Debug” option on the slot asset and deep logs to catch c++ warnings. Save slots have their own log category for filtering.
Hey!
so a bit of luck- disabled the plugin and restarted and re-enabled and pop things started to do stuff!
I think im going to need to dig in a bit and follow the example on the demo project a bit to get the slots working but yeah it showed a saving message and seemed to teleport the character so all good
Thanks for the help on this!
Hi, just bought the plugin today, nice work - initial tests saving & loading everything just fine. I had been investigating writing my own system but thought I’d give this a try.
The one wrinkle is streaming levels; actors that are in a streaming level lose all their state since the last save when they’re unloaded. Is there an official recommended way to deal with this? Perhaps only ever streaming using explicit events (not automatic volumes) and auto-saving in a reserved slot before unloading? Looking at the events that are available I don’t think it’s possible to get it to work with streaming level volumes because the streaming object’s Unloaded event is after the data is purged, there’s no “pre unload” event?
If I do this by saving with manual streaming events, what happens on load? Do I have to manually stream back in or does Savior remember the streamed levels loaded at save time?
The plugin can’t save actors that don’t exist in the world any more.
i think you want to use node “Save Level” before you unload them, this node will save all actors of a streamed level you pass in, you can even save it to it’s dedicated slot.
And can also force a streamed level to reload with “Load Level” node whenever needed as well:
https://brunoxavierleite.github.io/S…SaveLevel.html
https://brunoxavierleite.github.io/S…LoadLevel.html
Remember to create “New Slot Instance” before using nodes like these.
Thanks for the fast reply.
Right so I think I can glean from that that indeed Streaming Level Volumes aren’t supported, it has to be via explicit streaming events so that you can prefix an unload with a Save Level call. Cool.
If you call “Save Level” on a slot instance, but that slot on disk previously contained a complete save of the entire world, what happens? Does it just add/replace the state of the level in the save file, leaving the rest of the save content intact? Or does it erase all the save slot contents and replace it with just the data for that (streaming) level? I’m hoping the former, because obviously a proper save game will contain the state of all objects in all levels, but those levels are never all going to be in memory at once so a complete snapshot isn’t possible, it has to update the save file a level at a time right? Or are you expected to have one slot per level (this would be pretty inconvenient)
If you create a slot instance then you first “Read Slot from File”, and then after that you save the streamed level, you are basically appending to existing save data.
If you simply do not read old data before saving, you are overwriting old data that is then erased from file.
Some projects want it one way, some want it the other way… So it’s up to developer to decide.
Ah, I think I’m beginning to understand how this works. A slot instance is the in-memory version of all the state you want to hold in a save slot, so if you load the last save data for this slot into an instance, and then call for example “Save Actor” on it, it only add/replaces that actor, leaving the rest intact. Then you can call “Write Slot To File” to persist it.
“Save Level” automatically writes as well unlike “Save Actor” but is it OK to save more than one level in a slot? I realise that means loading the entire slot from disk, saving the level, then writing it back (or just keeping it in memory if I want and using that everywhere for current state)
[edit]Oops we overlapped. OK I see now, thanks.
Yes, the thing I do all the time is set a “SGUID” to an Actor that is always the same across levels, then Read Slot from File and use “Save Actor Hierarchy”, to treat that actor and its children as a persistent entity independent of all the other content existing in a physical slot file.
That way I don’t really care in which level my data actor was saved from.
Is there any way to copy data from one slot instance to another? I need to have an auto save slot which I can use to save state as levels are unloaded (streaming or otherwise), but when the player decides to create a “proper” save, I need to copy all of that data from the autosave slot to the final slot. I can’t re-create the complete slot data from scratch, because it will contain data for levels which are unloaded right now. So what I want is to copy the autosave slot instance to a e.g. “Save 0” slot instance, update it with the contents of the current level, then write it all to Slot 0.
The API seems to assume read/write only ever happens within the one slot, I’m not sure how to keep all the data from an autosave, add to it, and save it as a real slot. Unless I’m supposed to copy the .sav on disk?
There’s implicit copy constructors in C++, but I can add a node to do that from Blueprints too.
Will take Epic a day or two to release new binaries to marketplace.
It looks like I could do this in C++, calling
GetSlotDataCopy
on the autosave slot instance, and then
SetSlotData
on the final save instance (the latter isn’t exposed in Blueprints). Perhaps also
GetSlotMetaData / SetSlotMeta
, but I’d have to copy that manually by the looks of it?
Sorry I keep overlapping with your replies. A copy operation in BP would be great! Thanks for your fast replies
That above actually wouldn’t work.
Code deep down the drain uses “SetSlotData” for threading trickery, you have to actually copy the TMap data, not set the sub object to a new memory address.
I will add a node for this, copy record data without touching sub object pointers
https://forums.unrealengine.com/core/image/gif;base64
Are you using Unreal 4.25?
The only version I have on this PC I am using here is 4.25.