@bgillisp Actually, here I have to kind of disagree with you. It is indeed difficult to write an ABS to share with others. However, depending on what you expect from your ABS, the ABS can be simple... Or not so simple. However, the thing is, by integrating it with events, I sacrifice a couple of things and increased hard coding for the sake of simplicity. The pros are obvious, easier work, the cons are that half of it is done inside RM itself, so it's far from publishable
@MushReen I will share a little bit with you. Nothing too complicated, although it will consist of some javascript as well. I will keep it as simple as possible however, taking you being a rookie into account.
The simplest ABS consists of several things in terms of preparation.
distinguishing safe and unsafe location - easy, switch.
1. Common event or plugin to track input - I would use Yanfly's button common events, because it has plugin commands to rebind keys, which is useful, since it allows me to use Action button for attacking in unsafe location and for interaction in safe location
2. Common event for setting up safe location set to no trigger, we will call it once time comes
3. Common event for setting up unsafe location each time you teleport into it - which means reseting hp variables back to 0 and setting up our battle HUD in case we have it turned off (I will not be teaching you how to make battle HUD). We will be setting up through common event only things that can be set universally. Enemy attributes, etc. will be set specifically through each teleport event.
4. Common events with skills that are called by certain keys, example 1-8 - we will set up the trigger in Yanfly's plugin
That is all she said.
So for illustration about skills: I want to have a simple ABS. The only skills I can cast are skills that buff me (because projectile skills are much harder to make) and I can only have 1 active buff. Casting any buff is instant and overrides any existing buff. For this I need several common events:
1. basic attack common event
2. skill common events
3. Buff clearance common event
4. time tracking common event responsible for time limited buffs and ending unsafe location once it is safe
My attack skill will look like this.
switch Attacking = on
if hero is facing upwards:
variable 0001: hero Direction = 8
move event: player - change Image - slashingUp.png
else if hero is facing left:
variable 0001: hero Direction = 4
move event: player - change image - slashingLeft.png
else if right
else
variable 0001: hero Direction = 2
change image - slashingDown.png
After that huge if else chain:
Play Animation: hero, slash 1
move event: player - I use 4 directions to showcase different phases of slashing, so it's turning 90 degrees left, 180 degrees and 90 degrees right, 180 degrees, then change image: hero standard image. Of course with appropriate waits between them.
small wait, maybe 0.2s, to prevent myself from being able to just spam the button indefinitely fast.
switch Attacking = off
In explanation words my basic attack common event turns on a switch for the duration of slashing and determines the direction he is facing, the rest is visuals. That is because all interaction will be done inside enemy events.
my Atk buff skill, which gives me attack boost of 25% (of the base value) for 5 seconds, will look like this:
call common event: skill clearance
Variable 0002: buff timer = 300 (300 frames of a second = 5 seconds, since 1 second has 60 frames)
variable 0003: buff skill ID = 3 (signal to the ID of the common event I used - a necessity for the skill clearance common event to see what it is supposed to do)
and now Script command that will allow me to boost the attack.:
var atkBuff = Math.floor($gameActors.actor(1).paramBase(3)*0.25) // calculating 25% of base attack
$gameActors.actor(1).atk += atkBuff // in other words 25% of base attack gets added up to the hero's attack
also, since this value can change anytime, I will need to store it. So I will add another line to the script:
$gameVariables.setValue (4, atkBuff)
The rest of the atk buff skill would be visuals, so unimportant any further.
Other buff skills would look similarly. And heal skill is simple.
The skill clearance common event will simply track the value of variable 3 and acts accordingly.
So:
if variable 0003 = 3:
script command:
$gameActors.actor(1).atk -= $gameVariables.value (4) // resets the attack, now we need to eliminate all traces of the buff being used.
variable 0003 = 0
For all sorts of buffs there will be a case where the event resets the effect to 0 and the variable 0003 to 0 to signalize no buff is currently in effect.
So now that we have everything set in terms of common events, we will move on to the interaction.
Now I want the enemy to be able to attack me, but once he attacks me, I want to be able to retaliate. I also want to be able to mash the button. So this means that
The enemy events will have three pages, first page alive - activation conditions none, second page busy - self switch A on, third page dead - condition - corresponding hp variable greater than or equal to some value
Third page has no effects
Second page has:
wait for a couple of frames, then turn self switch A off. This prevents the snake from spamming hits without us being able to retaliate and from immediately hurting us once we turn switch Attacking off.
First page: trigger: Hero touch.
if switch Attacking is not on:
hero hp decrease
play animation on hero
turn self switch A on
else:
now you will be grabbing hero's X and Y coordinates, this event's X and Y coordinates and hero's direction to see if hero is facing the right direction. Hero's direction is already set in a variable we set earlier, X and Y coords can be collected through Variable operations.
So we will be covering four cases:
When hero's x - event's x = 1, hero's y - event's y = 0 (in other words hero is one square to the right compared to the event)
When hero's x - event's x = -1, hero's y - event's y = 0 (hero is one square to the left)
When hero's x - event's x = 0, hero's y - event's y = 1 (hero is one square downwards)
When hero's x - event's x = 0, hero's y - event's y = -1 (hero is one square upwards)
So let's take for example the first case:
hero is to the right towards the event, so that means he needs to be facing left, so direction needs to be equal to 4.
if direction is equal to 4:
flashy hit animation plays on the event
enemy receives a hit and his variable responsible for HP increases (simple variable operations)
if he is not dead:
enemy self switch A turns on
if he is dead: variable tracking alive enemies decreases by 1 and maybe a message about a drop and a drop.
However, if the direction is not equal to 4:
flashy hit animation plays on the hero
hero receives a hit and his HP decreases
enemy self switch A turns on
Time tracking common event is simple. It is a parallel process common event, trigger switch: Unsafe location
Wait 1 frame
if variable 0003 > 0 (in other words a buff is active)
decrease variable 0002 by 1
if: alive enemies = 0
Call common event: Safe location setup (calling common ecent responsible for rebinding our keys for safe locations and optionally eliminating battle hud if we don't want it in peaceful locations
That is all. It is a simple hack and slash with only self buff, but it's enough for a rookie as a study material. I know it's kind of messy, but hopefully you can orientate yourself a bit in it

Even though people say it is difficult to make an ABS, the difficulty actually varies in terms of what you want it to do. If you want a simple hack and slash, there's not too much difficulty in it. It will just not be publishable, because you'll need to hardcode plenty of things to keep it simple. However, depending on the skills you require, the difficulty can go up. Also, this battle system is not universal. It meets the goals I have set here. If I want to have a game where there is not only one hero, this battle system will be useless unless it gets edited. If I want projectile skills, the knowledge hidden in this battle system is not enough, because projectiles are indeed complicated. Debuffs on the enemy are not the easiest, but are doable, even though it would be better to rework the system... Again, to keep it simple.
And I could continue forever.
Which reminds me... There is no universally best ABS plugin or system. The best system is the one that suits my game. And what I find bad in these 3rd party plugins is A. They are incredibly limited, and B. They are incredibly complicated, which makes for difficult modding. I like to keep things simple, which makes me just make them myself in the end
