HELP... (XP)

Posts

Pages: 1
I just can't seem to figure out how to use a button to make my character jump in a certain direction when pressed... this sounds like such a stupid question from here, oh well. Help please?
It is not a stupid question. Anyway, here is one way to do it VERY basically.

First of all you need two events, one a common event, one a map event. Make the map event a parallel process that activates some switch (you can do this in any event really, it marks when the jumping is allowed) Then make a common event, paralell process, conditional to that switch. Use the event code Button Input Processing and assign it to a variable. Right after it, make a conditional branch for when that same variable is equal to some value (will explain in a moment) and make no else handler. Now, make 4 more conditionals inside that one, each separate with no else handler, for when the player faces a certain direction. In each conditional, set a move route for the player, use the Jump command, and the direction for which you want it to go (Ex: A set move route that says Jump -2 X will jump 2 to the left, and a Jump -2 Y will jump 2 up).

Now as for the first conditional, that value depends on the button you want used. Here is the key:

11: Shift/Z
14: A
15: S
16: D
17: Q
18: W

If you need me to be more specific on anything please let me know.
My history teacher always said that the only stupid questions are the ones you don't ask. He's right!

Besides, I had no idea how to do this--but then again, I suck at programming.
Thanks a bunch, I think I screwed up somewhere, because I tried that, and I only got stuck. Maybe I forgot to do a parallel process or something...
EDIT:
But now that I tested it, it'll sometimes jump twice in any face the character is directed, and then the game will freeze once the sprite reaches the very edge of the map. =/ More help please.
To fix the freeze, set the jump move routes to "Ignore if cant move"

As for the multi-jump error, its hard to say. How often does it do it? If it always does it, then it gets caught in a short loop probably and thats usually a mismatch of switches or variables. If sometimes, I dont know. If thats the case, post the code exactly as you put it in RMXP, and I will fix it.
WIP
I'm not comfortable with any idea that can't be expressed in the form of men's jewelry
11363
The preferred method would be to alter the game's code. It would be trivial to check for a key being pressed and then to move the character two spaces forward. Make sure that you check the destination tile to see that it isn't blocked.
It happens often enough to be a problem, but it doesn't happen EVERY time. I'm doing the jump testing on a completely blank map. And... I don't know how to code at this point in time, so... I don't think that works out too well for me.
Ok, this will fix it.

Add a label at the start of the common event code. Then, in each conditional, after the move route command set the variable keyed to the button to 0, and jump to the label.

that works. Tested just for you.
Okay... I'm... getting a bit confused here. Could you give me the exact coding that you used for this?

Yeah... I'm horrible at this right now. I suppose that's what the learning process is for.

EDIT: Nevermind, I did some problem solving, and I finally figured out an alternative that I think is much easier. After the jump move route, just have the coding command it to wait for just a few frames, I set it to 3. That way, when you just hit the key once, it won't keep doing it! The whole label thing you tried to explain to me confused me anyways. (Plus, I managed to obtain something that I had hoped to do anyway, make it only available after the said skill had actually been learned. Hurray!)
Pages: 1