Phoenix~Lament
Member
Table of Contents
0. Introduction
1. The Capabilities
2. Requirements
3. Pre-Tutorial Randomness
4. Variables, Switches, all that good stuff
5. The Common Events
6. On-Map Monster Handlers
7. The Monsters
8. Glitches and Recommendations
9. FAQ
0. Introduction
What is an ABS? If you have ever played Kingdom Hearts, on the PS2 or Gamecube, The Legend of Zelda, anything that involves you running around, killing enemies ON THE MAP, in REALTIME. Meaning, you can move around, and when you attack, it instantly shows you to attack. Now, how can you create this on RPG Maker XP, you may wonder. Of course, if your normal, you'd probably go look for a script that lets you have a very nice ABS System to work with.
But if your not normal, like me, you strive to do it with events, which I can already tell you, will take up a lot of time, and its not the most efficient thing in the world.
It'll be at least 2x harder than just getting a script.
There. I warned you. On to part 1.
By the way, this tutorial will only teach you to create a system using Events, to let you swing and deal damage with a sword. I will create a projectile based tutorial, later.
1. The Capabilities
If you follow my tutorial EXACTLY:
6 Monsters on one map, at any given time.
Changing Enemy Behavior with a few clicks
Changing Enemy HP with 7 clicks
Complete Enemy Customization with a few clicks, not taking longer than a minute
Enemies fade when dead, and drop a random amount of Money, and have a random (set by you) chance of dropping something of your choice.
Creating new monsters by copy/pasting a few events onto a new map
Displaying and dealing damage to Enemies, and to Hero
Basically: Very simple Customization of nearly any aspect of the ABS, so easy a 2 year old could do it.
Not very efficient Damage Displaying
Complicated [Over 10 Monsters per Map being handled] Systems created MAY lag. I'm not sure.
More I will think of later.
2. Requirements
To create a normal ABS, that will let you have up to 6 monsters running around one single map at any given time, you will need the following. Making the monster limit less will reduce the amount of resources you need, while making it more will obviously increase the amount of resources required.
For an ABS that will handle up to 6 Monsters
13 Switches
2 switches per monster, + one more.
25 Variables, although you can do with 23
3 variables per monster, +4, preferably 6 variables
7 Common Events
1 Common Event per monster, +1 for the hero.
Up to 6 Parallel Process Events on the Map
You only need 1 per monster on that current map. So if you only have 3 on one map, you only need 3 events.
A Hero, with custom editted Charsets or a Battle Animation that create the swinging of a Sword
Unless you want your game to be very ugly.
A way to Display Damage on the Map
You can use a script, or you can use the tutorial mentioned here.
Monsters
Duhh.
Last, but the most Required.. A solid understanding of Variables and Conditional Branches.
3. Pre-Tutorial Randomness
Remember to credit me (Phoenix~Lament) if you plan to use this in your game! Also, there are a number of glitches I haven't resolved yet, and if you create an ABS using this tutorial, it will come with those glitches if you did it correctly. I will tell you the glitches later. They shouldn't make too much of a difference, however.
I like pie.
Now, let the tutorial begin!
4. Variables, Switches, all that good stuff.
You will need to create the following:
Switches
Sword
Monster1Hit
Monster2Hit
Monster3Hit
Monster4Hit
Monster5Hit
Monster6Hit
Monster1Dead
Monster2Dead
Monster3Dead
Monster4Dead
Monster5Dead
Monster6Dead
Variables
HeroX
HeroY
Monster1X
Monster1Y
Monster2X
Monster2Y
Monster3X
Monster3Y
Monster4X
Monster4Y
Monster5X
Monster5Y
Monster6X
Monster6Y
Monster1HP
Monster2HP
Monster3HP
Monster4HP
Monster5HP
Monster6HP
HeroXMonsterX
HeroYMonsterY
Money Gain
Drop Randomizer
Common Events
Sword
Monster1Handler
Monster2Handler
Monster3Handler
Monster4Handler
Monster5Handler
Monster6Handler
That is all. Now for the programming.
By now, if you haven't already, you should have a way to deal damage. I don't know too much about the Display Damage Script, because I use my own way of displaying damage, using events. Once again, the link is here.
If you don't have a way, you should do my Damage Displaying tutorial before you go on with this tutorial.
5. The Common Events
Open up 'Sword'. This common event will make it so that, when you press a certain button, your character will swing his sword.
In my case, even though I am the most horrible pixel-editer I know, I created and edited my own custom charsets, of my character swinging a sword. I made my swing have 5 frames, and the stab have 2 frames.
I recommend making your own custom charsets, because for some reason, displaying an animation on my character didn't work so well. It went all yellow and white and stuff.. blegh.
Make 'Sword' a Parallel Process event, that starts on the switch that activate whenever your Hero gets his Sword for the first time.
Sword.
Parallel Process Common Event.
Variable: HeroX == Player X Coords
Variable: HeroY == Player Y Coords
Conditional Branch: Key X Pushed [This assigns the Sword to the button 'A', which is the one I use. If you want to make it different, make it different. Refer to my FAQ if you have questions now, or want to know which key is which on the keyboard.]
<>Variable: HeroX == Player X Coords
<>Variable: HeroY == Player Y Coords
<>Conditional Branch: Key X Pushed
----<>Conditional Branch: Player is Facing Left
--------<>Move Event:: Player
----------------------<>Graphic: 'Battle Set'. 0, 4, 2
----------------------<>Wait: 1 Frames
----------------------<>Graphic: 'Battle Set'. 0, 4, 1
----------------------<>Wait: 1 Frames
----------------------<>Graphic: 'Battle Set2'. 0, 4, 1
----------------------<>Wait: 1 Frames
----------------------<>Graphic: 'Battle Set'. 0, 4, 0
----------------------<>Wait: 3 Frames
----------------------<>Graphic: 'Original Charset'. 0, 4, 0
--------<>Proceed With Movement <-- Important, it prevents button mashing.
--------<>
----<>End
----<>Conditional Branch: Player is Facing Right
--------<>Move Event:: Player
----------------------<>Graphic: 'Battle Set'. 0, 6, 0
----------------------<>Wait: 1 Frames
----------------------<>Graphic: 'Battle Set'. 0, 6, 1
----------------------<>Wait: 1 Frames
----------------------<>Graphic: 'Battle Set2'. 0, 6, 0
----------------------<>Wait: 1 Frames
----------------------<>Graphic: 'Battle Set'. 0, 6, 2
----------------------<>Wait: 3 Frames
----------------------<>Graphic: 'Original Charset'. 0, 6, 0
--------<>Proceed With Movement
--------<>
----<>End
----<>Conditional Branch: Player is Facing Down
--------<>Move Event:: Player
----------------------<>Graphic: 'Battle Set'. 0, 2, 0
----------------------<>Wait: 1 Frames
----------------------<>Graphic: 'Battle Set'. 0, 2, 1
----------------------<>Wait: 1 Frames
----------------------<>Graphic: 'Battle Set2'. 0, 2, 0
----------------------<>Wait: 1 Frames
----------------------<>Graphic: 'Battle Set'. 0, 2, 2
----------------------<>Wait: 3 Frames
----------------------<>Graphic: 'Original Charset'. 0, 2, 0
--------<>Proceed With Movement
--------<>
----<>End
----<>Conditional Branch: Player is Facing Up
--------<>Move Event:: Player
----------------------<>Graphic: 'Battle Set'. 0, 8, 0
----------------------<>Wait: 1 Frames
----------------------<>Graphic: 'Battle Set'. 0, 8, 1
----------------------<>Wait: 1 Frames
----------------------<>Graphic: 'Battle Set2'. 0, 8, 0
----------------------<>Wait: 1 Frames
----------------------<>Graphic: 'Battle Set'. 0, 8, 2
----------------------<>Wait: 3 Frames
----------------------<>Graphic: 'Original Charset'. 0, 8, 0
--------<>Proceed With Movement
--------<>
----<>End
This makes it so that when you press the Key A, you will "attack" with the sword.
From the point forward, if you don't understand why something is there, try to read through or finish the entire tutorial before you ask. The MonsterHandlers in the Common Events, the MonsterHandlers on-map, and the monsters themselves all are like puzzle pieces, they don't do crap on their own, and seem confusing, but together, they work seemlessly, filling in one's deformities, and taking care of anothers.
Monster1Handler
Parallel Process Event
Triggers on Same Switch that triggers Sword
<>Conditional Branch: Switch [XXXX: Monster1Hit] == OFF
----<>Conditional Branch: Player is Facing Left
--------<>Conditonal Branch: Variable [XXXX: HeroY] == Variable [XXXX: Monster1Y]
------------<>Variable [XXXX: HeroX] -= Variable [XXXX: Monster1X]
------------<>Variable [XXXX: HeroXMonsterX] == Variable [XXXX: HeroX]
------------<>Variable [XXXX: HeroX] == Player X Coords
------------<>Conditional Branch: Variable [XXXX: HeroXMonsterX] == 1
----------------<>Conditional Branch: Key X Pushed
--------------------<>Variable [XXXX: Damage Counter] = Random (1..2) <-- You should insert a simple damage formula for your game, to put in there.
--------------------<>Variable [XXXX: Monster1HP] += Variable [XXXX: Damage Counter]
--------------------<>Switch [XXXX: Monster1Hit] == ON
--------------------<>
--------------------<>End
----------------<>
----------------<>End
------------<>
------------<>End
--------<>
--------<>End
----<>Conditional Branch: Player is Facing Right
--------<>Conditonal Branch: Variable [XXXX: HeroY] == Variable [XXXX: Monster1Y]
------------<>Variable [XXXX: HeroX] -= Variable [XXXX: Monster1X]
------------<>Variable [XXXX: HeroXMonsterX] == Variable [XXXX: HeroX]
------------<>Variable [XXXX: HeroX] == Player X Coords
------------<>Conditional Branch: Variable [XXXX: HeroXMonsterX] == -1
----------------<>Conditional Branch: Key X Pushed
--------------------<>Variable [XXXX: Damage Counter] = Random (1..2)
--------------------<>Variable [XXXX: Monster1HP] += Variable [XXXX: Damage Counter]
--------------------<>Switch [XXXX: Monster1Hit] == ON
--------------------<>
--------------------<>End
----------------<>
----------------<>End
------------<>
------------<>End
--------<>
--------<>End
----<>Conditional Branch: Player is Facing Down
--------<>Conditonal Branch: Variable [XXXX: HeroX] == Variable [XXXX: Monster1X]
------------<>Variable [XXXX: HeroY] -= Variable [XXXX: Monster1Y]
------------<>Variable [XXXX: HeroYMonsterY] == Variable [XXXX: HeroY]
------------<>Variable [XXXX: HeroY] == Player Y Coords
------------<>Conditional Branch: Variable [XXXX: HeroYMonsterY] == -1
----------------<>Conditional Branch: Key X Pushed
--------------------<>Variable [XXXX: Damage Counter] = Random (1..2)
--------------------<>Variable [XXXX: Monster1HP] += Variable [XXXX: Damage Counter]
--------------------<>Switch [XXXX: Monster1Hit] == ON
--------------------<>
--------------------<>End
----------------<>
----------------<>End
------------<>
------------<>End
--------<>
--------<>End
If you notice a pattern, you don't have to program 12 more lines. When you change the Facing direction to be 180degrees around, all you change is the first conditional Branch, the Direction your facing, and turn the Conditional Branch that checks if HeroYMonsterY is equal to -1, to 1. Or vice versa. Two changes, for one direction flip-around. So you could just copy the 'Player is Facing Down' conditional Branch, getting everything in it, and change those two things to save some time.
----<>Conditional Branch: Player is Facing Up
--------<>Conditonal Branch: Variable [XXXX: HeroX] == Variable [XXXX: Monster1X]
------------<>Variable [XXXX: HeroY] -= Variable [XXXX: Monster1Y]
------------<>Variable [XXXX: HeroYMonsterY] == Variable [XXXX: HeroY]
------------<>Variable [XXXX: HeroY] == Player Y Coords
------------<>Conditional Branch: Variable [XXXX: HeroYMonsterY] == 1
----------------<>Conditional Branch: Key X Pushed
--------------------<>Variable [XXXX: Damage Counter] = Random (1..2)
--------------------<>Variable [XXXX: Monster1HP] += Variable [XXXX: Damage Counter]
--------------------<>Switch [XXXX: Monster1Hit] == ON
--------------------<>
--------------------<>End
----------------<>
----------------<>End
------------<>
------------<>End
--------<>
--------<>End
----<>
----<>End
<>
<>End
That is the Common Event for Monster1Handler. To create the common events for the handlers of Monster 2-6, just replace wherever it says Monster1, in the variables, with Monster2-6.
Monotonous, boring, but simple. So there, we're already 1/3 done with the entire process! Yay! By the way, I recommend only making up to Monster2 or Monster3, until you actually make maps with 6 monsters in them.
6. On-Map Monster Handlers
You need to create one for each monster you want to have on that specific map. So if you have 4 monsters on one map, you need 4 of these events, one per monster.
Before you make the On-Map Monster Handler, you should create a blank event, give it the icon of some random monster, and name it, whatever it is. Like, just assign it a Cow picture and name it Cow. It doesn't really matter WHAT it is, as long as you have the event, because the On-Map Monster Handlers target the event specifically.
Remember to name the monster event.
Now create an event on the map.
Monster1Handler (On Map)
Parallel Process
<>Variable [XXXX: Monster1X] == [Cow] X Coords
<>Variable [XXXX: Monster1Y] == [Cow] Y Coords
<>Conditional Branch: Switch [XXXX: Monster1Hit] == ON
Starting here, you can just skip this part if you have a script that allows you to show damage on events. Just do your scripty thing, whatever, and make it show the damage based on the variable DamageCounter. And then add this:
--------<>Show Battle Animation: [Cow] [Slash1]
--------<>Proceed With Movement
--------<>Move Event:: [Cow] (Ignore Impossible Moves)
---------------------<>Change Speed: 4
---------------------<>Lock Facing ON
---------------------<>Move Away From Hero
---------------------<>Lock Facing OFF
---------------------<>Change Speed: Whatever it was before. 3 for default.
---------------------<>Proceed With Movement
---------------------<>
---------------------<>End
If not, add this. If you haven't done my Damage Displaying Tutorial, you should do it RIGHT NOW. Otherwise, you cannot go on.
----<>Conditional Branch: Variable [XXXX: DamageCounter] == 1
--------<>Show Battle Animation: [Cow] [Slash1]
--------<>Proceed With Movement
--------<>Show Battle Animation: [Cow] [1] <-- the animation you created by using my Damage Displaying Tutorial.
--------<>Move Event:: [Cow] (Ignore Impossible Moves)
---------------------<>Change Speed: 4
---------------------<>Lock Facing ON
---------------------<>Move Away From Hero
---------------------<>Lock Facing OFF
---------------------<>Change Speed: Whatever it was before. 3 for default.
---------------------<>Proceed With Movement
---------------------<>
---------------------<>End
----<>Conditional Branch: Variable [XXXX: DamageCounter] == 2
--------<>Show Battle Animation: [Cow] [Slash1]
--------<>Proceed With Movement
--------<>Show Battle Animation: [Cow] [2]
--------<>Move Event:: [Cow] (Ignore Impossible Moves)
---------------------<>Change Speed: 4
---------------------<>Lock Facing ON
---------------------<>Move Away From Hero
---------------------<>Lock Facing OFF
---------------------<>Change Speed: Whatever it was before. 3 for default.
---------------------<>Proceed With Movement
---------------------<>
---------------------<>End
--------<>Variable: [XXXX: Damage Counter] == 0
--------<>Switch: [XXXX: Monster1Hit] == OFF
--------<>
--------<>End
<>
The Bad part of this ABS system is that you have to copy/paste and replace for each and every freaking damage amount you are able to deal.
That is why I suggest keeping the numbers in your game low, like having 20 HP, and dealing damage in the single digits.
The second, and better way, is to just find a damage displaying script to do it for you.
However, if you decide to copy/paste some more, but be SURE that this ends EVREYTHING. Otherwise you will have serious glitches.
--------<>Variable: [XXXX: Damage Counter] == 0
--------<>Switch: [XXXX: Monster1Hit] == OFF
--------<>
--------<>End
<>
Once your done with whatever you decided to do, you need to make a second page to the Parallel Process Event called Monster1Handler On the Map.
Monster1Handler
Action Key, 2nd page.
Preconditions: Monster1Dead == ON
Commands: None.
Now, you need to copy/paste the entire event until you have one for each monster you have on that specific map, and replace EVREYWHERE that says Monster1, in the variables, with Monster2, 3, 4, etc.
Once again, major bugs if you don't.
The downside is that you'll hafta go through and mindlessly change variables. The good side is that you'll only have to do that once, because once you've done all 6, you just need to copy/paste them from one map to another, and change which event's X and Y coordinates that your Handlers track. Thats all you need to do to change/add monsters.
2/3 Done!
7. The Monsters
Cow
1 of 3 Pages
Collision
Commands:
<>Change Hero Status: + [1]
The First page only makes it so that whne you bump into the event, you'll take damage. Making your hero's status 1 means he will take 1 damage, if you followed my Damage Displaying Tutorial. If your using a script, just make your hero take one damage.
Cow
2 of 3 pages
Preconditions: Monster1HP is Greater Than or Equal To ___
Parallel Process
The great thing, is that to change your monster's HP, all you need to do is change the value in the precondition. Since the common event that handles Monster1 ADDS the damage counter's value to Monster1's HP, it goes from 0, up the amount of HP you want it to have, instead of having to make more common events to see when Monster1HP reaches 0. Ingenius, and very handy to edit.
<>Change Experience Points: +__ <-- change to your liking.
<>Move Event:: This Event
--------<>Opacity Change: 200
--------<>Wait: 8 Frames
--------<>Opacity Change: 150
--------<>Wait: 8 Frames
--------<>Opacity Change: 100
--------<>Wait: 8 Frames
--------<>Opacity Change: 50
--------<>Wait: 8 Frames
--------<>Opacity Change: 20
--------<>Wait: 8 Frames
<>Proceed With Movement
<>Switch [XXXX: Monster1Dead] == ON
Cow
3 of 3 pages
Precondition: Monster1Dead is ON
Hero Touch
Make the picture of this a shiny thing, or a bag, whatever you want to show on the map, for things you can pick up, like money, from the monster.
<>Variable: [XXXX: Monster1HP] = 0
<>Move Event: This Event
--------<>Graphic: (None)
<>Variable [XXXX: Money Gain] = Random (2..6) <-- change to your liking
<>Variable [XXXX: Drop Randomizer] = Random (1..100)
<>Conditional Branch: Variable [XXXX: Drop Randomizer] <= 15
----<>Message: You found \v[#] money, and a potion!
----<>Change Money: + Variable [XXXX: Money Gain]
----<>Variable: [XXXX: Money Gain] = 0
----<>Change Items: [Potion] + 1
----<>
--<>Else Handler
----<>You found \v[#] money!
----<>Change Money: + Variable [XXXX: Money Gain]
----<>Variable: [XXXX: Money Gain] = 0
----<>
----<>End
<>Erase Event
<>
Note: Typing \v[# of the variable, in this case the Number of the variable 'Money Gain', shows the amount of the variable inside the game.
Important Note:On every command that would let you leave the map where there are monsters, you need to add commands that will set the Switches [Monster1Dead, Monster2Dead, etc] to OFF. That takes care of the respawning.
You might be groaning right now, but its just copy/pasting.
..Wow! Your finally done, and should have a state-of-the-art ABS Battle System, created with ONLY EVENTS!
But.. wait, are you? There are a few glitches you should know, and a few helpful things I will recommend to help your ABS along.
8. Glitches and Recommendations
When you kill a monster, leave the map, and come back in, the monster you killed might take damage upon your entering the map. I'm not sure how to fix this glitch, so don't look forward for a fix.
Script Recommendations that could seriously help Your ABS:
A Display Damage on Map Script.
A Pixel Movement Script.
An On-Map HUD Script.
Anything else you can think of, that would be almost ESSENTIAL to an ABS Game!
9. FAQ
Q. Why can't you just assign the attack button to be on Space? It would save over 20 variables, 6 common events, and countless other resources.
A. Unless you plan to turn off and on a switch EVERY. SINGLE. TIME. You plan to press space, like opening a chest, talking to someone, opening a door, etc, its much simpler to do it using the A button.
Q. Why would you want to do it with events anyways? Why not just use a script?
A. Well then, why did you come in here then? >_>"
Q. When I press the A button, my character doesn't slash!
A. Make sure the Common Event called 'Sword' is set to Parallel Process, and that its set to a switch that is turned on whenever you want the sword to be used.
Q. I found a glitch! What do I do?
A. Let me know, via this thread or PM, and I will post up a fix, if possible.
Q. The Re-entering Map damage on respawn really bugs me. Can't you do anything about it?
A. I really doubt its possible to fix this glitch. So, I'm sorry. If I find a fix, however, I'll let you know.
Q. When I attack monsters, they take obscene amounts of damage per strike. It makes them die prematurely, what can I do?
A. I assume you don't want to deal obscene amounts of damage per strike, so you need to check in the Monster Handler Common Events.Encasing everything should be the following command:
<>Conditional Branch: Switch [XXXX: Monster1Hit] == OFF
If you don't have that, the common event will deal and redeal damage, going through the common event once every single frame you hold down the attack button. If it still doesn't work, make sure you have the command:
<>Proceed With Movement
everywhere where it needs to be.
Credit: Tiki @ gamingw.net/forum, for the solution.
-End Tutorial-
Remember kids, don't forget to credit me!
If there are problems, and you followed my tutorial exactly, let me know.
If you know more in-depth about Damage Display scripts, and could fix/make things a little more clearer, let me know.
I'm out.
Phoenix~Lament
The Miracle Worker of Events.
0. Introduction
1. The Capabilities
2. Requirements
3. Pre-Tutorial Randomness
4. Variables, Switches, all that good stuff
5. The Common Events
6. On-Map Monster Handlers
7. The Monsters
8. Glitches and Recommendations
9. FAQ
0. Introduction
What is an ABS? If you have ever played Kingdom Hearts, on the PS2 or Gamecube, The Legend of Zelda, anything that involves you running around, killing enemies ON THE MAP, in REALTIME. Meaning, you can move around, and when you attack, it instantly shows you to attack. Now, how can you create this on RPG Maker XP, you may wonder. Of course, if your normal, you'd probably go look for a script that lets you have a very nice ABS System to work with.
But if your not normal, like me, you strive to do it with events, which I can already tell you, will take up a lot of time, and its not the most efficient thing in the world.
It'll be at least 2x harder than just getting a script.
There. I warned you. On to part 1.
By the way, this tutorial will only teach you to create a system using Events, to let you swing and deal damage with a sword. I will create a projectile based tutorial, later.
1. The Capabilities
If you follow my tutorial EXACTLY:
6 Monsters on one map, at any given time.
Changing Enemy Behavior with a few clicks
Changing Enemy HP with 7 clicks
Complete Enemy Customization with a few clicks, not taking longer than a minute
Enemies fade when dead, and drop a random amount of Money, and have a random (set by you) chance of dropping something of your choice.
Creating new monsters by copy/pasting a few events onto a new map
Displaying and dealing damage to Enemies, and to Hero
Basically: Very simple Customization of nearly any aspect of the ABS, so easy a 2 year old could do it.
Not very efficient Damage Displaying
Complicated [Over 10 Monsters per Map being handled] Systems created MAY lag. I'm not sure.
More I will think of later.
2. Requirements
To create a normal ABS, that will let you have up to 6 monsters running around one single map at any given time, you will need the following. Making the monster limit less will reduce the amount of resources you need, while making it more will obviously increase the amount of resources required.
For an ABS that will handle up to 6 Monsters
13 Switches
2 switches per monster, + one more.
25 Variables, although you can do with 23
3 variables per monster, +4, preferably 6 variables
7 Common Events
1 Common Event per monster, +1 for the hero.
Up to 6 Parallel Process Events on the Map
You only need 1 per monster on that current map. So if you only have 3 on one map, you only need 3 events.
A Hero, with custom editted Charsets or a Battle Animation that create the swinging of a Sword
Unless you want your game to be very ugly.
A way to Display Damage on the Map
You can use a script, or you can use the tutorial mentioned here.
Monsters
Duhh.
Last, but the most Required.. A solid understanding of Variables and Conditional Branches.
3. Pre-Tutorial Randomness
Remember to credit me (Phoenix~Lament) if you plan to use this in your game! Also, there are a number of glitches I haven't resolved yet, and if you create an ABS using this tutorial, it will come with those glitches if you did it correctly. I will tell you the glitches later. They shouldn't make too much of a difference, however.
I like pie.
Now, let the tutorial begin!
4. Variables, Switches, all that good stuff.
You will need to create the following:
Switches
Sword
Monster1Hit
Monster2Hit
Monster3Hit
Monster4Hit
Monster5Hit
Monster6Hit
Monster1Dead
Monster2Dead
Monster3Dead
Monster4Dead
Monster5Dead
Monster6Dead
Variables
HeroX
HeroY
Monster1X
Monster1Y
Monster2X
Monster2Y
Monster3X
Monster3Y
Monster4X
Monster4Y
Monster5X
Monster5Y
Monster6X
Monster6Y
Monster1HP
Monster2HP
Monster3HP
Monster4HP
Monster5HP
Monster6HP
HeroXMonsterX
HeroYMonsterY
Money Gain
Drop Randomizer
Common Events
Sword
Monster1Handler
Monster2Handler
Monster3Handler
Monster4Handler
Monster5Handler
Monster6Handler
That is all. Now for the programming.
By now, if you haven't already, you should have a way to deal damage. I don't know too much about the Display Damage Script, because I use my own way of displaying damage, using events. Once again, the link is here.
If you don't have a way, you should do my Damage Displaying tutorial before you go on with this tutorial.
5. The Common Events
Open up 'Sword'. This common event will make it so that, when you press a certain button, your character will swing his sword.
In my case, even though I am the most horrible pixel-editer I know, I created and edited my own custom charsets, of my character swinging a sword. I made my swing have 5 frames, and the stab have 2 frames.
I recommend making your own custom charsets, because for some reason, displaying an animation on my character didn't work so well. It went all yellow and white and stuff.. blegh.
Make 'Sword' a Parallel Process event, that starts on the switch that activate whenever your Hero gets his Sword for the first time.
Sword.
Parallel Process Common Event.
Variable: HeroX == Player X Coords
Variable: HeroY == Player Y Coords
Conditional Branch: Key X Pushed [This assigns the Sword to the button 'A', which is the one I use. If you want to make it different, make it different. Refer to my FAQ if you have questions now, or want to know which key is which on the keyboard.]
<>Variable: HeroX == Player X Coords
<>Variable: HeroY == Player Y Coords
<>Conditional Branch: Key X Pushed
----<>Conditional Branch: Player is Facing Left
--------<>Move Event:: Player
----------------------<>Graphic: 'Battle Set'. 0, 4, 2
----------------------<>Wait: 1 Frames
----------------------<>Graphic: 'Battle Set'. 0, 4, 1
----------------------<>Wait: 1 Frames
----------------------<>Graphic: 'Battle Set2'. 0, 4, 1
----------------------<>Wait: 1 Frames
----------------------<>Graphic: 'Battle Set'. 0, 4, 0
----------------------<>Wait: 3 Frames
----------------------<>Graphic: 'Original Charset'. 0, 4, 0
--------<>Proceed With Movement <-- Important, it prevents button mashing.
--------<>
----<>End
----<>Conditional Branch: Player is Facing Right
--------<>Move Event:: Player
----------------------<>Graphic: 'Battle Set'. 0, 6, 0
----------------------<>Wait: 1 Frames
----------------------<>Graphic: 'Battle Set'. 0, 6, 1
----------------------<>Wait: 1 Frames
----------------------<>Graphic: 'Battle Set2'. 0, 6, 0
----------------------<>Wait: 1 Frames
----------------------<>Graphic: 'Battle Set'. 0, 6, 2
----------------------<>Wait: 3 Frames
----------------------<>Graphic: 'Original Charset'. 0, 6, 0
--------<>Proceed With Movement
--------<>
----<>End
----<>Conditional Branch: Player is Facing Down
--------<>Move Event:: Player
----------------------<>Graphic: 'Battle Set'. 0, 2, 0
----------------------<>Wait: 1 Frames
----------------------<>Graphic: 'Battle Set'. 0, 2, 1
----------------------<>Wait: 1 Frames
----------------------<>Graphic: 'Battle Set2'. 0, 2, 0
----------------------<>Wait: 1 Frames
----------------------<>Graphic: 'Battle Set'. 0, 2, 2
----------------------<>Wait: 3 Frames
----------------------<>Graphic: 'Original Charset'. 0, 2, 0
--------<>Proceed With Movement
--------<>
----<>End
----<>Conditional Branch: Player is Facing Up
--------<>Move Event:: Player
----------------------<>Graphic: 'Battle Set'. 0, 8, 0
----------------------<>Wait: 1 Frames
----------------------<>Graphic: 'Battle Set'. 0, 8, 1
----------------------<>Wait: 1 Frames
----------------------<>Graphic: 'Battle Set2'. 0, 8, 0
----------------------<>Wait: 1 Frames
----------------------<>Graphic: 'Battle Set'. 0, 8, 2
----------------------<>Wait: 3 Frames
----------------------<>Graphic: 'Original Charset'. 0, 8, 0
--------<>Proceed With Movement
--------<>
----<>End
This makes it so that when you press the Key A, you will "attack" with the sword.
From the point forward, if you don't understand why something is there, try to read through or finish the entire tutorial before you ask. The MonsterHandlers in the Common Events, the MonsterHandlers on-map, and the monsters themselves all are like puzzle pieces, they don't do crap on their own, and seem confusing, but together, they work seemlessly, filling in one's deformities, and taking care of anothers.
Monster1Handler
Parallel Process Event
Triggers on Same Switch that triggers Sword
<>Conditional Branch: Switch [XXXX: Monster1Hit] == OFF
----<>Conditional Branch: Player is Facing Left
--------<>Conditonal Branch: Variable [XXXX: HeroY] == Variable [XXXX: Monster1Y]
------------<>Variable [XXXX: HeroX] -= Variable [XXXX: Monster1X]
------------<>Variable [XXXX: HeroXMonsterX] == Variable [XXXX: HeroX]
------------<>Variable [XXXX: HeroX] == Player X Coords
------------<>Conditional Branch: Variable [XXXX: HeroXMonsterX] == 1
----------------<>Conditional Branch: Key X Pushed
--------------------<>Variable [XXXX: Damage Counter] = Random (1..2) <-- You should insert a simple damage formula for your game, to put in there.
--------------------<>Variable [XXXX: Monster1HP] += Variable [XXXX: Damage Counter]
--------------------<>Switch [XXXX: Monster1Hit] == ON
--------------------<>
--------------------<>End
----------------<>
----------------<>End
------------<>
------------<>End
--------<>
--------<>End
----<>Conditional Branch: Player is Facing Right
--------<>Conditonal Branch: Variable [XXXX: HeroY] == Variable [XXXX: Monster1Y]
------------<>Variable [XXXX: HeroX] -= Variable [XXXX: Monster1X]
------------<>Variable [XXXX: HeroXMonsterX] == Variable [XXXX: HeroX]
------------<>Variable [XXXX: HeroX] == Player X Coords
------------<>Conditional Branch: Variable [XXXX: HeroXMonsterX] == -1
----------------<>Conditional Branch: Key X Pushed
--------------------<>Variable [XXXX: Damage Counter] = Random (1..2)
--------------------<>Variable [XXXX: Monster1HP] += Variable [XXXX: Damage Counter]
--------------------<>Switch [XXXX: Monster1Hit] == ON
--------------------<>
--------------------<>End
----------------<>
----------------<>End
------------<>
------------<>End
--------<>
--------<>End
----<>Conditional Branch: Player is Facing Down
--------<>Conditonal Branch: Variable [XXXX: HeroX] == Variable [XXXX: Monster1X]
------------<>Variable [XXXX: HeroY] -= Variable [XXXX: Monster1Y]
------------<>Variable [XXXX: HeroYMonsterY] == Variable [XXXX: HeroY]
------------<>Variable [XXXX: HeroY] == Player Y Coords
------------<>Conditional Branch: Variable [XXXX: HeroYMonsterY] == -1
----------------<>Conditional Branch: Key X Pushed
--------------------<>Variable [XXXX: Damage Counter] = Random (1..2)
--------------------<>Variable [XXXX: Monster1HP] += Variable [XXXX: Damage Counter]
--------------------<>Switch [XXXX: Monster1Hit] == ON
--------------------<>
--------------------<>End
----------------<>
----------------<>End
------------<>
------------<>End
--------<>
--------<>End
If you notice a pattern, you don't have to program 12 more lines. When you change the Facing direction to be 180degrees around, all you change is the first conditional Branch, the Direction your facing, and turn the Conditional Branch that checks if HeroYMonsterY is equal to -1, to 1. Or vice versa. Two changes, for one direction flip-around. So you could just copy the 'Player is Facing Down' conditional Branch, getting everything in it, and change those two things to save some time.
----<>Conditional Branch: Player is Facing Up
--------<>Conditonal Branch: Variable [XXXX: HeroX] == Variable [XXXX: Monster1X]
------------<>Variable [XXXX: HeroY] -= Variable [XXXX: Monster1Y]
------------<>Variable [XXXX: HeroYMonsterY] == Variable [XXXX: HeroY]
------------<>Variable [XXXX: HeroY] == Player Y Coords
------------<>Conditional Branch: Variable [XXXX: HeroYMonsterY] == 1
----------------<>Conditional Branch: Key X Pushed
--------------------<>Variable [XXXX: Damage Counter] = Random (1..2)
--------------------<>Variable [XXXX: Monster1HP] += Variable [XXXX: Damage Counter]
--------------------<>Switch [XXXX: Monster1Hit] == ON
--------------------<>
--------------------<>End
----------------<>
----------------<>End
------------<>
------------<>End
--------<>
--------<>End
----<>
----<>End
<>
<>End
That is the Common Event for Monster1Handler. To create the common events for the handlers of Monster 2-6, just replace wherever it says Monster1, in the variables, with Monster2-6.
Monotonous, boring, but simple. So there, we're already 1/3 done with the entire process! Yay! By the way, I recommend only making up to Monster2 or Monster3, until you actually make maps with 6 monsters in them.
6. On-Map Monster Handlers
You need to create one for each monster you want to have on that specific map. So if you have 4 monsters on one map, you need 4 of these events, one per monster.
Before you make the On-Map Monster Handler, you should create a blank event, give it the icon of some random monster, and name it, whatever it is. Like, just assign it a Cow picture and name it Cow. It doesn't really matter WHAT it is, as long as you have the event, because the On-Map Monster Handlers target the event specifically.
Remember to name the monster event.
Now create an event on the map.
Monster1Handler (On Map)
Parallel Process
<>Variable [XXXX: Monster1X] == [Cow] X Coords
<>Variable [XXXX: Monster1Y] == [Cow] Y Coords
<>Conditional Branch: Switch [XXXX: Monster1Hit] == ON
Starting here, you can just skip this part if you have a script that allows you to show damage on events. Just do your scripty thing, whatever, and make it show the damage based on the variable DamageCounter. And then add this:
--------<>Show Battle Animation: [Cow] [Slash1]
--------<>Proceed With Movement
--------<>Move Event:: [Cow] (Ignore Impossible Moves)
---------------------<>Change Speed: 4
---------------------<>Lock Facing ON
---------------------<>Move Away From Hero
---------------------<>Lock Facing OFF
---------------------<>Change Speed: Whatever it was before. 3 for default.
---------------------<>Proceed With Movement
---------------------<>
---------------------<>End
If not, add this. If you haven't done my Damage Displaying Tutorial, you should do it RIGHT NOW. Otherwise, you cannot go on.
----<>Conditional Branch: Variable [XXXX: DamageCounter] == 1
--------<>Show Battle Animation: [Cow] [Slash1]
--------<>Proceed With Movement
--------<>Show Battle Animation: [Cow] [1] <-- the animation you created by using my Damage Displaying Tutorial.
--------<>Move Event:: [Cow] (Ignore Impossible Moves)
---------------------<>Change Speed: 4
---------------------<>Lock Facing ON
---------------------<>Move Away From Hero
---------------------<>Lock Facing OFF
---------------------<>Change Speed: Whatever it was before. 3 for default.
---------------------<>Proceed With Movement
---------------------<>
---------------------<>End
----<>Conditional Branch: Variable [XXXX: DamageCounter] == 2
--------<>Show Battle Animation: [Cow] [Slash1]
--------<>Proceed With Movement
--------<>Show Battle Animation: [Cow] [2]
--------<>Move Event:: [Cow] (Ignore Impossible Moves)
---------------------<>Change Speed: 4
---------------------<>Lock Facing ON
---------------------<>Move Away From Hero
---------------------<>Lock Facing OFF
---------------------<>Change Speed: Whatever it was before. 3 for default.
---------------------<>Proceed With Movement
---------------------<>
---------------------<>End
--------<>Variable: [XXXX: Damage Counter] == 0
--------<>Switch: [XXXX: Monster1Hit] == OFF
--------<>
--------<>End
<>
The Bad part of this ABS system is that you have to copy/paste and replace for each and every freaking damage amount you are able to deal.
That is why I suggest keeping the numbers in your game low, like having 20 HP, and dealing damage in the single digits.
The second, and better way, is to just find a damage displaying script to do it for you.
However, if you decide to copy/paste some more, but be SURE that this ends EVREYTHING. Otherwise you will have serious glitches.
--------<>Variable: [XXXX: Damage Counter] == 0
--------<>Switch: [XXXX: Monster1Hit] == OFF
--------<>
--------<>End
<>
Once your done with whatever you decided to do, you need to make a second page to the Parallel Process Event called Monster1Handler On the Map.
Monster1Handler
Action Key, 2nd page.
Preconditions: Monster1Dead == ON
Commands: None.
Now, you need to copy/paste the entire event until you have one for each monster you have on that specific map, and replace EVREYWHERE that says Monster1, in the variables, with Monster2, 3, 4, etc.
Once again, major bugs if you don't.
The downside is that you'll hafta go through and mindlessly change variables. The good side is that you'll only have to do that once, because once you've done all 6, you just need to copy/paste them from one map to another, and change which event's X and Y coordinates that your Handlers track. Thats all you need to do to change/add monsters.
2/3 Done!
7. The Monsters
Cow
1 of 3 Pages
Collision
Commands:
<>Change Hero Status: + [1]
The First page only makes it so that whne you bump into the event, you'll take damage. Making your hero's status 1 means he will take 1 damage, if you followed my Damage Displaying Tutorial. If your using a script, just make your hero take one damage.
Cow
2 of 3 pages
Preconditions: Monster1HP is Greater Than or Equal To ___
Parallel Process
The great thing, is that to change your monster's HP, all you need to do is change the value in the precondition. Since the common event that handles Monster1 ADDS the damage counter's value to Monster1's HP, it goes from 0, up the amount of HP you want it to have, instead of having to make more common events to see when Monster1HP reaches 0. Ingenius, and very handy to edit.
<>Change Experience Points: +__ <-- change to your liking.
<>Move Event:: This Event
--------<>Opacity Change: 200
--------<>Wait: 8 Frames
--------<>Opacity Change: 150
--------<>Wait: 8 Frames
--------<>Opacity Change: 100
--------<>Wait: 8 Frames
--------<>Opacity Change: 50
--------<>Wait: 8 Frames
--------<>Opacity Change: 20
--------<>Wait: 8 Frames
<>Proceed With Movement
<>Switch [XXXX: Monster1Dead] == ON
Cow
3 of 3 pages
Precondition: Monster1Dead is ON
Hero Touch
Make the picture of this a shiny thing, or a bag, whatever you want to show on the map, for things you can pick up, like money, from the monster.
<>Variable: [XXXX: Monster1HP] = 0
<>Move Event: This Event
--------<>Graphic: (None)
<>Variable [XXXX: Money Gain] = Random (2..6) <-- change to your liking
<>Variable [XXXX: Drop Randomizer] = Random (1..100)
<>Conditional Branch: Variable [XXXX: Drop Randomizer] <= 15
----<>Message: You found \v[#] money, and a potion!
----<>Change Money: + Variable [XXXX: Money Gain]
----<>Variable: [XXXX: Money Gain] = 0
----<>Change Items: [Potion] + 1
----<>
--<>Else Handler
----<>You found \v[#] money!
----<>Change Money: + Variable [XXXX: Money Gain]
----<>Variable: [XXXX: Money Gain] = 0
----<>
----<>End
<>Erase Event
<>
Note: Typing \v[# of the variable, in this case the Number of the variable 'Money Gain', shows the amount of the variable inside the game.
Important Note:On every command that would let you leave the map where there are monsters, you need to add commands that will set the Switches [Monster1Dead, Monster2Dead, etc] to OFF. That takes care of the respawning.
You might be groaning right now, but its just copy/pasting.
..Wow! Your finally done, and should have a state-of-the-art ABS Battle System, created with ONLY EVENTS!
But.. wait, are you? There are a few glitches you should know, and a few helpful things I will recommend to help your ABS along.
8. Glitches and Recommendations
When you kill a monster, leave the map, and come back in, the monster you killed might take damage upon your entering the map. I'm not sure how to fix this glitch, so don't look forward for a fix.
Script Recommendations that could seriously help Your ABS:
A Display Damage on Map Script.
A Pixel Movement Script.
An On-Map HUD Script.
Anything else you can think of, that would be almost ESSENTIAL to an ABS Game!
9. FAQ
Q. Why can't you just assign the attack button to be on Space? It would save over 20 variables, 6 common events, and countless other resources.
A. Unless you plan to turn off and on a switch EVERY. SINGLE. TIME. You plan to press space, like opening a chest, talking to someone, opening a door, etc, its much simpler to do it using the A button.
Q. Why would you want to do it with events anyways? Why not just use a script?
A. Well then, why did you come in here then? >_>"
Q. When I press the A button, my character doesn't slash!
A. Make sure the Common Event called 'Sword' is set to Parallel Process, and that its set to a switch that is turned on whenever you want the sword to be used.
Q. I found a glitch! What do I do?
A. Let me know, via this thread or PM, and I will post up a fix, if possible.
Q. The Re-entering Map damage on respawn really bugs me. Can't you do anything about it?
A. I really doubt its possible to fix this glitch. So, I'm sorry. If I find a fix, however, I'll let you know.
Q. When I attack monsters, they take obscene amounts of damage per strike. It makes them die prematurely, what can I do?
A. I assume you don't want to deal obscene amounts of damage per strike, so you need to check in the Monster Handler Common Events.Encasing everything should be the following command:
<>Conditional Branch: Switch [XXXX: Monster1Hit] == OFF
If you don't have that, the common event will deal and redeal damage, going through the common event once every single frame you hold down the attack button. If it still doesn't work, make sure you have the command:
<>Proceed With Movement
everywhere where it needs to be.
Credit: Tiki @ gamingw.net/forum, for the solution.
-End Tutorial-
Remember kids, don't forget to credit me!
If there are problems, and you followed my tutorial exactly, let me know.
If you know more in-depth about Damage Display scripts, and could fix/make things a little more clearer, let me know.
I'm out.
Phoenix~Lament
The Miracle Worker of Events.