Determining the Actor within an array?

So im curious as to how the save system pulls the array of an object that is saved to it? can someone give me some pointers? My example is, i have a bar of gold that is a blueprint, when the player collects said bar it saves it to an array which is passed to the save system. when loading the data, it says that the gold is in fact what is saved but shows as being completely gone/non existant. when collecting data from the print string it says that the object is at (0.0,0.0,0.0), for the print string for the item name it shows as nothing but when another print string is done its showing that its 0 always for each time it loops. Any assistance on this would be greatly helpful.


Thanks!

Heya @DragonRelt!

So you’re showing an event that you’re using to test… But what about your actual loading code? If you can confirm that it is saving, and it’s not returning here, it has to be after the save but before this, right? Let’s see that! :slight_smile:


This is the loading system, it saves the data and i know it saves the data because it pops up in the ui component that there is more then one of the item in there. I just need to know how to see the data/use the data from the save system to determine what to delete/hide in game once its collected and players leave the level.

i am setting the save file at this point in the event if that has anything to do with the issue.

Yes but where are you calling the event “HideGoldOnGameLoad?”

The gold calls the it on event load

you cant save Object references.

essentially that’s a place in memory and when you load memory has changed so it points to nothing.

instead break your Objects into their parts, ie save its class and transform

Would this work for deleting a specific pick up at a location or just removing collison and visability? I dont need the ref of the item just that it hides it

By setting a tag to the item that was collected i was able to remove it. but it removes both of the items when theres 2 of the same item. any way to fix this?

yes you give them a GUID

or possibly more simple, if you’re loading just set them to DestroyActor on BeginPlay and respawn actors from your save file

GUID? Explain ive been working in unreal for like 2+ years and im still learning alot.

basically a Unique ID, unreal can generate them for you and save them as a variable.

you can use the unique id to identify any object in the game

Now i want to factor one more thing into the pool of information, the guid can i use this for like 5000+ items?
Also how would i set the GUID?

3.4x10³⁸ or thereabout is the limit I believe

tl;dr:

1 Like

its inbuilt, you can search in engine for ways to generate / get GUIDs

most things in engine already have a GUIDs, even the ObjectName, so 5000 objects is no problem.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.