The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Tutorials and Eventing => Topic started by: Yawgmothsbud on April 30, 2007, 10:37:46 PM

Title: [RESOLVED] Switching characters
Post by: Yawgmothsbud on April 30, 2007, 10:37:46 PM
What's the easiest way to assign a specific function to a key press? Example: Press z (at any time) changes character graphic.
I've been experimenting with common events, but I can't get it to work. Anyone?
Title: Re: Switching characters
Post by: :) on April 30, 2007, 10:43:24 PM
what's the problem with it?

in common event use a contditional branch = button imput
<>Set Change actor graphic: _________
Title: Re: Switching characters
Post by: Yawgmothsbud on April 30, 2007, 10:51:10 PM
Thats the first thing I tried...and it doesnt do anything  :-[ I have no idea why not.
Title: Re: Switching characters
Post by: Kokowam on April 30, 2007, 10:52:29 PM
What the... Mind showing us the page of the event?
Title: Re: Switching characters
Post by: Yawgmothsbud on April 30, 2007, 10:53:43 PM
Ok, Wtf...I started pressing keys randomely and "D" activated it...why on earth does 'D' = 'Z'???
Title: Re: Switching characters
Post by: Kokowam on April 30, 2007, 10:54:40 PM
Because, it's the game settings. You change what button equals what. Your enter button/spacebar is actually "C." I guess this is resolved!
Title: Re: Switching characters
Post by: Yawgmothsbud on April 30, 2007, 10:57:08 PM
Two more questions, actually  ;D

1. How can I access these settings? (I've never seen them)

2. How can I set it up so that press z changes char, z again goes to next char, etc. until a final z returns to main char? I tried using a loop and it froze  :-[
Title: Re: Switching characters
Post by: :) on April 30, 2007, 11:00:31 PM
1 = F1
Title: Re: Switching characters
Post by: Yawgmothsbud on April 30, 2007, 11:08:32 PM
ok, got the first one down...now how about #2? Jump to label freezes the game as well...
Title: Re: Switching characters
Post by: :) on April 30, 2007, 11:10:04 PM
ok condtional branche with varible

after he presses it once add +1 to a varible

NOW have dontional branch varible = 1
                      Condtional brnach = button imput
                               Change actor grapphic.
Title: Re: Switching characters
Post by: Yawgmothsbud on April 30, 2007, 11:16:54 PM
zomg..it almost works...except that when I have it add + 1 (constant) to the variable, it adds a random number instead. Yes, i am POSITIVE that it's set to + 1 CONSTANT. Why is it doing this? :o

EDIT: accidentally had my char X value as one of the variables Duh. But after changing that, now it doesnt work at all! this just isnt my day  :'(
Title: Re: Switching characters
Post by: :) on April 30, 2007, 11:21:40 PM
after button imput on the first one put wait 2 frames
Title: Re: Switching characters
Post by: Yawgmothsbud on April 30, 2007, 11:32:37 PM
ok, this is what i have...anyone know how to make it work?

Shit, nothing is working for me today...couldnt get the image to show so heres the link...

http://img82.imageshack.us/my.php?image=helpploxit9.png
Title: Re: Switching characters
Post by: :) on April 30, 2007, 11:35:35 PM
what happens wrong? also put the varible change after the cange graphic and lower 5 frames to 2 or 3
Title: Re: Switching characters
Post by: Yawgmothsbud on April 30, 2007, 11:40:44 PM
Made those changes, but now pressing z (d actually  :)) flashes through character 2 and stops on char 3...

EDIT: however long you hold D, it flashes through the three chars and stops switching when you let go...how can i get it to be one press, one char switch...(and why does how long you hold the key matter???)
Title: Re: Switching characters
Post by: :) on April 30, 2007, 11:55:41 PM
ok change it back to 5 move it under (Unless you already did)

no...

change all the conditional branches out of the main one. put each in it's own.
Title: Re: Switching characters
Post by: Kokowam on April 30, 2007, 11:58:15 PM
Yeah. Well, make the first conditional branch the "if Z is pressed" and then make the other conditional branches separately in the first conditional (Z press check) branch. Make sense? I think this is how it should be done.
Title: Re: Switching characters
Post by: DrHojo on May 07, 2007, 05:44:17 PM
Quote from: Nouman on April 30, 2007, 10:43:24 PM
what's the problem with it?

in common event use a contditional branch = button imput
<>Set Change actor graphic: _________

What Is Button Imput And What Do You Mean
Title: Re: [RESOLVED] Switching characters
Post by: Yawgmothsbud on May 07, 2007, 07:15:49 PM
He meant button INput. Basically it does something if you press the specified key. Please dont post in resolved topics unless you have something relevant to add.
Title: Re: [RESOLVED] Switching characters
Post by: Kokowam on May 07, 2007, 07:16:59 PM
You should be able to tell that imput = input by looking at the keyboard or with plain common knowledge. :P And I know that you didn't post when this was resolved so... It's resolved! And he meant that he should use that.

Sidenote: LOLZ! DrHojo made me realize all of Nouman's grammar/spelling mistakes. Work on those, Nouman! XD

EDIT: DANG YOU BEAT ME T_T Also, that was kind of relevant because it had to do with the topic. Kind of. He might have had a problem with that and wanted help on it.
Title: Re: [RESOLVED] Switching characters
Post by: Yawgmothsbud on May 07, 2007, 07:33:52 PM
Quote from: mastermoo420 on May 07, 2007, 07:16:59 PM
DANG YOU BEAT ME T_T Also, that was kind of relevant because it had to do with the topic. Kind of. He might have had a problem with that and wanted help on it.

Fair 'nuff...and yes...nouman, work on your spelling!  :tpg: (lol)