How do I make combo several different attack on the same button?

0 favourites
  • 12 posts
From the Asset Store
Combo
$10 USD
Button Combinations like in fightings, supports both keyboard and gamepads
  • Hello,

    i would like when i click for example on B on gamepad three times in a row, i would make 3 differents "combo attack" with each their own animation, its just an algorithm issue for me, i don't how to make the algorithm that do that, i see post on this but not clear for me.

    Thanks for help.

    Paul.

  • I would do it with a combination of variables and timers, so you do :

    combo - variable for tracking which move of the combo you are on

    on button pressed : start timer for 1 second, add 1 to combo

    on timer ended : set combo to 0

    /and for the animations

    on button pressed :

    if combo = 0, play attack anim 1

    if combo = 1, play attack anim 2

    if combo = 2, play attack anim 3

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • By timer you mean a time during the player can do the combo?

    its on this actions? (screenshot below):

  • It's a behaviour you can add to the player object. 'Timer' behaviour, I used 1 second as an example but of course you set your own time the player has to press the combo.

  • well it seems to works, thanks to this algo and behavior cause i didnt know this one.

    I finish this tomorrow, thanks.

  • I got a problem with the algorythm, its a three row combo attack screenshot below :

    I tried a lot of things but my problem is when the player hit the button very fast, it cut the second animation combo to go to the third so i tried to put a boolean with invert to say "if you are doing the first attack you cant do the second etc." but it make a new problem that if the player hit two times too fast the button and the first animation is not finished, it trigger only the first attack but not the second.

    I can't figured out this issue alone i guess, can somoene help me?

    I put below the event sheet of each attack if you nedd too :

    First:

    Second:

    Third:

    Thanks.

  • In your first screenshot, the code you put down make it so that attack 1 should never trigger since :

    On attack 0, you set the boolean "Attacking" to true

    When attack 0 is done, you change the comboAttackState back to 0

    So in your attack 1 conditions, you can never have comboAttackState to 1 AND not being Attacking.

    Moreover in the timer "comboStart" you do not set "Attacking" back to false either.

    And same for Attack 2.

    From what I read from this code, conditions cannot logically be true and then trigger at some point.

    I'm afraid I'm not sure what exactly you are willing to achieve.

    It could be easier if you could provide a small c3p that focuses on your combo and describe exactly, step by step what you want the obj_player to be doing, how the human player can interact and what are the consequences you want from those interactions.

    Then it will be easier to clearly establish a "screenplay" of what is to happen and "translate" it to the event system.

  • "On attack 0, you set the boolean "Attacking" to true

    When attack 0 is done, you change the comboAttackState back to 0"

    the comboAttackState is back to 0 when the timer of 1.5 sec is finished, the idea is to let 1.5 seconds to the player to trigger the three attack combo.

    "So in your attack 1 conditions, you can never have comboAttackState to 1 AND not being Attacking"

    it is triggerring cause you have 1.5 secondes to do it, (i tested)

    "And same for Attack 2."

    Same that the attack 1 if u do all in 1.5 sec, its works.

    "I'm afraid I'm not sure what exactly you are willing to achieve."

    what i want to do is pretty simple:

    in a time of 1 second more or less:

    press X : first animation attack

    press second time X: second animation attack

    press third time X: second animation attack

    I will do a c3p file yes focus only on this animations and system, then you can try by yourself

  • Here the project with only the event sheet open you need to see, can maybe help you to help me :).

    https://www.dropbox.com/home

  • Hi Vanelloppe18, why don't you answer me?

    You wanted to help me and nothing left, I find it a lack of respect for your part!

  • Sorry man, i didnt have time to answer you, i send you a mail soon

  • Finally i found the solution by myself, here the screnshot for ppl interested:

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)