Help - Search - Members - Calendar
Full Version: [Eventing]Super-Easy Zelda Style Battle System
RPG RPG Revolution Forums > Game Engines > RPG Maker XP Discussion > RPG Maker XP Tutorials
bulmabriefs144
The Zelda tutorial gave me an idea, and I decided to try it out. I'd still be hard pressed to how to do it with custom buttons on some of the engines, but you can save that for a common event or something.

This is absolutely scriptless, meaning you can use it in any engine. Also, unless you're using method 2, you don't even need any variables or switches!

Method 1: One Hit-Kill / Battle Screen

Set a monster event to collision with hero (or the equivalent phrasing for whatever engine you're using). Now create a condition with an else condition saying if the hero used the command button (in some engines, it will actually be on a specific button pressed). The condition should look like this.

Condition (If Action Button is Pressed)
Animation (Sword1, This Event)
Erase Event
Else
Encounter (Monster1)
Erase Event
End

That is, if you pre-empt the monster touching you, you instant kill them, otherwise a battle starts.

Method 2: Damage System

I've seen some over-coded systems in use, leading people to conclude you need some really good engine to do this sort of thing, and all sorts of X/Y screen variables. You don't (unless you're making ranged weapons).

You need two parallel map events. One sets the initial monster HP variables, and ends with Erase Event. The other sets your life, and displays some sort of hearts/meter.

Other than this, just do the same as before, except reduce monster hp (and erase when it hits 0 or less) on hit, and reduce yours if they touch you. Super easy, which kinda makes me weirded out when I see complex code for hit detection. This was really simple.
Rast
QUOTE
Other than this, just do the same as before, except reduce monster hp (and erase when it hits 0 or less) on hit, and reduce yours if they touch you. Super easy, which kinda makes me weirded out when I see complex code for hit detection. This was really simple.


That's because the complex code is for a complex ABS. This one requires you to A.) Be right next to and facing the enemy B.) Rely entirely on a 1-tile range melee weapon.

In a more complex ABS, you would need to determine the player's X and Y coordinates, as well as the enemy X/Y coordinates, and take into account the range of the weapon. If the player is in range of the enemy(range based on what weapon they have equipped, or what ability is being used, or a number of different things), then the attack commences and you go to the hit/damage portion of the code where all those fun calculations come into play.

Using a system that takes the player and enemy x/y positions into account also allows for a larger variety of weapons and attacks. For example, a spear, staff or longsword swung in a wide arc to hit multiple enemies, or otherwise bothersome ones. Or Link's famous whirlwind spin attack.

Being bluntly honest, this -will- make a rather dull ABS, but I realize it's not meant to be complex. I will say, though, that this tutorial allows you to do basic hit detection, with the opportunity to make a rich damage algorithm, and will work well for beginners trying to get their feet wet in the event programming river. It all depends on what you want your system to do.

Though I'd imagine the combat would look something like YS Book 1 & 2
bulmabriefs144
QUOTE (Rast @ Mar 30 2012, 01:14 AM) *
QUOTE
Other than this, just do the same as before, except reduce monster hp (and erase when it hits 0 or less) on hit, and reduce yours if they touch you. Super easy, which kinda makes me weirded out when I see complex code for hit detection. This was really simple.


That's because the complex code is for a complex ABS. This one requires you to A.) Be right next to and facing the enemy B.) Rely entirely on a 1-tile range melee weapon.

In a more complex ABS, you would need to determine the player's X and Y coordinates, as well as the enemy X/Y coordinates, and take into account the range of the weapon. If the player is in range of the enemy(range based on what weapon they have equipped, or what ability is being used, or a number of different things), then the attack commences and you go to the hit/damage portion of the code where all those fun calculations come into play.

Using a system that takes the player and enemy x/y positions into account also allows for a larger variety of weapons and attacks. For example, a spear, staff or longsword swung in a wide arc to hit multiple enemies, or otherwise bothersome ones. Or Link's famous whirlwind spin attack.

Being bluntly honest, this -will- make a rather dull ABS, but I realize it's not meant to be complex. I will say, though, that this tutorial allows you to do basic hit detection, with the opportunity to make a rich damage algorithm, and will work well for beginners trying to get their feet wet in the event programming river. It all depends on what you want your system to do.

Though I'd imagine the combat would look something like YS Book 1 & 2


Yea, like arrows. I've done some of that too, but as I have over 500 variables, it often doesn't make much sense to do too much of that. The processing actually happens right as the enemy starts to walk within a square of you, giving you actually closer to 1-1/2 squares. That's really good enough for most zelda knockoffs if you have a sword animation (nowhere near as bad as Ys), but if you have something long-ranged, like a boomerang, you'll need some sort of projectile X/Y.

I've seen some people that do overly complex coding for very close range (ahem, I think this had some of that. Though to its credit, it was trying to do a broad swing, and also have attacks work regardless of which button was used. As well as some bad XP games...). I managed to make about two maps with this thing (the game I have is NOT an ABS/XAS style otherwise, but I added it in just for the heck of it), one where to solve a puzzle you had to defeat three green slimes with your sword (defeat in battle screen wouldn't count), and the other where you faced a giant picture boss, with various blocks to halt movement, and a horizontal moving block that wasn't visible to determine whether or not it would counterattack. It also had a gust of wind attack if you approached it from the wrong side that would knock you back. Somewhat lame, but effective.

If you have enemy projectiles, having moving objects that just move in straight and diagonal lines is often enough (i.e. dodging fireballs doesn't need a variable just an object that disperses when it hits you). Tried it, and it was even more lame, but it worked.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.