Download

Button Sequencing

Hey all,

I’ve been trying to make a few buttons require that they be pressed in a certain order, and hitting them out of order resets the whole thing, causing the player to start the sequence again.
Originally to help out the artist, I wanted to make it so in editor, you could place a set of buttons, their order in the sequence, and a “frequency” so it would know which set of buttons it would correlate to.
Right now to get one done, I’ve been trying to make it go through a series of Branches with true false statements, but there has to be a better way to do that, especially because I can’t get it to work with a button that needs to be hit multiple times.
So what’s the cleaner easier way to do this that I am clearly missing?

Thanks in advance!

A note, I’m still moderately new to using Blueprints.

hello,
maybe giving each button a number and create an array with the code number from o to end and do a loop comparison. Each time x value = x value then x = x+1 else back to start. or only setting a var false when one is wrong and check the var at end to reset or not, depend if you want reset when typing or at the end only.

So in doing the array, lets say the code is 4482870, I can then use a for comparison to check 1 against index 1 against the array so to speak?

Hi lumoblaze,

Have you seen this video before. This helped me get a system going

There are two parts

EDIT: Nevermind, I am a big ol dumb. I realized the for loop was never stopping, and just executed the whole thing in one go instead of on button press. So I added a For Break instead of normal For, and it fixed the issue, thank you to everybody :smiley:

So I managed to get the array comparison working, but I have a set of steps that each block does once it’s been hit in the right order. Now, when I go to use a Switch on Int, it for some odd reason activates all of them at once. For no real reason, despite having an int to compare to switch.
3a9d977842879e3a0c5cd8814f327fa394821b34.png
There is a picture of the confusion. The Switch on Int seems to fire all 4 at once even though it only has an index of 0

Today I decided I would take a look into this. I know you’ve all ready got a solution but below is any overview of what I came up with. You can define the length of a combo with a variable along with the possible combos in one nice array (custom strut). It also supports any number of key inputs. If anyone would like a tutorial let me know.

Hey I’m trying to build a system like this (with the player running around hitting buttons in a certain order and resetting on fail) and am fairly new. Could you go over this array approach quickly? The image you uploaded is broken it seems.