Gw Temp


Tutorial - 'Shooting and Hearing' by ATARI

An item about RPGMaker 2000 posted on


ATARI tells us how to make shooting system and how to make monsters here it.


Hi folks, It’s ATARI again. This time I’m going to talk about how to make your hero be able to shoot in a game, and how to make enemies be alerted when you fire.

Things you need to know for this tutorial
1. Variables
2. Password Events
3. Fork Option
4. Switches
5. Set Event Command
6. Memorize Hero Position Command

So what exactly is this tutorial? Well, this tutorial tells you how to make a firing weapon for an ABS, and how to make it alert other enemies by the “noise” if their close enough. The tutorial will be in 2 parts, in case you only want to have a firing weapon.

This the first things you need to make is a new event. Make it a on hero touch event, and over hero. Make it somewhere out where it cannot be accessed. Make it’s graphics blank. Call the event, “Bullets.” Next make another event, this time have it be a parrell process event. Call it “Shooting System.”

The first thing you want to put in the event is an enter password event. Make it use variable
“GunCmnd,” have the “Decision (5)” box checked, and do not check the “wait until key hit” box. Next, have a fork option below it that says, “IF variable ‘GunCmnd’ is equal to 5, then” (another words, check the variable box, put in variable “GunCmnd” and have the set number be 5, and it should say “same” in the drop box below.) Next, below that fork option have a fork option that says, “IF variables ‘Bullets’ is more than 0, then” (change the variable to “bullets” and set to 0, and change “same” to “bigger.”) Below that have a memorize hero position event. Use variable “MemHero_X” “MemHero_Y” and “MemHero_ID.” Below that make a new set event place command and set event “Bullets.” to Variables “MemHero_X” and “MemHero_Y.” Below that, make a fork option, that says “IF hero is facing UP, then” (On the second page select the radio button, “event,” choose “hero,” and facing “up.”) Below that fork option, make a new move event command that does the following on “Bullets.” | Face UP | Change Graphic (Change the event “bullets” graphic to a bullet) | Move Speed Up x 12 | Move Freq Up x 12 | (It doesn’t need to be x 12, but it should be something around it, so the bullet moves FAST, like a real bullet.) (You can also stick a slip-stream in there too, but it’s not as realistic.) Check the movement Freq to 8, and hit OK. Now below that last fork (in it’s end case), make a fork that says “IF hero is facing right, then” make it have the same move event, except it faces right. Do the same for the down and left forks that should follow after that. Then in the last fork’s end case, make it play shooting sound effect, flash the screen for .3 seconds (if desired), make a new variable event, and take away one from variable “Bullets” and set variable “GunCmnd” to 0. The next thing we have to do is make it damage the enemies.

Make a new event, make it a parrell process event. Call it “Bullet hit.” First, put in a new variable event that puts variable “Bullet-X” to event “Bullets’s X position” Below that, make it do variable “Bullet-Y” for event “Bullets’s Y position.” Then below that make it do a variable, “Monster1-x” for the monster event’s X coordinate your planning to test this system on, and do the same with variable “Monster1-Y.” Below that make a fork option that says, “IF variable ‘bullet-x’ is equal to ‘monster1-x’ then,” and below that “IF variable ‘bullet-y’ is equal to ‘monster1-y’ then,” make a new move event for “Bullets.” Make it’s graphic change to a blank graphic, and then make it “random direction.” Below that, set event “bullets” back to where it originally was. Play a sound effect of your monster getting hit, flash the monster for 0.3 seconds, and take one away from variable “Monster1-HP.” Then below that, have a fork option that says, “IF variable ‘Monster1-HP’ is 0 or less, then” make it change the monsters graphics by turning on switch “Monster1Dead,” play a dying monster sound effect, and flash the monster .3 seconds. On the monster, make a new page that uses switch “Monster1Dead,” and make it’s graphics of a dead monster. Have it be push key and below hero.

That’s all there is to making a shooting system. If you wish to drop out of the tutorial, you may do so, if you want to make enemies be alerted when you fire, please continue as you please with part II.

Part II

Part II will be using the same system as you used above. First make 8 events, label them each
separately, and have them all be on hero touch and over hero. Name them “Alerting 1 Left,” “Alerting 2 Left” “Alerting 1 Up,” “Alerting 2 Up” “Alerting 1 Right,” “Alerting 2 Right,” “Alerting 1 Down” “Alerting 2 Down.” You guessed it. This tutorial, the enemy will be able to here you 2 spaces away. Now right after the bullet goes to the hero’s X and Y coordinate, put all eight of those blank looking events there. Then under the “facing up” fork option, make the two alert up events go up the amount of spaces corresponding with their number. (EX: “Alerting 1 Up” goes up 1 space.) Do the same with the other “alerting” events. Copy and paste the moving events into the other facing direction fork options. Now make a new parrell process event. Call it, “Monster Detection.” Now make a new change variable event, have it set event “Alert Up 1” X coordinate to variable “AU1-X” and Y cord to variable “AU1-Y.” Do the same with all the other “alert” events as well using corresponding variable names. (EX: Alert Down 2 would be AD2-X and AD2-Y.) Then make a new fork that says, “IF variable ‘au1-x’ is equal to ‘monster1-x’ then,” make another fork below that for when “au1-y” equals “monster1-y.” Then make the monster come after you, or whatever you want the monster to do when he hears you. Then in the else case, do the same with the other events until your done. Then go back to the shooting system event, (the one that makes the bullet move, etc.) and at the end part (where it minuses one from the variable “bullets.” and etc.) Below those, use a set event command to return all the alert events back to their rightful place.

Congratulations! That is all there is to making a firing system, and to making monsters be able to hear when you fire.

Good Luck!
“Even the greatest gamers were n00bs.”