Page 1 of 3

Diffrent Event from Same Key

PostPosted: Wed Jan 21, 2009 8:45 pm
by GuybrushThreepwood
I'm making a Super Smash Bros. type game, and I can't figure out how to make a combo attack.
Anyone's help would be appreciated :mrgreen:

Re: Diffrent Event from Same Key

PostPosted: Wed Jan 21, 2009 11:26 pm
by skydereign
I suggest having a variable for each hit. This is what I did for a combo technique in the game I am making. Each consecutive attack will set the variable, usually incrementing, and depending on the variable, a different stage of the combo. You can also use this to make multiple button combos and more. I'm not sure if it is the most effective way, but it works fine for me.

Re: Diffrent Event from Same Key

PostPosted: Thu Jan 22, 2009 12:22 am
by GuybrushThreepwood
Im not much for scripting, so it'd be nice if you could make me a demo.
Thnx :mrgreen:

Re: Diffrent Event from Same Key

PostPosted: Thu Jan 22, 2009 12:25 am
by skydereign
I did a quick version while I was waiting... press f for the 'attack'. Set whatever sprites you want for the events. You should also add a ready event, so that you can't cheat out the combo by pressing the button quickly. To do this I would change the if statement to
Code: Select all
if (combo==1 && animation_finish==1)
{
   attack;
   animation_finish=0;
}

And upon an animation finish event
animation_finish=1;

You would also need to switch the timer to something higher, or you could activate the timer after the animation finishes, whichever you feel is better suited.

Re: Diffrent Event from Same Key

PostPosted: Sat Jan 24, 2009 12:47 am
by GuybrushThreepwood
Like I said before, i don't know much about scripting, so i have no idea what all of this stuff means. how about i post a couple of the combo sprites, and if you could make a demo for me with those, that would be much appreciated :mrgreen:

Tahu.rar
just some random sprites I had lying around
(5.61 KiB) Downloaded 150 times

Re: Diffrent Event from Same Key

PostPosted: Sat Jan 24, 2009 2:30 am
by skydereign
The rar you posted is empty. I'll use some of my own sprites for the demo. I have to go work right now so it will probably be done tomorrow.

Re: Diffrent Event from Same Key

PostPosted: Sat Jan 24, 2009 3:04 am
by GuybrushThreepwood
hmmm... that's wierd. i don't really know how to zip it up right.thanks all the same tho :mrgreen:

Re: Diffrent Event from Same Key

PostPosted: Sat Jan 24, 2009 11:28 am
by skydereign
Well, here it is. If you don't like the feel or timing of it, I can make it better. It gets more complex, but it is possible to make the button presses for the combo register only during certain frames. For this demo, you must press f at the end of each animation. If you have any questions feel free to ask. Oh, sorry about the sprite quality, they were from a long time ago, back when was learning how to sprite.

Re: Diffrent Event from Same Key

PostPosted: Sat Jan 24, 2009 8:08 pm
by GuybrushThreepwood
it doesn't seem to work. I even tried naming all my sprites the same as yours, and added the same scripts but it still wouldn't work. could ya help me out with this? It would be appreaciated :mrgreen:

Re: Diffrent Event from Same Key

PostPosted: Sat Jan 24, 2009 11:09 pm
by skydereign
That example requires good timing, pressing the button again after the attack is finished. Or did you mean that your implementation of the scripts did not work. Give me an example of the kind of combo you want. I may need to set up a function for your combos. That is how I did it, but that is a little more complicated. An example being, if you want to just repeatedly tap the button for rapid punches, or you need to have good timing for the combos.
-Edit
Maybe this is what you want? This allows you to tap the button repeatedly for the combo.

Re: Diffrent Event from Same Key

PostPosted: Sat Jan 24, 2009 11:47 pm
by GuybrushThreepwood
for every script a message keeps saying there are a bunch of errors in the script and i hav no idea wat they mean. could you help me out here? And that last demo was exactly what i need.

Re: Diffrent Event from Same Key

PostPosted: Sat Jan 24, 2009 11:49 pm
by skydereign
Did you add the variables that I added?

Re: Diffrent Event from Same Key

PostPosted: Sun Jan 25, 2009 6:04 am
by GuybrushThreepwood
that was the problem. Thanx a million
+1 :mrgreen:

Re: Diffrent Event from Same Key

PostPosted: Mon Jan 26, 2009 12:32 am
by GuybrushThreepwood
another little snag. my character can take out his sword and that has a combo and i want the combo to be the same button as the other combo plus each combo has a left and right. could you help me out :mrgreen:

Re: Diffrent Event from Same Key

PostPosted: Mon Jan 26, 2009 1:13 am
by skydereign
Okay, this is one way of doing it. This demo does not do the left or right, but for me to help you with that, I need to know how you are doing your game. Do you already have a directional system? How do you do left and right attacks. Assuming you do have a direction variable, you would add an if statement to the draw script.