Charas-Project

Game Creation => Requests => RPG Maker Programming => Topic started by: AsakuraHao2004 on May 23, 2005, 09:12:38 PM

Title: Action Battle System Tutorial
Post by: AsakuraHao2004 on May 23, 2005, 09:12:38 PM
--------------------------------------------------------
ACTIVE BATTLE SYSTEM TUTORIAL
--------------------------------------------------------
-------------
Contents
-------------

1) Introduction
2) Requirements
3) Scripting
   a) Part 1: Melee
   b) Part 2: Special
4) Making things work
5) Outroduction

---------------------
1) Introduction
---------------------

Welcome to my third tutorial for RPG Maker! Ok, time to get down to business. What exactly is an ABS? Well, it stands for Active Battle System. It's a pretty good alternative to the DBS (or Default Battle System, the RPG Maker standard). In an ABS, your character walk around and fights enemies as they come. Some good examples are the Zelda games, Kingdom Hearts, and Legacy of Goku.

------------------------
2) Requirements
------------------------

Before begining the scripting, you will need to have a few things set. First off, you'll need at least 3 character sets, one for the hero, one for the enemy, and one for the special graphic. Also, probably the most important thing, you'll need to have at least a basic understanding of how variables and switches work. Not so much on switches, but you must know about variables. If you don't, please check out my tutorial on understanding variables.

-----------------
3) Scripting
-----------------

Note: Things in ?question marks? are suggested names, or optional. If you wanna name something something else or do something different in that situation, feel free.

---------------
3a) Melee
---------------

I'm gonna get right into it. First, make a new event, name it ?enemy?, and set it's graphic to you enemies graphic. Set the trigger condition to "Colision with Hero" and make it on the same level as the hero. Make it's movement type "toward hero". In the event's commands, make a fork condition, and make it "If event was started using action key", and check "Else Case". In that fork, "?play sound: hit?", "Flash event, this event, .5 sec", "Move event, this event, start jump, random, end jump", Make a new variable called "?Enemy's HP?", then "Variable, subtract 1 from Enemy's HP".

Now, make a new page. Set the graphic to blank, make it below hero. Under "Preconditions", check "variable, if enemy's hp is 0". Now go back to the first page.

Under the "Else Case", "?play sound: hit?", "Flash event, Hero, .5 sec", "Move event, Hero, start jump, random, end jump", make a new variable called "?Hero's HP?", then "Variable, subtract 1 from Hero's HP".

Now, after "End", make a fork condition, "If Hero's HP is 0, no Else Case" and inside the fork, put "Game Over". This will end the game if the hero takes too much damage.

-----------------
3b) Special
-----------------

This is a little harder. First, I must tell you to put the following events in a place the hero and enemy CAN NOT get to. If they touch them, it causes all sorts of problems, so put them up in a tree, in some water, or wherever, as long as the characters will never be able to touch them.

Before proceeding, make some new variables: Enemy X, Enemy Y, Hero X, Hero Y, Special X, and Special Y.

Make a new event, name it whatever you like, no graphic, parallel process. In the Event Commands,   "Variable Operands, single variable: Enemy X, set equal to, check 'sprite' and select "enemy" and "x coordinate". Now, do it again, except make the variable "Enemy Y" and the 2nd option of sprite set to "y coordinate". Do this again, except using the "Hero X" and "Hero Y" variables, and make the sprte "Hero". Click OK.

Make another event close to it, name it ?beam?, no graphic, parallel process. In the event commands, chose "Key input process", make a new variable called "?use special?" and store the key code in it. Make it, "Wait until key pressed", and ONLY check "Cancel Key (6)". Under that, make a fork condition, "If variable 'Use Special' is equal to 6". Under that, put "Change Event Location, this event, check 'location stored in variables', and for "X coordinate stored in" chose "Hero X", and for "Y coordinate stored in" chose "Hero Y". Under that, "Wait, .1 sec", under that, make a new switch "?using special?" and turn it on. It should look like this:
Image hosted by Photobucket.com

Now make a new page.

Make it Parallel Process, set the graphic to the special's graphic, and set the Precondition to "If Using special is on". In the event commands, Fork condition "If hero is facing up, no else case", move event, this event, phasing mode on, up, up, up, up, up, switch "using special" off, check "Ignore impossible moves". Under that, Fork condition "If hero is facing down, no else case", move event, this event, phasing mode on, down, down, down, down, down, switch "using special" off, check "ignore impossible moves". Make two more forks for left and right. You should be able to know how to finish them by now.

Under those put a wait. 1 second should be enough, but it all depends on how fast the graphic is going. For normal speed, use 1 second.

Under that, "Change event location, this event, specific location, MOVE IT TO AN EVENT-FREE COORDINATE THAT THE ENEMY CANNOT ACESS" If you don't, it'll most likely cause errors. Click OK. Your event should look a little like this:

Image hosted by Photobucket.com

Go back to the event we first made at the start of Part 3b. Under the first 4 event commands, make another one "Variable Operands, single variable: Special X, set equal to, check 'sprite' and select "beam" and "x coordinate". Now, do it again, except make the variable "Special X" and the 2nd option of sprite set to "y coordinate". Also, you might wanna put in "Disable menu" here, if you dont already have it in effect. It shoulc look like this when finished:
Image hosted by Photobucket.com

Now, one final event. Name it whatever you want, no graphic, parallel process. In the event commands, "Fork condition, if variable "Enemy X" is equal to, variable referance "beam X", no else case. INSIDE that fork, "Fork condition, if variable "Enemy Y" is equal to, variable referance "beam Y", no else case. And INSIDE that one, "switch 'using special' off, wait .1 sec, "change event location, "beam" MOVE IT TO AN EVENT-FREE COORDINATE THAT THE ENEMY CANNOT ACESS" ?play sound: beam hit?, "Flash event, enemy, .5 sec", "variable, subract 5 from Enemy HP." Here it is:
Image hosted by Photobucket.com

There you have it. Test it out. You should be able to punch you enemy with Z and shoot at him with X.

----------------------------------
4) Making Things Work
----------------------------------

First off, for best results with this kind of CBS, you should only make where you fight the enemies, and where you talk to people different. If you want to have more than 1 enemy per map, you'll need 3 variables for each monster. That monster's HP, that monster's X and that monster's Y coordinate. The scripting can get tedius, so I reccomend that instead of having one large map with a lot of monsters, you can have several small maps with a few monsters, that way, you can assign the same variables to different monsters.

Also, at the begining of the game, or at least sometime before the hero starts fighting, set all the monster's HP to what you want it, as well as the hero's. In this tutorial, I based the hero's and monster's HP on a 10 point basis. You can make them higher if you want, but also make sure to make the attacks more damamging.

Along with that, everytime you teleport to a new battle map, set each monster's HP back up to full. Once you get to harder levels, you can set their HP higher for a cheap leveling system. Just put "Set Variable enemy1 HP" to whatever, then enemy 2, and so on, for all of them before the teleport event.

-------------------------
5) Outroduction
-------------------------

I hope this helps some of you. This is a somewhat advanced tutorial. I tried to make the instructions on what to do as easy to undestand as possible. If theres something you dont understand, you should know enough about RPG Maker to figure out what I mean. If not, you should probably mess around in RPG Maker a little more before trying an ABS. Also, once you have this down, try tweaking it some. Make a Special meter, or make more than 1 specials selectable. Or even don't set a graphic for the special. Make it invisible and play a battle animation over it. I'd like to see some more ABS games with cool effects. If this tutorial helped you any, please creadit me. If you'd like to use it on your site, ask me first. You can e-mail me at asakurahao8@yahoo.com. Thank you.

-RE

Note: I typed fast, no proofread. Sorry for spelling errors.
Title:
Post by: darkrune on May 23, 2005, 09:20:06 PM
/bow
/hail AsakuraHao2004
Lol thanks man.
Also AsakuraHao2004 in rm2k3 i forck condtion
conditional branch?
Title:
Post by: AsakuraHao2004 on May 23, 2005, 09:29:03 PM
You're welcome. Yeah, Fork Condition is conditional branch. I sort of went back and fourth between the two.
Title:
Post by: darkrune on May 23, 2005, 09:42:33 PM
For the 3b part we don't have to do that part until we want our heroes to use specials right?
Title:
Post by: AsakuraHao2004 on May 23, 2005, 09:50:59 PM
You can use it whenever you want. If he's in a place when you dont him to use specials, don't make nything in 3b. If he can use specials, go ahead and make them. You don't even have to use specials at all if you don't want to.
Title:
Post by: darkrune on May 23, 2005, 10:49:29 PM
AsakuraHao2004 I am going to use Kingdom Hearts as an example because they use abs. Sora doesnt fight alone however. So is there a way to get other people fighting with you such as "Donald" or "Goofy"?
Title:
Post by: AsakuraHao2004 on May 23, 2005, 11:50:41 PM
It might be possible, but It's beyond my skills.
Title:
Post by: darkrune on May 24, 2005, 01:18:45 AM
Yeah from your tutorial I am seein that it would be near impossible to make another one do it. I guess you could have them fixed but that would be kinda lame like have them be like cut scenes fighting other cutscenes lol.

Also suggestion maybe take a screenie of one of the events and show it, more easier since it bothere you it might be to diffucult. Just a suggestion though.
Title:
Post by: AsakuraHao2004 on May 24, 2005, 01:59:49 AM
Ok, I edited it to have pictures. They might be a little different from what yours would look like because that's from my game, and I have a system that keeps track of your energy.
Title:
Post by: Snake Eater on May 24, 2005, 02:18:35 AM
Great Job!
Title:
Post by: darkrune on May 24, 2005, 02:56:10 AM
Hmmmm easier with pics.
Title:
Post by: Desimodontidae on April 23, 2006, 03:08:47 AM
I would just like to thank whoever kicked my thread. It's slightly dated, but this is still the basics of making an ABS. A little add-on of advice, once you learn this, repeat it and apply it over and over in the same system, like frickin crazy!!! Get inventive. Like double shots, multiple bullets at a time, explosive mortars that fly in all directions on impact, all kinds of stuff. Even if you dont use it for your game it's good practice getting this stuff down. Also, learn variables like crazy. And pictures, and using them in conjunction. These are the basis' of an awesome system.
Title:
Post by: reflux on May 13, 2006, 12:37:27 PM
thanks man, this really helped me a lot,I really hate these pokemon fights
it's a great tutorial and my game can get so much bloodier with this :)
Title:
Post by: Zerlina on May 13, 2006, 01:42:00 PM
Will this work if you only want an ABS for a certain section of the game? There's a scene on a battlefield in my game, and I thought it would be more effective as ABS rather than DBS system for that part...but I'm using DBS for the rest.
Title:
Post by: Meiscool-2 on May 13, 2006, 02:29:02 PM
Yes, it will work for anything.
Title:
Post by: RebornKefka on May 28, 2006, 10:58:53 PM
Hmm, it's a cool way of doing a battle. I tried it myself, and I think I went wrong somewhere, could you check out what I did wrong? I'm at a loss haha.

http://rapidshare.de/files/21647763/test.zip.html
Title:
Post by: Dragoon de Sol on May 29, 2006, 02:24:36 AM
Have you done it with projectile attacks as well?
Title:
Post by: Desimodontidae on May 29, 2006, 03:18:28 AM
Quote
Originally posted by RebornKefka
Hmm, it's a cool way of doing a battle. I tried it myself, and I think I went wrong somewhere, could you check out what I did wrong? I'm at a loss haha.

 http://rapidshare.de/files/21647763/test.zip.html


That looks fine for the most part... the only thing is the wait before the other guy jumps./.. Im kinda drunk right now so just explain more what the problem is and Ill look at it tomorrow
Title:
Post by: RebornKefka on May 29, 2006, 06:55:08 PM
oh, it's just that the HP doesn't go down at all for the hero or the monster.
Title:
Post by: RebornKefka on June 23, 2006, 12:11:25 PM
Well? Is there anything wrong with it?
Title:
Post by: oooog on June 23, 2006, 12:16:47 PM
Errrmmmm.......unessecary topic kick?
Title:
Post by: Meiscool-2 on June 23, 2006, 03:23:08 PM
You forgot to add Bow Chika Bow Wow.
Title:
Post by: Desimodontidae on June 23, 2006, 05:48:45 PM
I didnt see any variables set or anything. You might wanna take care of that.
Title: i wonder
Post by: Jek on July 18, 2006, 06:38:47 PM
i wonder if it is ok if you  add the variable instead of subtract the variable from the monsters and heroes health :guns:
Title:
Post by: Gary on July 18, 2006, 07:36:55 PM
Quote
Originally posted by Jek
i wonder if it is ok if you  add the variable instead of subtract the variable from the monsters and heroes health :guns:

Another kick? Don't do that -_-
Title:
Post by: Desimodontidae on July 18, 2006, 08:37:41 PM
Dude, kicking a tutorial is fine. These topics don't lose their meaning, they can still be helpful to someone.

Quote
Originally posted by Jek
i wonder if it is ok if you  add the variable instead of subtract the variable from the monsters and heroes health :guns:


Uhm. If you did that, instead of attacks taking away health, they would be giving health. That's be weird. Uhm. But an original system would be to try to NOT get health.... and when your bar gets full you die.... heh.
Title:
Post by: coasterkrazy on July 18, 2006, 08:38:52 PM
Le gasp! Gun smiley must = troll!!!!111one!11!!!

Honestly though, I do think charas should lighten up. Meh, sorry Gary, I don't blame you. I blame the government! Darn you government!!!

EDIT: Yeah, what Desimo said. 100% agree'd.
Title: its a twist
Post by: Jek on July 18, 2006, 10:27:17 PM
well, my add idea is reverse,you do it but add witch doesnt mean that you add health, it just means you add thevariable and once it reaches maximum, it dies... simple as that(and i tested it, it works) so ha. so its not kicking the system, your just giving it a twist. oh and i accidentilly hit new topic instead of reply(woops)
Title:
Post by: Meiscool-2 on July 18, 2006, 10:30:40 PM
Quote
Originally posted by Jek
well, my add idea is reverse,you do it but add witch doesnt mean that you add health, it just means you add thevariable and once it reaches maximum, it dies... simple as that(and i tested it, it works) so ha. so its not kicking the system, your just giving it a twist. oh and i accidentilly hit new topic instead of reply(woops)


Yeah, you could do that, now quit making unneeded posts.

Twists don't matter in coding, no one is supposed to see it. Subtracting is easier then adding.
Title:
Post by: Jek on August 12, 2006, 04:30:06 PM
i posted this before but noone is answering it so can asikurahao tell me how to selecta move out of a vary of special moves. i want different guns for it.
Title:
Post by: Desimodontidae on August 13, 2006, 04:15:25 AM
Yes, you can, but thats getting into CMS which I dont have time to explain.
Title:
Post by: ellie-is on December 15, 2006, 06:29:26 PM
There is a way for make the weapon that my char is using apears when he attack? And how I can make something like a life meter?
Title:
Post by: Meiscool-2 on December 15, 2006, 09:39:28 PM
I hope he'll let me answer this.

Health meters (which I call HUDS) are be made using Pictures. Picture files can be used on the second page of RM2k3 coding. You'll have to figure out how to use them yourself, but if you can code an ABS with X and Y cords, pictures shouldn't be that hard either.

As for animations, you either need to make poses and have the hero's sprite switch to those poses durring the attack, or you need to use a battle animation.
Title:
Post by: ellie-is on December 16, 2006, 12:33:12 PM
Ok, tanx
Title:
Post by: benjie417234 on October 06, 2007, 01:52:19 AM
If Hero's HP is 0...i can;t find that the only thing i see in conditional brANch is if Hero's hp is ABOVE....help?
Title:
Post by: lilsniffs3 on October 06, 2007, 02:07:28 AM
Stop topic kicking, make another topic!
Title:
Post by: benjie417234 on October 06, 2007, 02:08:37 AM
well thanks for warning me anyway..now i see your point.