The RPG Maker Resource Kit

Other Game Creation => Other Game Making Programs => Topic started by: Doctor Professor Nikolai on December 12, 2007, 10:36:52 PM

Title: [GM] Weapons!
Post by: Doctor Professor Nikolai on December 12, 2007, 10:36:52 PM
How would I make weapons in a platformer? Like a throwing object that you need an amount for, like ammo. And a combat weapon, like a sword. Also, how would I go about making it so the monsters having certain health?
Title: Re: Weapons!
Post by: Doctor Professor Nikolai on December 15, 2007, 03:01:31 AM
No one likes me? :(
Title: Re: Weapons!
Post by: J-Crew on December 15, 2007, 08:10:44 PM
I doubt it's that people dislike you. hahaha. I'll make an example for you when I get a bit more time. My brother's home from college and he's working me like a slave on our game. I will try to help a little now though.

As for monster health. All you need to do is create a local variable and call it health or something like that. then decrease it when the monster gets hit.

For the object that you want to shoot and have ammo, you need to have a variable (generally local) that keeps count of ammo. Next, say you want it to shoot when you press the space bar. You'd go into the object properties and make an event for "key pressed" and click space. Here you should check if the variable you set for ammo is greater than zero. Next create an object for a bullet or whatever it is that you are using ammo for. In this object make how it'll move. Then go back to the player and under the "press space" event create one of the object that you made for the bullet. Next you need to go into monster objects and tell it to lower the monster health variable. Then make a check, where if the monster health variable equals zero, destroy the monster. I know it's not a very good description but I'll make an example later.

And for the combat weapon, I'll show you in the example. It's too difficult to explain.
Title: Re: Weapons!
Post by: Doctor Professor Nikolai on December 23, 2007, 05:52:56 AM
I know people like me, just using a bump because all the views and no posts  :tpg:
Title: Re: Weapons!
Post by: biohazard on January 03, 2008, 04:11:44 AM
Basically what I did for a sword, was I had when you press the attack button; shows the characters attack sprite, and creates an invisible object that isn't solid, in front of the character, and this object causes damage for any enemy touching it.  As soon as the animation is over, I had the damage object delete itself.  It worked well for me, I'm sure there is a much more efficient way, but that way is easy and simple.