x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Save/Load System

I am trying to make a system that will save the players position from the pause menu and load it up by a button that can be navigated from the main menu. My main problem is the loading system, as I don't know what to use as the wildcard. I have tried get Parent, get player Controller, get player Character and none of them work.

alt text

My save system seems to be working, but I can't be sure as I need to be able to load the data to test the algorithm. I am relatively new to Unreal 4, so please forgive any unnecessary code and functions, or any seemingly simple mistakes.

Product Version: UE 4.18
Tags:
saveload-system.png (106.2 kB)
more ▼

asked Mar 26 '18 at 08:13 PM in Blueprint Scripting

avatar image

AgentArachnid66
7 3 4 11

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Your "Pause Menu" I assume is a widget, so in order to "get" the widget you would need to go to the blueprint where you "created" the widget and right after you create it save it as a reference. Then from this blueprint in your screen shot you would "Cast" to the blueprint that created the widget (player character?) and grab the reference from that BP.

more ▼

answered Mar 26 '18 at 09:54 PM

avatar image

Nebula Games Inc
4.5k 26 9 14

avatar image AgentArachnid66 Mar 27 '18 at 10:53 AM

What would I save as a reference and how? Do you have any documentation or examples I could have a look at? I am sorry if this seems as if I don't have a grip on the engine yet, but that's why I am trying to do this

avatar image AgentArachnid66 Mar 27 '18 at 10:55 AM

Here are some screenshots of my save system if that helps. It didn't let me attach them initially.

alt text alt text alt text

save-system-1.png (71.1 kB)
save-system-2.png (110.7 kB)
save-system-3.png (110.6 kB)
avatar image Nebula Games Inc Mar 27 '18 at 08:49 PM

Can you explain to me in steps what the functionality is you are trying to achieve? For example:

  1. Play the game, score points say 100

  2. Pause game

  3. Save point value @ 100

  4. Quit game completely (computer off or Unreal closed, etc)

  5. Load saved score from main menu HUD

  6. Play game starting with previously earned 100 pts

Is that what you are trying to do?

avatar image AgentArachnid66 Mar 28 '18 at 03:05 PM
  1. Open Main Menu HUD, and go to play game options

  2. From play game options select load game

  3. checks if save game exists

  4. if it does, load that slot, putting the player in the position where they last saved

  5. If it doesn't, open a new game

From the pause menu 1. Click on the save game button 2. checks if save game exists 3. if it does, overwrite 4. if it doesn't, save to that slot

These two slots are the same and there aren't any reference to either in the third person character blueprint.

avatar image Nebula Games Inc Mar 28 '18 at 07:45 PM

So looking at that set up, you shouldn't need to "cast to pause menu", that "on clicked" event should be called FROM the pause menu. And that button should create the save game object and write the data needed to be saved and then save it out to slot. All of that functionality should be handled by the widget. OR when I made this functionality for my game, I had the widget reference my game instance which held a function to write and save game data. Either way you should never have to cast from the on clicked button TO the widget. So that issue of the wildcard shouldn't even exist if you script the logic differently. Does that make sense?

avatar image AgentArachnid66 Mar 29 '18 at 09:17 AM

It kinda does. Any screenshots to show me what sort of thing you mean?

  1. List item

avatar image Dune Mar 28 '18 at 08:24 AM

Looks like you are trying to change the player transform stored in the SaverSubclass?

It might be that you pass in the variable without the change to the save game slow - Have you tried linking up the SaverSubclass to the SaveGameToSlot with an extra node, instead of dragging it from earlier in the blueprint sequence?

alt text

capture.png (109.9 kB)
(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question