New to UE4 and looking for some guidance. We are creating a game and are implementing a level select system. The issue we are currently having is we cannot figure out how to have the button display text, currently the only way we know is for it to pull the level number, we would like the button to instead say the level name and point to the level after checking for unlock and completion.
When you say “level”, do you mean level as in UE map assets? The things in the content browser that end in .umap? Because then it’s simple, given the fact that we don’t know anything else about your project and your UI. But, assuming you build your UI with UMG, you’d have an array variable in your widget that stores the levels’ names (type is Text or Name, not sure, but easy to find out). Each of your buttons need to have a Text widget as child, and it is this widget to which you pass the level names, one for each name in the array. When clicking on a button, you extract the Text and pass that to the Open Level node to load the map.
There really are several ways to do something like that, but you’d need to give more information if you wanted to go into details.
And the problem is that we don’t know how to unlock the next level without +1 logic, you know “current level is 1, unlock next one 2 (+1), and so on”. How can that be accomplished with names or letters?
Hey AG you could look at using a save state actor containing arrays for the whole unlock idea. Assuming your game is unlocked in series by completing the last level you could use the index number from the array of level names for this. To get the unlock you’d have a variable that saves the name of the last completed level, set on level complete. Then your save state would use a find to get the index of that level in your array and use a get +1 to unlock the next level in the array.
so:
save game>.Stores text of last completed variable
Menu>checks save game for last completed level. Find>>Foundindex+1>>next level unlocked.
I’m not at my work pc right now to give a decent bp example.
We have tried to implement what you suggested but cannot seem to get it to work, would you be able to provide a BP example if it’s not too much trouble?