Gw Temp

Menu

Tutorial - 'Crouching' by ATARI

An item about RPGMaker 2000 posted on

Blurb

ATARI shows us how to create a crouching effect in our rm2k games!

Body

Hi folks, I'm going to talk about how to make a crouching system in your rpg.

The details: This tutorial will teach you how to make your 'crouch' when they press the enter button and the arrow key they desire to move. (So they would press enter and down, they would crouch and move down). It also allows you not to move when you un-crouch, yourself under a 'crouched' area. Okay. Onto the tutorial

Things you'll need to know to use.

1. Password Command
2. Fork Option
3. Switches
4. Variables

Okay, the first and most important step is making character sets of your hero crouching. All you have to do is make you character crawl. Basically you take the 'facing up' character set, rotated to different directions and have moving arms. You'll have to do it yourself or get someone else to do it for you. Once your done with that, it's time for the coding to make the crouching system start working.

First thing you want to do is open RM2K. Then you want to make your variables and switiches. For this tutorial, you'll need to make 2 variables. On called 'Enter Case' and the other called 'Arrow Case.' Then make two switches. One called 'Crouched' and the other 'Uncrouched.' When you done, the next thing you want to do is open your database. (F8) and go into your common events tabs. Make a new common events tab. Call it 'Crouching,' make it a parrell process. No start conditions switch. Now the first thing you want to is add a set password commmand in. So select the set password command, choose variable, 'Enter Case', and set it's "input passable key" as 5. Do NOT check the wait until key is hit button. Beneath that, make a new set password event. Choose variable "Arrow Case" and then select the 1,2,3,4 check. Do NOT check the wait until key is hit button. Hit apply.

Now beneath the two passsword events, make a new fork option. Make the fork option a "If variable 'Enter Case' is set to 5," no else casethen below that, make another fork option that says "If variable 'Arrow Case' is set to 1," make an else case, then below these two fork option, make a move event option. In it, change the hero's graphics to your crouched graphics. Then turn on switch 'crouched' and turn off switch 'uncrouched.' Easy enough? Now under the else case, do the same thing, except make the 'arrow case' variable 2,' then under the next, make it 3 and then the next make it 4. Hit apply.

Now under the very last else case, make a new move event option. In it return your characters graphics to the normal graphics, turn off switch 'crouched' and turn on switch 'uncrouched.' The code should look something like this.

Enter Password [xxx:Enter Case]
Enter Password [xxx:Arrow Case]
Fork Option: Varbl[xxx:Enter Case]- 5
Fork Option: Varbl[xxx:Arrow Case]- 1
Move Event...: Hero, Change Graphic
Change Switch : [xxx:Crouched] - ON set
Change Switch : [xxx: Uncrouched] - OFF set
<>
ELSE CASE:
Move Event...: Hero, Change Graphic
Change Switch : [xxx:Crouched] OFF set
Change Switch : [xxx: Uncrouched] ON Set
<>
END CASE:
<>
(I don't have the other else cases because all you really do is just change the value in the 'arrow case' fork option.)

Ok, you've got the coding part working. Hit apply and exit the database.

Now go upon a map, and make a place that you would want your hero to crouch under and such to get through. (Don't forget you can move when you crouch, as long as you have enter held down). So on that place, make a new event on top of it, make it the default pink event color. (So it's invisible in the game.) Make it's event conditions switch 'crouched.' Make it a push key event. Set it's position as 'below hero.' Simple enough. Click apply and make a new page. In here make the event conditions switch 'uncrouched.' Set it as a push key and the same graphic. Set it's position as 'Same Level As Hero.' Whayha! That's all you need for the crouching area event. Just copy and paste that on all the tiles you want your hero to crouch through to get to somewhere, or something.

Thats pretty much all there is to it. It's pretty easy.

Good Luck!
Remember,
"Even the greatest gamers were n00bs."
ATARI