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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Unlock level forget prior unlock

When I complete a level, the next one gets unlocked. But then it locks the previously done level.

Is my savegame blueprint not right? How do I make it remember that the previous levels are unlocked.

alt text

Product Version: UE 4.18
Tags:
more ▼

asked Jan 17 '18 at 12:55 PM in Blueprint Scripting

avatar image

Krakinoz
1 1 2 3

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

1 answer: sort voted first

Hey there, you should just store 1 integer variable which holds the highest level you've unlocked, then you just need to compare if it's less or equal than that, if it is, unlock it, else it's locked.

more ▼

answered Jan 17 '18 at 02:20 PM

avatar image

xlar8or
6k 161 129 304

avatar image Krakinoz Jan 17 '18 at 02:29 PM

Thank you for your fast reply.

How would I go about doing that? The first picture is my level select widget, the second is my level blueprint.

I seem to be stuck unfortunately.

Thank you for your help.

alt text

alt text

avatar image xlar8or Jan 17 '18 at 02:36 PM

Right now you are saving a bunch of booleans, you have to get rid of those and just store an integer variable (let's call it Unlocked Levels). On the comparisons you are doing on button click you just have to check if the variable Unlocked Levels is less or equal than the level number you are testing. When you unlock a new level you save Unlocked Levels with the level number.

avatar image Krakinoz Jan 17 '18 at 04:14 PM

Can you tell me what's wrong here? Shouldn't this add +1 if the level is equal or less than the level reached?

alt text

avatar image xlar8or Jan 17 '18 at 04:30 PM

What is the problem you are having?

avatar image Krakinoz Jan 17 '18 at 04:33 PM

I appreciate your help a lot.

It is not adding +1 to the integer.

avatar image xlar8or Jan 17 '18 at 04:37 PM

Does it execute the print?

avatar image Krakinoz Jan 17 '18 at 04:48 PM

Unfortunately not.

avatar image xlar8or Jan 17 '18 at 04:54 PM

Ok so put the print of the Level Reached before the branch to see what is its default value.

avatar image Krakinoz Jan 17 '18 at 05:02 PM

Level 1 print "1" Level 2 now print "0"

alt text

avatar image xlar8or Jan 17 '18 at 05:05 PM

Where are you executing that code?

avatar image Krakinoz Jan 17 '18 at 05:09 PM

In the "Select level" blueprint.

alt text

avatar image xlar8or Jan 17 '18 at 06:22 PM

On the level blueprint (from the previous comment) you are always create a new save, so that will probably reset it. You have to check if the save exists with Load save game, if it does you have to get the levels reached and see if its smaller than the current level you are in, only then do you want to override the existing value.

(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