Maybe you want to take a tutorial or YouTube video on how UInterfaces in Unreal work.
This is standard Unreal API.
Maybe you want to take a tutorial or YouTube video on how UInterfaces in Unreal work.
This is standard Unreal API.
That’s a good idea but most important I want to see clearly your plugin in C++, and next step to save and load
All the blueprint nodes are callable from C++.
SaveGameWorld(), SaveGameMode(), etc etc.
I will submit an update (v4.5) soon, which introduces a ’ Data Explorer Panel ’ within the Unreal Editor, for easier developer checks of existing data that is currently stored on a Slot class’ target save file.
(panel can be opened by right clicking the slot class on content browser)
For now this update is for Unreal 5.1+ only:
Hey Bruno,
quick question: How do you deal with the Player Start Actor? I am using a child class of that actor for new games, and on load I am taken back to it no matter where I save from. I am marking it for destroy by Savior and it has a SGUID.
Should I not use a child class for player start?
2 things:
This only happens in the packaged product.
I am using 4.26 as I want to finish this game in UE4 before moving to UE5
Thanks!
You should load save file after the spawn process is fully done and the player is moved to the PlayerStart location.
Usually a “Wait Until Next Tick” before you load the save data should resolve it, the code running in the PlayerStart will be already done at that point.
Interesting, follow up q: I thought load ran a spawn process, or is it just re-spawning saved actors? This bug seems to happen from a menu screen as well as if I am already playing in the world.
Are you suggesting I load world and then load actor?
I now suspect this may be happening because the player start is a child class that is being saved by SAVIOR, and when its loaded moves the character. I will replace with original and test. I will try this later tonight and report back if you are curious.
This is super helpful, thank you again Bruno.
The plugin doesn’t interfere with the spawn process that is usual to the game engine.
It only respawn actor instances that meets the criteria in the tutorial about procedural actors.
Interesting. I tried making the player serializable-only… no luck.
Sorry for the confusion, but how do you handle this? You don’t use load world? or you do then also load the player actor after world is loaded(wait until next tick)?
Thanks
Have you tried to add a 1 second delay before running “Load World” node?
You just need to load the data after the game is fully ready, not immediately at Begin Play.
It depends. You can load in the game menu, and during gameplay. there is a ui button for loading that runs this code:
In both cases I don’t know how to add a delay because load world is calling begin play it seems. Should I not “Reset level on load”?
You can turn off the Reset Level option, open the level manually, then use this node (or the non async version of the node).
I think that worked, thanks!
Nevermind, I packaged and it isn’t working. It is so weird that it works when I launch in editor, and not packaged. Is there something I need to do when I package like a setting to include plugins? I am packaging in ‘Development’ mode.
In the packaged version when we reach these nodes:
LOAD WORLD SUCCESS is printed, which makes me think savior is packaged.
I am now going to try some things to do with loading the controller
for the player pawn I have tried:
SGUID = FGuid(0,0,0,0); and
USavior3::MakeActorGUID(this, EGuidGeneratorMode::ResolvedNameToGUID);
Going to try making player controller a static GUID like (1,1,1,1).
Also, If you would prefer me to DM you with this issue let me know.
Print the guid on packaged build then launch the exe again and print it again.
The Guid value should always be the same.
Interesting development: I am looking at the logs from packaged build, character is saved with a weird GUID and not loaded. AHero is the character class:
[2023.01.07-07.43.55:579][347]SaviorLog: {S}:: Serialized Actor :: /BP_Hero_00000330000002EB00000209000001B9
[2023.01.07-07.43.55:579][347]SaviorLog: {S}:: SAVED DATA for FPArmor_00000330000002EB00000209000001B9 :: {“bIsOwned”:false,“HotBarIndex”:5,“bIsEquipped”:false,“InventoryPosition”:{“X”:0,“Y”:0},“Amnt”:1,“bCanBeDamaged”:true}
Later on I don’t see any unpack log for hero but I do see
[2023.01.07-07.44.01:663][644]SaviorLog: {S}:: UNPACKED DATA for FPArmor_00000330000002EB00000209000001B9 :: {“bIsOwned”:false,“HotBarIndex”:5,“bIsEquipped”:false,“InventoryPosition”:{“X”:0,“Y”:0},“Amnt”:1,“bCanBeDamaged”:true}
[2023.01.07-07.44.01:663][644]SaviorLog: {S}:: Deserialized :: FPArmor_00000330000002EB00000209000001B9
So I guess FPArmor is overwriting the hero class. I don’t get it though because in the hero constructor I am forcing SGUID:
if (this != nullptr) SGUID = FGuid(0, 0, 0, 0);
I would override OnLoad method of the actor (with Serializable interface implemented) and do some logs in there.
If nothing is logged then for whatever reason that actor instance is not being loaded at all, also that Sguid value doesn’t look like a 0000 guid to me.
Ya it isn’t loading. If I send you the log do you think you can take a look at what is going on?
again, It is saving and loading in non packaged builds, but in (development) packaged build its only saving.
If you can isolate 1 level (map) and zip it and send it to me, on my weekend off work I can debug it for you and see what is wrong in your setup.
You can email me the logs, but only logs are not always enough to see is missing in there.
Ok, thank you!