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"

problem with saving variables

Hi , I am currently creating a clicker game , but I have a problem with saving variables here's what i did and what doesn't work : I made a game instance in which i store my variables when the game is played (9 variables). I have a user interface with a save button. I named the variables in the save game exactly like the ones in the game instance just with an s as prefix. Everything works fine as long as I only click and buy click "enhancements" but as soon as I buy the clicks per second upgrades (Hitlerfanatiker and Interviewer) it doesn't save correctly (it doesn't save anything). Here's how i save my variables: alt text alt text alt text Here's the load function alt text and here's where i call it (in game instance with event init) alt text Hope you can help me I really can't find whats wrong here ....

Product Version: UE 4.15
sc1.png (397.2 kB)
sc2.png (345.1 kB)
sc3.png (324.8 kB)
load.png (390.2 kB)
call.png (380.8 kB)
more ▼

asked Apr 27 '17 at 03:14 PM in Blueprint Scripting

avatar image

1 1

avatar image Benergy Apr 27 '17 at 03:51 PM

What do you mean with "buy the clicks per second upgrades"? And what kind of object are Clicks, Hitlerfanatiker and Interviewer?

avatar image Kostolo Apr 27 '17 at 04:07 PM

clicks is an int that is incremented when you click on a button hitlerfanatiker increases clicks by 1 every second and interviewer increases clicks by 5 every second hitlerfanatiker anf interviewer are the clicks per second upgrades i made a shop where you can buy those for a certain amount of clicks which is multiplied by 1.1 every time you buy one of them when you buy them the values of the objects get incremented and the amount of clicks per second increases

avatar image Benergy Apr 27 '17 at 04:22 PM

Have you tried printing them out on save to see if they contain the wanted values? Also (I'm not sure if I got this correctly) when you multiply a small integer with 1.1 and save it as integer, it won't change.

avatar image Kostolo Apr 29 '17 at 04:01 PM

it seems like not the actual value gets saved but 0 for all variables as soon as hitlerfanatiker or interviewer go above 0

avatar image Benergy Apr 29 '17 at 08:00 PM

So when one of these two variables is greater than 0 and you call save and load, every variable is wrong. Perhaps the load function returns the default values? Have you checked which branch is executed? Also, does "Save Game to Slot" return true?

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

0 answers: sort voted first
Be the first one to answer this question
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