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"

Problems saving high score with a branch in blueprints

I'll now post pictures of my whole blueprint so it's easy to follow along and maybe you can see a problem I can't:

alt text alt text alt text

The first step is just my score system then rendering it in game, the second is checking whether a save game exists then either creating or loading it, then the third is casting to my save game and saving.

As you can see in the last panel I've tried make it so before saving the highscore it checks to see if the Total Score (Float) from the scoring system is greater than the Total Score (Integer) from my save game and if it is it should then save. I thought this would work fine it makes sense but it either doesn't ever save or just saves straight away without checking if it's higher than the saved high score.

Not sure how this relates but I also have a function on one of my widgets bound to the highscore for the HUD, which should set the highscore that's saved here to some text on my HUD to show the player their highscore, however nothing shows up on the HUD when the games over whether it was higher or not, I'll leave a picture of that function as well not sure if they're related problems or not.

alt text

Thanks for the help in advance.

Product Version: UE 4.7
Tags:
score1.png (233.3 kB)
score2.png (204.2 kB)
score3.png (273.9 kB)
score4.png (101.4 kB)
more ▼

asked Nov 23 '15 at 12:44 PM in Blueprint Scripting

avatar image

AdamDoubleU
5 2 5 7

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

1 answer: sort voted first

Maybe I misunderstand what you're trying to do but in your third screenshot, you set the scoree's TotalScore to your local TotalScore just before comparing the two values.

I'd expect this to result in the score never being updated - unless the score actually is a float value, in which case it'll update if the rounded value (cast to int) is different from the real score.

You'll probably want to do your branch check before updating the scoree's TotalScore value.

more ▼

answered Nov 23 '15 at 01:02 PM

avatar image

erinacea
1.8k 69 28 113

avatar image AdamDoubleU Nov 23 '15 at 01:26 PM

How didn't I notice this?! I followed a tutorial then tried to adapt it for my purposes I think that tutorial was just saving total mouse clicks. So I just did what they did and then forgot about it.

Does this look right to you?

alt text

score5.png (138.7 kB)
avatar image AdamDoubleU Nov 23 '15 at 02:14 PM

I got it working how i did it in that Score5 picture I sent, but when I use my reset function after my character dies all this highscore stuff doesn't fire again.

(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