Multiple attacks combo

Hi to everyone. I’m new here.

If I have make a wrong question please sorry, or if isn’t in the sub-forum that have to be…

The question is, how can I do a multiple attack combo (of 3)? There are any example somewhere?

Thanks a lot

you press X + X + Y.

:roll:

I mean how to program it

Lol, very descriptive.

Anywho, I would do it with a time based function. Have it when you press x it starts a timer that ends in 1.3 seconds for example and if you press x before the timer ends start a different timer where you can press a different button for another attack.

I can’t code this being a newbie but that is basically how you do it.

Thanks a lot.

I still wondering a example but now I have something to start.

Actually, I have 2 types of copmbo homescripts :

  1. tap type : As Killer mentionned, a routine is checking if the button pressed belongs to a tap sequence. Each tap sequence has its own delay tolerance, during which pressing the next sequence button will trigger the move, or continue the sequence.

(code is simple, you just have to store each sequence progression in an array / hashtable)

If the wrong button is pressed, sequence is lost and reset to its beginning.

  1. The real classic combo : No use to check that delay between 2 buttons with classic combos, as basically, a combo is triggering another action just during the time you are hitting someone.
    So I just check if a button is pressed when a hit is confirmed, and then map it to the matching combo.

Huhh … Attaaaaa !

hum hum

more thanks a lot XD

Now I have to see if I can do it :expressionless:

Ok, I’m not sure about this, but I think what you mean is not
down + forward + button1
but instead
button1, button1, button1
character does, slash, backward slash,stab… or something

So, assuming I’m right, here goes. Its a bit complicated.
First, you have to plan for the combo while creating your character. Each motion must be built in to the model, and at the end of each motion is a pose, which also must be part of the model. You also need a resting pose, which actually should be a resting animation that consists of breathing, scratching, etc. There are two ways you can do this.

  1. character returns to resting pose after each attack. You can avoid needing multiple poses this way, provided returning to rest is built into the attack.
  2. character holds his pose and starts from that pose when he launches the next attack, which is how I would do it.

You will use a clamp type animation for your attacks, unless you go with method 1.
There must be an animation from each ending pose that returns the character to the resting pose. I typically use a naming convention that ends up like : RetPos1, RetPos2…

Okay, so when you push the button, the script says “Pos0 = false, Attacking = true, run attack one animation, attacking = false, Pos1 = true.” this launches the first attack, character starts in resting pose (or Pos0), slashes, and ends up holding his sword on the opposite side of his body. (sword in right hand, but held to the left of the body.) This is pose 1 or Pos1.
now the clamping animation will cause him to stay in that pose.

With me still? I hope so cause I’m not sure I’m still with me. :shock: LOL

Anyway, this is where it gets tricky. The next part of the script says:
IF pos1 = true, then do this:
check to see if the button got pushed again.
if it did, pos1 = false, attacking = true, run attack 2 animation, attacking = false, pos2 = true.
Else, after 0.3 seconds, Pos1 = false, run RetPos1 (which will return from pose 1 to resting pose.), Pos0 = true.

Now then. you need to do it again for the end of attack 2

IF pos2 = true, then do this:
check to see if the button got pushed again.
If it did, pos2 = false, attacking = true, run attack 3 animation, attacking = false, pos3 = true, run RetPos3 (which will return from pose 3 to resting pose.)
Else, after 0.3 seconds, Pos2 = false, run RetPos2 (which will return from pose 2 to resting pose.), Pos0 = true.

WHEW!
Ok, this is pseudocode, so you will have to look up the individual commands yourself. (If I were going to write the actual code, I’d be doing it for my own game.) The 0.3 second delay is great for testing, but for actual gameplay, I would suggest a 0.2 second delay to keep the button mashing pretty fast to keep the combo up. (Yes, a 0.1 second difference is noticeable when it comes down to gameplay. The idea is fast combat. In a real sword fight, it would be more like a 0.15 second delay.)
Also, If you make the attack 3 into attack 1, and adjust the code accordingly, you can have an unlimited series of slash,backslash attacks, or left punch, right punch combos, whatever.

Now then, if you are using method 1 instead of the pose method, you need states instead of poses, and its a bit simpler, as we have already returned to rest after each strike. It goes something like this.

IF button1 is pushed
if state = 0, run attack 1, state = 1
if state = 1, run attack 2, state = 2
if state = 2, run attack 3, state = 0

This is not as smooth (A good deal of jitter if its a fast paced battle system), and doesn’t look nearly as good, but it is a great deal simpler. Again, you can loop the sequence for unlimited strikes.

Both methods become exponentially more complex if you have different buttons for different types of attacks (like in soul calibur, where you have a horizontal attack, a vertical attack, and a kick, all of which are interchangeable in the combo. They do use this basic method in that series.)
Good luck, and have fun! I hope this helps someone, even if its not what you’re personally looking for.
After that, I just gotta say… 8)

wow!!! yes I mind button+button+button.

Thanks a lot

Actually, the character shouldn’t start from resting pose between each combo move, because it wouldn’t be a combo (= chained on hit) attack anymore :wink:

You’ll have to start each chained move with its previous combo move hit frame.
Move1 : Hit1 → move2 : hit2 → move3.

Moreover, this also means you will have to predict that player won’t necessarly succed in performing that combo.
So each of its move will have to be animated till the end, past the hit.

Well, I was trying to keep it basic. With a complex problem like this, its hard to keep it basic.
Also, just because I miss with one move, doesn’t necessarily mean I’m not going to immediately execute the next move in the technique. I was thinking from a martial arts standpoint as opposed to a mortal kombat one. Also, I used soul calibur as my example, and in that game, you don’t have to connect to keep the technique going.
Good luck and happy gaming!
:slight_smile:

True, that’s another style of combo ^^

Yea, you have a point about the starting pose. It isn’t really a solution for a combo, its more like just a way to keep the character from doing the same move every time you hit the button. It adds a certain level of realism but is more effective in an rpg type system. In a real time combat system I would definitely use method 1 even though its more complex. If the code is good, it should run pretty smoothly.