Gw Temp

Menu

Tutorial - 'Platformer System' by ATARI

An item about RPGMaker 2000 posted on

Blurb

ATARI's going to talk about how to make a platforming system for an RPG. This tutorial is not for newbies to the rm2k system.

Body

Hi folks. It's ATARI again. This time I'm going to talk about how to make a platforming system for an RPG. This tutorial is not for newbies to the rm2k system.

Things you will need to know for this tutorial
1. Variables
2. Enter Password Commands (There is a LOT of these)
3. Fork Options
4. Switches
5. Pictures
6. Set up event Position command
7. MsPaint or some other graphic making program you can use.

Things that will be included in this tutorial
1. Basic Enemies
2. Coins
3. Weapons
4. Jumping
5. Falling And Dying
6. Regular Dying
7. In Game Menu
8. Lives


Okay, first off you all should know what a platformer system is. If you don't go out and play one. (There are plenty of free downloads of platformers on the interent. A couple even at GW. :D) First of all, there will be two weapons that we will use in our platforming system. A gun and a sword. Okay. The first thing we are going to create is the gun. Before we can go any farther though, we are going to make a whole lot of pictures. Okay, the
first picture we want to make is a health bar. Make a box, (size should be about 90 width, 50 height). At the top of the box, put the words "Health Bar." Below it then, have 4 small boxes, one on the left corner below the text, set it's color to red, save the picture in your game's picture folder as "healthbar-almost dead" the next one beside it, color should be orange, save as "healthbar-warning" then another beside that, color should be blue, save as "healthbar_barelydamaged"the next beside that one and the color should be beautiful green. Save it
under your games picture folder as "Full Health bar." Yes yes. Now erase all those blocks, and then save it as "Healthbar_Dead."

Next, make another picuture. Make it's size about 50x50. Make the backround color a transparent color for rm2k. Now make a circle that looks like a coin. Save the picture as "CoinBar_Coin." Make a new picture. Set it's size to 50 x 50 as well with the same backround color. Put the following text it. "0" Save as "CoinBar_0." Do that same again, except change the text to "1" and save it as "CoinBar_1" Contiune doing this, until you get up
to 9. Now make yet another picture. 50 x 50 with backround color. Put a big X in the middle. Save it as "CoinBar_X." This is all the pictures that you need for now.

Now go into your game. (You'll probably want a new game and such) Make a new map. This will be our testing map. Make it's size a wonderfully beautiful 40 x 15. (40width and 15 height. When you actually make your first map, keep the 15 the same, but change the 40 to however long you want your platformer to be."

Now look at the following diagram to see where to put the chipsets
-----------------------------
xbbbbbbbbbbbbbbbbbbb
xbbbbbbbbbbbbbbbbbbb
xbbbbbbbbbbbbbbbbbbb
xbbbbbbbbbbbbbbbbbbb
xbbbbbbbbbbbbbbbbbbb
xbbbbbbbbbbbbbbbbbbb
xbbbbbbbbbbbbbbbbbbb
xggggggggggggggggggg
xggggggggggggggggggg
xwwwwwwwwwwwwwwwwwww
xwwwwwwwwwwwwwwwwwww
xwwwwwwwwwwwwwwwwwww
xwwwwwwwwwwwwwwwwwww
xwwwwwwwwwwwwwwwwwww
xwwwwwwwwwwwwwwwwwww
-----------------------------
Now this is the key.
X = If you count up the verticle side of your map, you get fiften upward tiles, or X.
W = Wall, cliff. The cliff chipset or wall chipset you want your heroes moving place to be held up by.
G = ground. The moveable ground for your hero.
B = the pink part of the chipset, the parrlax backround. Set it to whatever you want to make the backround seem more real and such. Now you have your map made, let's move on.

The first we are going to make is our gun. How do we do that? It’s quite simple. The first thing you need to do is make a new event. A blank event. Call it the event “Gun’s bullets.” Set it’s event conditions to “On Hero Touch.” and position “Over hero.” Set movement type to “by it’s route.” Set it’s route to, move forward and repeat action. That is all you need here. Make sure the bullet event is secluded from the rest of the map, like
somewhere on the wall or in the backround, but not anywheren near the ground. Now make a new event, right beside it. Call it “Shooting.” Set it to parrell process. Movement type is stay still. Position below hero. Now in the event commands, make a new enter passoword event. Use variable “TriggerPress.” Set it to 5 and do not have wait until key is hit checked. Hit ok. Below it, make a new fork option that would say, “If variable “Trigger
Press” would be equal to five. (Code would look like: FORK Optn:Varbl[xxxx:TriggerPress]-5. X = number of variable.) Now below that fork option, make another fork. This fork is a little bit harder to do. Choose variable, and choose the variable, “Bullet_amount.” It’s set is 0, and in the drop box, choose bigger. Hit Ok. (Code would
look like: FORK Optn:Varbl:[xxxx:Bullet_amount]-0 more than). (all forks in this part should have no else cases by the way) Then the next thing you want do is set the memory place using variables, “BulletID,” “BulletX” and “BulletY.” (This is under the last fork option.) Then set up event place for “Gun’s Bullets” using variables “BulletX” and “BulletY.” Under that create fork option that says “If hero is facing right.” Underneath
that move event, bullet, face right, change it’s graphics to a bullet graphic. Then insert 12 move speed up commands. Below have 12 move event movement freq. up commands. Check neither “repeat action” and “ignore if can’t be moved.” Now under the following end case, do that same, except it’s fork would face left, and
change the “face right.” in the bullet moving command to “face left.” Under the next end case, have the fork if hero is facing up. Put nothing. Do the same for down. Why this? You only have left and right in a platformer. Okay. Under then next end case, play sound effect: whatever, (I’d say your best with Thunder5), flash the screen whatever flash color you want, just make the duration 0.5sec. (no wait) change variable “Bullet_amount” minus one. Change variable “TriggerPress” to zero. Now save and test out this shooting system. Now why
does nothing come? Make an event beside your hero that gives you +500 to variable “Bulett_amount.” Now try it. It should work. Congradulations. You have sucesfully completed making your gun system.

Now it’s time to make a sword. First, make an event. Call it “Sword.” Put it besdie the gun’s bullet even, out of reach. Make it the same details as “Gun’s bullets,” except the name, and it’s movement type is stay still. Make another new event. Call it sword attack. The first thing we want to do, again, is make a new enter password
event. Use variable, “SwordSwipe.” Choose 5 again, and again do not check the wait until key is hit option
either. Now below that, make a new fork option that says “If variable ‘swordswipe’ is equal to 5, then” below it, have another fork that says “If switch “Sword” is on, then” under that, turn on switch “sword attack.” Then set a memory place using variables, “SwordID,” “SwordX” and “SwordY.” Then, set up event position using
“SwordX” and “SwordY.” Then under that, make a fork that says, “If hero is facing up,” Then have the sword face up, and change graphics to a sword slash character set. Hit ok. And then make another fork in the end case below for down, left, and right. (Changing the facing position thing of course.) Now in the next end case, play sound effect, sword1, wait 0.7seconds, and then turn off switch “Sword.” Change the graphics of sword back to the blank graphics, and set it’s event position to where it previously was. (Which should be out of reach,
right beside the gun’s bullet event.)

That was easy enough. Now it’s time to make the system of being able to choose between the sword and the gun. How do we do this? Well, since the regular RM2K menu doesn’t work with a platformer system, we’ll have to make our own. Now a teleportable menu, but a picture menu, a menu that shows up where you are, not
some place you have to teleport. How do you do that? Well read on and find out!! :D

The first thing we need to do, before we can do anything more, is to make some more pictures. Save and close your game. Now go into your MsPaint, or whatever program you are using. Make a new picture. Set it’s attributes to 75 x 75. Make a picture of a gun in it. Save as “Gun.” Next make another 75 x 75 picture, this time with a sword in the picture. Save as “Sword.” Now make a 90 x 90 picture. Make it a yellow frame. Save
as “NotSelected.” Change the yellow to red, save it as “Selected.” Now then make a 24x32 picture. This time, make it a cursor, pointing to the right. Next, make a 75 x 40 picture with the words, “EXIT.” (Save as EXIT)
Another with the words, “RETURN.” (Save as “RETURN”) another with the words “WEAPONS,” (save as WEAPONS) and “SAVE” (save as SAVE.:) Now what they do is pretty simple. RETURN returns you to the game, EXIT quits the game, WEAPONS lets you choose between the sword and gun, (and any other weapon you may want to switch between) and SAVE saves the game. That part is pretty self explanitory.

Now go into your map again. Make a new event. Set it to parrell process. The position it is on the map should be somewhere out of reach. (Wall or backround) Graphics should be blank. Name the event, Menu Event. The first thing you want to do in this event is make a new enter password event. Set it to 6, and the variable that it
enters is “Menu.” Now make another fork option under that that says “If variable ‘menu’ equals 6, then” stop all. (Stops everything.) Set the screen tone to grey. Set the time it takes to 0.1 seconds, wait while doing.
Then show the pictures “RETURN,” “SAVE,” “WEAPONS,” and “EXIT.” On the top left side, one below the next.
(You’ll have to find the positions on your own.) Then display the cursour right beside the “RETURN” picture. Then beneath this, wait 1.0 seconds. Next thing, make another enter password event. Choose variable “Cursor_move.” Your picutres should about match this diagram

xR <-
xS
xW
xE
x
x
x
x
x
x
x
x
x
x
x
--------------------------

X = the same thing it did on the previous diagram that was similar to this one
R = Return
S = Save
W = Weapons
E = Exit
<- = Cursor

Simple enough? Good. Now back to that enter password command. Select 1,2,3,4 option. Do not check the wait until key is hit option. Now below that, make another fork option. The first one should be, “IF variable
‘cursor_move’ is equal to 1, then” (1 is equal to down) then next have a fork under that that is, “If variable ‘cursor_choice’ is 0,” then move down to the save option. Add 1 to variable ‘cursor_choice’. Beneath that, have
the same forks except the seconds one is, “if variable ‘cursor_choice’ is 1,” then move it down to weapons add one to variable “cursor_choice.” Do the same for 2, (moves down to exit and then adds another 1 to “cursor_move) Now when it is three, it is a little different. Make a fork option that says, “If variable ‘cursor_move’ is equal to 1, then” and then “If variable ‘cursor_choice’ is equal to 3, then,” make it play sound effect “cancel 1.” and do nothing. You can go down any farther. Now below that fork option things. Make a
fork that says, “If variable ‘cursor_move’ is 2, then” play that sound effect. Make another below that for 3. Now for 4, it is a little different. 4 is up. Make a fork that says, “If variable ‘cursor_move’ is equal to 4, then” below that make a fork that says, “if variable cursor_choice’ is equal to 3, then” move the cursor picture up to weapons. Minus 1 from “cursor_choice. Do the same for when “cursor_choice tis 2, (moves to save) and 1
(moves to return) when it is equal to 0, make it play the sound effect. Hit ok. Now make another parrell
process event. Easy enough. Now go into your common events tab, make a new common event. Call it menu. Make it a parrell process. In it, disable the system menu. Simple enough. Hit ok. Try out your menu. You can do any choices or exit it, but try out the movement.

IMPORTANT: For all the move picutres event, set the time to 1.0 seconds and wait while it is being done.
Thankyou.

Okay, now it’s time to make those choices DO something! Okay, make yet ANOTHER parrell process event on the map. Call it “menu choices.” Now the first thing you want to do, is create another new enter password event. (Hey, I said there are a lot of enter password commands in this tutorial. :D) Make it use variable, “Menu_choice_select.” Set it 5, do not check the wait until key is hit option. Now make a fork under that. The
first one should be “If variable ‘cursor_choice’ is equal to 0” (return) then under that, make the screen go back to normal color, erase all pictures, move all and set all the passwords used in the menu to 0. Easy enough.
Make another fork for when it is 1. (save) make it call up the save menu. Then do all the stuff under the return case. Make a fork for when it is 2, (weapons). We will deal with what that does later. Make one for 3 (exit) make it go to the title screen. Easy enough? Okay. Now let us deal with the weapons case.

Under the weapons case, the first thing you want to do is erase the all the picutures that are displayed, then whip out the weapons pictures. Put the gun with the coordinates for the top left corner, then put the non-selected box picture around it. Do the same for the sword, beside the gun. Now beside the sword, just put a non selected box there. You’ll see what that is for later when we get to jumping. Then at the bottom of the screen, put the “Return” picture there. Turn on switch “weapons.” On all the password event, make a new page on each on, set there starting switch to “weapons.” Set them to push key. That nulliflies everything they did when you go onto the weapons page. Okay. Now it’s time to make our enter password things again for this part
of the menu. :D. Okay. Make a new event. Make it a ‘parrell process.’ Call it “Movements.” The first thing that you want to put in it is a new enter password event. Choose varaible “Weapon_move.” Choose the selections of 1,2,3,4 and do not check wait until key is hit as usual. Now below that, make a fork option. Have it say, “If variable ‘Weapon_move’ is equal to 1, then” (1 is down) we will deal here later .Go udner the else case. Next fork is 2. (which is left) “If variable ‘weapon_move is equal to 1, then” we will deal with this fork later. Go to
the next else case and make a fork that says “If variable ‘weapon_move is equal to 3, then” (3 is right) deal here later too. Next is four, do the stuff for 4. (We will deal with this later too.) Now lets go to our 1 fork. Below the fork option, make it move the cursor to the return picture. Change the variable “Curs_wep_pos” to 4.
Now under the 2 fork option, make another fork under it that says, “If variable ‘curs_wep_pos’ is equal to 0, then” have it play a sound effect and do nothing. Under that fork option’s else case, have “If variable ‘curs_wep_pos’ is equal to 1, then,” have the cursor picture move over to the first weapon choice. Then change variable ‘curs_wep_pos’ to 0. Okay. Under that fork’s else case, have “If variable ‘curs_wep_pos’ is equal to 2,
then” move the cursor picture over to the 2nd weapon choice. Set the variable “curs_wep_pos’ to 1. Do yet again, another fork under that fork’s else case. Thats all you need here. Next with the fork option that says, “If weapon_move is equal to 3, then” below that fork option, have a fork that says “If variable ‘curs_wep_pos’ is
equal to 0, then” move the cursor picutre over to the second weapon. Add 1 to the variable “curs_wep_pos.”
Next make a fork in that fork’s else case with the variable of ‘curs_wep_pos’ equalling to 1. Make it move to the 3rd weapon picutre. Add 1 to the variable “curs_wep_pos.” Thats all you need here. Now go under the fork that has “If variable ‘weapon_move’ is equal to 4, then” (4 is equal to up) then have the curosor picture move to
the unarmed picture, and change the variable ‘curs_wep_pos’ to 2.

Okay, now make another parrell process with the same starting switch and event propirties. Make a new enter password command. This time select the 5 and choose variable “Weapon_selection.” Now make a fork option under the enter password command that says, “If variable ‘weapon_select’ is equal to 5, then” and under that have another fork option that says “If variable ‘curs_wep_pos’ is equal to 0, then” turn on switch, “Gun.” Turn
off switches, “Sword” and “Jump.” Show the picture of the “selected” frame over the unselected frame picture. Wait 2.0 seconds, return screen to normal tone, move all, erase all pictures, and turn onff switch “weapons.” In that fork’s else case, have the same fork option, except that “curs_wep_pos” is equal to 1. Then turn on the switch “Sword,” and off with “Gun” and “jump.” Do the rest of that as the same as the one before it. Have
another fork in that fork’s else case that has it equally to 2. Then turn off switches “Gun” and “Sword” and on with the switch, “Jump.” Then do the rest. When it is equall to 4, do the rest (the returning back to the game
part.)

We’re not done yet!! Now first thing we want to do, is go back to our gun event. It should be a parrell process. Set it’s starting switch to “Gun.” Same thing with the sword event, except that the starting switch should be “sword,” not “Gun.” Now it’s time to make yet another event. Set it to parrell process. Beside the Sword event. Blank and out of reach. Set it’s starting switch as the switch, “Jump.” This is the event that will make your character jump in the game. Okay. Make ANOTHER enter password event. (there is whole ton of these)
make it use variable, “Jump.” Now make a fork option below it, that says “If variable ‘jump’ is equal to 5, then” make a new move event command. Have in it, start jump, move forward, move forward, end jump. That is all you need to make your character jump. Congradulations. Now it is time to move on to making some lives and
coins for your platformer.

Now lets make a new event. Make it a parrell process. Call it “Coins.” Make it show the picutre of the coin, the x beside it. Now get ready for some major fork options. (100 of those things!) Now make the first fork option. Make it says “If variable ‘Coins’ is equal to 0, then,” have the picture 0, be displayed 3 times beside the x. Do
the same with 1, (001) 2, (002) and so on, until you get to 100. Now before we go on any farther. We need to make ourselves some more picutres. What were are going to deal with right now, is lives. So go into your painting program, make a 25 x 25 picture, have your “Lives” graphic in them. (For this tutorial our character will start out with 1 life. You get another life when you have 100 coins.) Now on the map, make an auto start event that sets variable “Life,” to 1. Then turns on switch “Lives_Auto_OFF.” Make a new page to this event. Make it’s starting switch “Lives_Auto_OFF.” and have it be a push key event with absoluetly nothing in the event commands page. Okay hit ok, and make another event. Make it a parrell process, call it the event “Life-Coins100.” Make a new fork option in there that says, “If variable ‘coins’ is greater that 100, then” have it
add 1 to the variable “Life.” and then set the variable ‘coins’ back down to 0. Easy enough? Now it’s time to make your first coin event. The details? Make it’s graphics the coin graphic that you are planning on using for your coins. Make it’s event position below hero and it’s starting is push key. Now the first thing you want to
add is a change variable, make it add one to the variable “Coins.” Then make it change it’s graphics to blank, and then start a slipthru, then make it face up and move up and out of reach. Make the conditions for the move event command, not to repeat the action, and to ignore if can’t be moved. Now you can just copy and paste
that on places on your map. Now you can go around, pick up coins and get an extra life when you get to 100 coins. You can also make 25 coin worth coins and other coins. You can also make an extra life item, which is the same, but you add 1 to variable “Life,” not “coins.” Now it’s time to make ourselves a way to die and what do about it when your character dies. Sounds evil eh? :D

The first concept of dying, is falling off. The easiest way. Now let us make a new event. Make it a parrell
process. Call it, “Life Counter.” Make a new fork that says, “If variable life is equal to 0, then,” have nothing. Make another in the else case that says, “If variable ‘life’ is equal to 1, then” have one life picutre be displayed in a corner. Do this up to 10. (If they go over, then they just don’t lose a picture when they die.) Next make a
“If variable ‘life’ is greater than 10, then” have it display nothing. Now under the next else case, make it say “If variable ‘life’ is equal to -1, then,” Woah!! Thats right. Rm2k can do negatives too. Okay, then have it after that, make it go to the game over screen. Okay, you have made the life counting system. Alright. Hit Ok. Now go back on your map, make a new event, on one of the cliff (edge) tiles. Make it start a slipstream, move
the hero down 3 times, then change graphics to blank. Wait 2.0 seconds. Then show a message that says, “you have died.” Then take away 1 from the variable “Lives.” Now then wait 4.0 seconds and teleport your character back to the starting position. Return your hero back to normal graphics.Of course, when you would copy this over to other maps, you’d have to change the position for every single map, which is less time consuming then you would think. This event should be an on hero touch event, below hero. Now copy this event all over the cliff chipset tiles. So this if the hero decides they’ll jump off the side, they’ll fall off and die. Now for the backround events, make a new event on the backround, the settings are all the same (on hero touch, below hero, blank graphics) there is some difference in what is in it though. Make it make your
characters graphics to blank, then have the rest of the stuff (starting from the wait 2.0, includes message and everything, up until the character goes back to normal graphics. So what do you then do about it when they walk off. For example, you have a place on the map the hero has to jump over, what do you do? Well, the places that the hero would land on and cause the hero to ‘fall over’ would have the cliff event on them, going down to the bottom of the map and everything. So what do you do if you have a place where your hero has to
jump over? Well, you just have the cliff falling event, on all the places that you have your hero being able to fall off and then down to the bottom. You have just accomplished the first way of dying, falling off. Now it’s time to learn how to die by injury.

Dying by injury? It’s time to learn how to make some enemies. But first, it is time to set up our health bar. Make a new blank parrell process event. Hit ok. It’s time to go back to the life setting auto start before we go on any farther. Below the life +1 variable, set variable “Health” to 4. Then have the rest blah blah. Okay. Now
back to that parrell process event we just created. Set it’s starting switch to “Lives_auto_OFF.” Okay, now make a new fork option that says, “If variable ‘health’ is equal to 4, then,” have it display the full health picture in the bottom left corner. Make a new fork under the else case for 3, have it display the 3 health picture in the
bottom corner. Do it all the way do to 1. Then for when it is 0, have it display a message that says, “You have died.” Then minus 1 from the variable “life,” and teleport back to the beggining of the map. (You have to change the position for each and every map, but as I said earlier, it’s not as time consuming as you may think.) Now it’s
time to make your first enemey.

Make a new event. Make it’s starting condition on touch (Event,hero) and have it’s graphics be the graphics of an enemey that you would like to have your first enemey be. Set the movement speed and stuff to whatever, but make sure it’s ‘by it’s route,’ otherwise things will not work. Have it to repeat the movement and ignore if can’t be moved. Easy enough? Good. Now in the event commands box, have it -1 from the variable “Health,”
and flash the character red for .4 seconds (do NOT wait during the flash). Thats all you need in here.
Congradulations!! You have your first basic enemey. I will not explain how to make your enemies like attack you with guns and such, this is only for the system itself, not the enemies. Now try out your game. Your character should die when it touches the enemey 4 times. You can make new enemies with different speeds and movement to them.

Congradulations. You have made yourself a platforming system.

Thats all there really is to it.
Good Luck,
Remember,
“Even the greatest gamers were n00bs.”
-ATARI