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"

Please can someone help me with saving variables ?

It is working for saving my name text variable but using the same code for saving integer variables just won't save. This is in the unreal engine.

When I package my game, saving my name text variable no longer works.

I have selected every file to be included in the cooking/building/packaging.

Here is the save file blueprint: alt text

If you would like any more pictures please do ask

Product Version: UE 4.9 Preview
Tags:
newgamestate.png (1.2 MB)
more ▼

asked Aug 31 '15 at 09:24 AM in Bug Reports

avatar image

Dannyk90
255 37 36 51

avatar image Ben Halliday STAFF Aug 31 '15 at 02:47 PM

Hi Dannyk90,

It's a little hard to follow with that image, but I don't see anything explicitly wrong with your setup except for one point: in the second part of your main sequence on Event Begin Play, the Does Save Game Exist and the following Branch are not connected, so that Branch is always returning false. It doesn't look like XP is ever being loaded.

I wasn't able to reproduce any problem with the save system in a packaged project, either. Can you reproduce this in a new test project? If so, can you upload it somewhere for me so I can take a look? Thanks!

avatar image Dannyk90 Aug 31 '15 at 03:23 PM

I connected that and tried again, nothing changed, it keeps creating a new save file for my xp, I dont understand why.

I'll try re-create it in a new project...

Thanks

avatar image Dannyk90 Aug 31 '15 at 04:07 PM

i recreated it in a new project and both problems have gone!

The change I did was get the visual numbers to read directly from the save file!

I'll now try this in my main project...

avatar image Dannyk90 Aug 31 '15 at 06:10 PM

name works but numbers dont

avatar image Dannyk90 Aug 31 '15 at 06:21 PM

the exact same thing works in my new project, can i send you my main project privately ? My brain is blowing up ...

ah in the new project, the number stopped saving, though it worked before i opened my main project, i have changed nothing... I keep stopping it, starting it and changing a number (which saves) and stopping it and starting it, sometimes it saves, sometimes it doesnt...

weird bug, I think it happens when you want to save more than 1 variable.

avatar image Ben Halliday STAFF Aug 31 '15 at 06:31 PM

Possibly. Lemme get both your project and the test project. If you can zip them up and upload them someplace like Google Drive or Dropbox, you can send me a link via the forums, here:

https://forums.unrealengine.com/member.php?32-Ben-Halliday

Make sure you give me repro steps for both. Thanks!

avatar image Dannyk90 Aug 31 '15 at 07:01 PM

uploaded and sent the link to you :)

thanks

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hey Dannyk90,

Ah, I apologize, I didn't notice this in the images you provided, but the problem is that you're overwriting the Save Game Object in a bunch of places, and it's only remembering the last one you saved. Since you're trying to create three separate Save Slots, you need to use three different variables. Instead of the singe Save Game Object variable, create a Save Game Object called Save Slot XP, and another called Save Slot Name, etc.

In the test project you sent me, it would look like this: alt text

Let me know if you have any questions about that. Hope it helps!

savegameobject.png (167.5 kB)
more ▼

answered Aug 31 '15 at 08:45 PM

avatar image Dannyk90 Aug 31 '15 at 09:04 PM

ah ha thank you! This was never mentioned in any tutorial i saw lol.

its all working now :)

how would i reset the saved variables for distribution ?

avatar image Ben Halliday STAFF Aug 31 '15 at 09:23 PM

You shouldn't need to. When you package the game, it doesn't include any existing .sav files. The packaged game will create its own.

If you want to be doubly sure, you can implement an option to clear all saves in a menu somewhere, and then simply overwrite these all with a blank Save Game Object. Just create a Save Game Object and don't feed it any variables, and that should leave them all as their defaults.

avatar image Dannyk90 Aug 31 '15 at 09:27 PM

I did package the game and it still had my saved data.

It is on for distribution and full rebuild.

Yeah I can do that thanks

avatar image Ben Halliday STAFF Aug 31 '15 at 09:28 PM

Hm, I'll look into that. Thanks!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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