Cast to save object failed

Two similar piece of code. One working, other not working.

This one working:

And here cast to save object failed.

Really they have equal scheme. What wrong?

Slot Name? Validate here to find out:

No. Slot exist. Is valid. Something else… I don’t know until why.

You have Completed and Active. If the loaded one is valid, then it’s the wrong object type. You load #13 thinking it’s the Completed but it is not.

Print its display name.

You are right. Function for save completed quests save them under name of other save object, where save active quests.

There clearly declared save to CopmpleteQuestSave Object.

But it saved under other object name… it crazy.

Have any idea? :woozy_face:

Not sure what’s crazy here. So far, at least. Could you show where you save Completed to disk at slot 13?


Why do you even have 2 different save game object types for this? Wouldn’t it be better to have 1 save game type with an extra bool questHasBeenCompleted?

You may have your reasons, ofc. Just asking :innocent:

I thought separate game variables and quests. For not load from disc health, exp, levels every time level load. They well transfer with Game Instance. Not such well things with transfer arrays of quest data. Really I have 3 save game objects. I saw others do. 2 of them use without problem. Why not use third? :wink: It wrong practice?

Here files saved

Not necessarily, if you got it to work the way you need, and are OK managing it, sure - why not. My question stands, though:

Probably somewhere there to the right:

Also, you do not need to cast here.

You right again. There was my fault. I use another save game object in function pin. :rofl:

No all ok with this.

Then born another mistake:

There where arrow variable have NONE value… But it get class from array, it printable. I stack again. Really I newbie in all this, thank a lot for help.

That will be the major thing with this system - I think I saw it mentioned in another thread where someone asked you why you were using classes like this. Afair, you followed a tutorial? This is all very strange and I can’t imagine how this is supposed to work, tbh.


Think of the Class as of a template. You use that template to spawn (instantiate) an actor:

image

If you never instantiated an actor from the QuestCompleted class, the Get Actor of Class node will return none because the actor does not exist.

This is idea. I impact some troubles like this. They work fine when actor spawned in the game beginning or level loaded… Thank you remind me. I spawn this actor, but then restore files from copy, because lost completely way what I did :rofl:.

Really this was not helpful in this context. There was other trick. When I remove index from array «active quest», when quest completed, other save function can’t get it value and save NONE. Because it was same class :rofl: . I check file, there was empty string of arrays. I understand it whet delete “remove index” node. Now all working ok. Really I didn’t wait such result.

Both functions, “AddNewQuest” and “SubgoalCompleted” use same class as input parameter. So “SubgoalCompleted” reorder work of “AddNewQuest” function. Both functions just assign strings to Player Quest Journal.

So now all work as I need. Really I don’t understand completely how :rofl:. But working. I can go further. :smiley:

Thank a lot for advice! Have health and luck. :ok_hand:

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