Comparing arrays and structures for combo system

Hi People, I have a problem with comparing data from structures with arrays…

I am trying to create a combo system, for this I am recording inputs and store them in array with index… So I have arrays such as “up(0), left(1), punch(2) …” I have also defined combo structures arrays such as hadouken “down(0), right(1), punch(2)”… But I couldnt find a way to compare those two…

Do you have any idea for this? Thank you so much!

You can compare two arrays by using For Loop With Break node.
By the way when i was implementing fighting game combo i used plugin from marketplace Input Buffer, it’s free. You can try it too.
.

Thank you for help, but this plugin doesnt work for flipbook or 2d character, or lets say somehow it doesnt work with my current blueprint system… I spent a lot of time on this plugin…

I didnt think with “get” before and compare with index… let me try…

Ok I tried and It doesnt work… It only works on first index of array then always fail. Here is my blueprint

this is your tactic;

those were my other tries

It wont work because youre adding element to the array everytime youre checking for equality. You should save your inputs in the array first outside check function and then run check

You should implement function which will save for example five last inputs in the array, and dynamically delete first element and add new key input. Also it will run check after each key press

This is macros for saving three last inputs. Check combo function is the same i provided before. For time management just clear array if n-time passed after last key stroke

Thank you very very much for your help, I appreciated… Now I am trying, it didnt work at first try but now I am checking again…

It works finally, THANK YOU my friend… really really appreciated…

You’re welcome!

So lets say if I have 3 special movement do you think I should repeat same process for all of them? Or do you think I can search this pattern inside pre-defined combo structs?

Sorry if its stupid question, just I wonder…

Hello there. I deleted last comments cause i found misleading advises from my side xD. I think the simplest(probably not the best) way will be First dynamically get input array size. When it’s for example 3 check all of your 3length sequences. If right sequence isnt found continue adding next input to the array. Check for 4 length sequence. If its wrong check again 3length input but for the last three inputs ignoring first input and so on each time you add new input to the array check all of the smaller sequences from the back of array. I advise you to look in the internet for more information about buffer system in SF like games. One more thing try to do it on the paper first and then try algorithm in UE. Also answering for your question about branching you should do it after adding new input to the array.