Gw Temp

Menu

Tutorial - 'Duel System' by ATARI

An item about RPGMaker 2000 posted on

Blurb

How to create a duel system similar to that in the suikoden series of games

Body

So... Hello Folks! It's ATARI AGAIN!! It's time for a tutorial on a Dueling System. This one is like the one if Legion Saga games.

So what kind of a duel is this? If you've ever played legion saga, you'll know, but if you haven't...
Basically two characters face against each other. They can chose which attack to use against each other. It's basically in a Rock,Paper,Scissors form. (Hey! You can use this tut to do that too!) In my tut I'll use three basic commands.
Dodge, Attack, Charge.
And the breakdown:
Charge beats attack (more or less)
Dodge beats Charge
Attack beats dodge.

So how do you do this? It's not too hard. Just a little knowledge with forks and variables and you can do it in a breeze, (or however it goes)

Things you'll need (in my version)
4 Variables. One called Hero HP, Enemery HP, Hero Attack, and enemey attack. In this system, both hp will be at five
10 pictures. 1 for Hero hp at full, hp at 4, hp at 3, hp at 2, hp 1 and dead. Do the same for the enemies hp too. Make them all 50x50, (this is what works for me)

Make a new map for our little duel. Make another map where you meet the character you duel. Make an event where the character says "Hey. Let's duel." (Hey, this is a tutorial, not a game) Set the two hp variables to 5 and then teleport to your duel map.

This is where the actual coding gets going. So grab your hats, get your donuts and read on.

Display both full health pictures. They are at the top left and right screens. Left is enemey and right is hero, or at least in my tut. The picture settings are:
Left - both are 25, so i'm not gonna even tell you which are x and y. Right. - x 300, y 25. You can change this if u want too, but this is what works for me and my 50x50 picture. Make a label right here so you can get back to this. Next show choice. Under the choices show.
Attack - 1 damage
Charge - 2 damage
Dodge - 0 damage, but user of charge when dodge is in use gets 1 damage
Status - doesn't even do anything.
First I'll start with the easiest one. [Status]
Just simply show a message that says:
"You have /v[xxx] hp. (the / is a forward slash, xxx represents the variable number. See MY variable tut for details) When dat is done, go back to your label.
[attack]
Set variable hero attack at one. Set enemey variable at random 1-3. Now make a fork (no, not the one you eat with), in the fork, make the first one if variable hero attack equal one. The next one if enemey attack equal 1. This means both the AI and you used the attack function. Have them go at each other and show battle animations etc. etc. Then minus both hp variables by 1.
Make another fork option under the else case, do the same thing except change the enemey if 1, change the 1 to a 2 and change your animations etc. And minus the hero hp variable by two instead of one.
Next part is dodge. Change the 2 in the last to a three in your next fork under the else case. Make the enemey not move at all and only minus on hp point from the enemey. Then go back to the label. Prettty easy here. The rest are the same. I'll just display the little differences in them.
[charge]
Do the same things, of course, make the enemey hp go down 2 instead of one. Charge does 2, not one. When the enemey goes in 3, make the animation of the hero missing the enemey and minusing yourself one damage point
[dodge CARVAN!!! just kidding!]
Do everything the same, of course, the is no animation for your hero, but this is obviously understandable. Now when the enemey uses charge make the enemey miss and have them minus one.

Making your hero or enemey die:
Under the next else case: Make a fork that says if hero hp variable is below 0. Then under that make it go to the gameover screen or say something to signify that the hero is dead.

For the enemey, do it under the next else case and make it a victory messg/screen whatever you want. The teleport your hero back to the first map and make a messg stating you won or talking or whatever. Hey, it's your game.

Good luck using this.
NOTE: If you use this in your game, please give ATARI credit in your credits. You may distrubute this tutorial if you just give me credit. Yoinks

Remember:
"Even the greatest gamers were nOObs."