ID:272419
Jul 4 2008, 11:26 am
|
|
How would I make it so that when I press two keys at once it activates a special move. for example. If I press Up and 7 at the same time I would do a smash attack that hits up, and when I only use 7 it just does a normal attack that hits sideways.
|
In response to Kaioken
|
|
What's the XYZ combo supposed to be, I got an error, src.XYZCombo: undefined proc.
|
In response to Element Hero creator
|
|
Y'know, that kind of response makes me wonder, "why bother?".
It's supposed to be, DON'T DIRECTLY COPY MY CODE especially when you clearly have no idea how it's supposed to work. My code was not meant to be used, and parts were intentionally left unoptimized/incomplete on purpose because the purpose of posting it was to demonstrate how to do this, not for you to copy it and expect it to work in your game. What's the XYZ combo supposed to be, I got an error, src.XYZCombo: undefined proc. But gee, I don't know what it could possibly be. It especially can't be similar to the purpose of the Punch() and Kick() procs in my code that I wasn't even aware or cared that existed in your game, hmm... |
In response to Kaioken
|
|
Sorry about that, I thought that it was listed somewhere in your code, then I posted about, like 2 minutes later I noticed that I had to program the XYZCombo to what I wanted it to do. That was my bad, sorry.
Anyways, I was wondering.. client Where it lists the Normal-Attack, and Special-Attack, is it right for me to name it as that, because that's the way I set up the macro's for it. |
In response to Element Hero creator
|
|
No, it isn't. That would probably make the game, or possibly even the host's PC, freeze whenever a player completed a combo, and get stuck in an infinite loop.
|
In response to Kaioken
|
|
Then what do I list there?
|
In response to Element Hero creator
|
|
In response to Glarfugus
|
|
K, after I finish this quest on RuneScape.
|
Untested (and I'm tired), but that should work. Your macros' commands would be:
<code>.key "punch" .key "kick"</code>
For example. Note it'd be better to use number key IDs instead of strings! You can employ #defines to still be able to name them in your DM code. Other things the above code should have used but I have changed for clarity, is use the && operator, and ensure the list of keys is actually long (lenghty) enough to contain enough keys to possibly score a combo, before checking if any combo was scored.
Something different you also need to do is implement a flexible dynamic system for checking for scored combos instead of the messy example I did.
*: Also, it seems to me it would be highly convenient to use a string instead of a list here to store the pressed_buttons; you could automatically check for any given combo by a simple findtext() call. If you're not sure how to store this kind of data in a list, look up params2text() and list2params(), they should enlighten you.
EDIT: Tweaked code