Ellye's ATB (also includes CTB option)

Mellye

Veteran
Veteran
Joined
Oct 24, 2015
Messages
347
Reaction score
278
First Language
Portuguese

 

 ​
 ​
 
Disclaimer: I did this mostly as a learning experiment for RPG Maker MV, but it should also be usuable. Perhaps something similar is even already implemented in some of the core plugins, I didn't check.
 
Anyway!
 
This is a pretty straightforward script that works nicely in a plug'n'play style, no real setup required.
 
What does it do?
 
It changes the way your battle works slightly, by turning it into ATB (Active Time Battle) combat; as many of the Final Fantasy games (plus a few others).
 
It adds a new gauge besides your HP, MP (and possibly TP), called a "AT" gauge. The speed that this gauge fills up is based on your character Agility. The most agility he has, the quicker the gauge fills up.
 
A character gets to act when his gauge is full. So your combat is no longer structured on rounds where everyone gets to act exactly the same amount of time, but instead is more free-form: a character that is considerably faster will get to act more times during a fight. Monsters use the same system (but their gauge is hidden).
 
Configurable Parameters:
 
You can set a "weight" for the Agility attribute, if you feel that the default one doesn't work well with the numbers you're using in your project (i.e: perhaps you want to make Agility even more relevant, or perhaps you feel like this script is making agility a bit too relevant and want to tune it down).
You can also set a "Turn Timer" - this is relevant for mid-battle Events that have a turn condition. This is basically the "Agility" that the turn timer would have (it also might affect status effects set for "Turn End" instead of "Action End").
 
Legal:
 
Feel free to use this script as much as you want. I just can't offer any warranty.
 
Etc:
 
The code is obviously a bit of a mess - I've just coded this throught the witching hours after a full workday. But do let me know of any bugs or other issues!
 
Current Version: 2015-11-28-1906:

* 2015-11-28-1906: Cast motion should now finish at the proper time.

* 2015-11-26-1052: Added the option of mid-battle escape.

* 2015-11-22-1515: Fixed a bug with Confusion/Enrage effects and casting times.

* 2015-11-22-0925: Made enemy gauges compatible with Yanfly's sprite sideviews for enemies (and possible other similar SV sprites).

* 2015-11-22-0453: Can now also use <atb_duration_param:pARAM> on states. See HELP.
* 2015-11-20-1808: Added <haste> notetag for states, actors, classes, equips and enemies, and <atb_duration:> notetag for states. 
* 2015-11-14-2144: Added the <start_atb:NUMBER> note-tag feature. Can be used on actor, class, equip and enemy to set a starting amount of ATB.
* 2015-11-14-2004: Can now select which parameter to use for casting, instead of it being fixed on Agi. There's a global parameter, and the note <cast_param:>.
* 2015-11-14-1629: Added Battler EndTurn Effects parameter.
* 2015-11-14-1518: Added delay system. See HELP.
* 2015-11-14-1405: Separated a few stuff into their own method, like casting stop/starting and atb ratio.
* 2015-11-14-0154: Made step back when casting compatible with Yanfly's.
* 2015-11-14-0134: Turn prediction now predicts casting times when hovering over a skill with cast_time.
* 2015-11-11-2339: Fixed an issue with Turn Timer and Instant ATB.
* 2015-11-11-1101: Added paramaters for the Turn Order Display to show symbols when hovering over skills that affect the predction. Work in progress, it looks pretty crude still. And it still needs to predict cast on hover too (it only displays after selection for now). Leave those parameters blank to disable the feature.
* 2015-11-09-2317: Enemies now also use the different interruptible cast gauge color.
* 2015-11-09-2317: Separated the drawActorATBGauge method for better compatibility with interface and gauges plugins. (Thanks for the suggestion, Bobstah!)
* 2015-11-09-0119: Characters with restricted movement (stun, for example) have their cast interrupted and their gauge display stays empty.
* 2015-11-08-2354: Fixed casting actors staying forward until the next action.
* 2015-11-08-2354: Added Imported.Ellye_ATB for compatibility.
* 2015-11-08-2307: Can now mark skills as <interruptible> and other skills as <interrupt>. Also added parameters related to the interrupt system. See HELP.
* 2015-11-08-2157: Can now add custom <cast_motion:MOTION> and <cast_animation:NUMBER> per skill. See help.
* 2015-11-08-1557: Added a Default Animation parameter (played at start of cast, defaults to 0 due to compatibility, but I recommend 52 from the default RM MV database).
* 2015-11-08-1557: Added a Default Cast Motion parameter.
* 2015-11-08-1557: Added the option of using reversed cast gauges.
* 2015-11-07-1722: Fixed a bug with lingering enemy cast bars depending on how it finished casting.
* 2015-11-07-1722: Improved performance of enemy gauges slightly.
* 2015-11-07-0519: Added ATB gauges and Cast gauges for enemies, and parameters to configure it. PENDING: Offset per enemy (via [Note]), configurable gauge back color, and a few other optional stuff.
 * 2015-11-07-0222: Added parameters for positioning actor name and state icons.
 * 2015-11-07-0036: Made the turn prediction understand casting times (work in progress, still needs improvment (and visual indicators)). It doesn't read casting times on hover yet, though.
 * 2015-11-07-0036: Fixed an issue with the Turn Prediction not working properly with skills that delayed the caster turn.
 * 2015-11-07-0036: The cast bar remains visible while the actors executes his skill.
 * 2015-11-05-2319: Added Battle Turn Event parameter.
 * 2015-11-05-2319: Added a casting time bar and parameters for it.
 * 2015-11-02-2336: Very early draft of the Casting Time system is now available. If you want to help test it, use <cast_time:NUMBER> on skill notes.
 * 2015-11-02-1423: Fixed an issue with self affecting ATB not showing up properly.
 * 2015-11-02-1350: Turn Prediction interface now reacts to the player hovering over skills that interact with the ATB system (as long as they do it via Notes). (Work in Progress)
 * 2015-11-02-1123: Added option to resize Skill/Item window when using Turn Order Predction, so it stays visible.
 * 2015-11-02-1026: Added option to hide ATB gauge.
 * 2015-11-02-1026: Added instant ATB mode.
 * 2015-11-02-0959: Added configurable opacity gradient for the turn order display.
 * 2015-11-02-0959: Added option to invert CTB display to Right-to-Left.
 * 2015-11-02-0639: Fixed CTB bugs related to dead monsters and actors resulting in incorrect predictions. No dead battler will show up on the bar for now, an option will be given to show them if wanted, in the future.
 * 2015-11-02-0639: Can now use the [Note] field for ATB formulas. SEE HELP.
 * 2015-10-31-1416: Fixed a stepping forward bug when multiple actors filled their AT at the same time (they all stepped forward).
 * 2015-10-31-1416: Made forward stepping optional.
 * 2015-10-31-1254: Added a Average Turn Timer parameter. It overrides the Turn Timer when used. It's ON by default.
 * 2015-10-31-1208: Made the stepping forward animation compatible with YEP_BattleEngineCore.
 * 2015-10-31-0325: Monsters now properly show their name instead of their Battler Image name in CTB.
 * 2015-10-31-0325: Characters now step forward when its their turn.
 * 2015-10-30-0404: Major overhaul on how status are handled. See HELP.
 * 2015-10-30-0147: Added parameters for SE playability. Check HELP.
 * 2015-10-30-0021: Rebalanced the duration of status effects
 * 2015-10-29-2330: Added parameters for gauge positions (thanks, djDarkX)
 * 2015-10-28-2300: Implemented iavra's workaround to get parameters without depending on filename.
 * 2015-10-28-2300: Added Gauge Color parameters
 * 2015-10-28-2300: Added Turn Order Prediction interface (WORK IN PROGRESS)
 * Added parameter for random starting ATB bonus.
 * Pre-emptive and surprise attack now function properly.
 * Added starting ATB parameter based on AGI.
 * Fixed battle events set to fire on turn 0+0 not firing (thanks, Kistulot)
 * Fixed dead battlers still gaining ATB.
 * Added the option to display Fight/Escape window.
 * Added a parameter for the gauge name.
 * Added a parameter that allows the developer to select if At-End-Of-Turn effects should happen after an actor takes its action, or for everyone at the end of Turn Timer. (thanks, atreyoray)
 * Corrected a few bugs regarding monsters with the same agility not attacking;
 * Corrected a few bugs regarding Auto-Battle;
 * Corrected a few bugs regarding Status Effects that happened per turn.
 
Download:
 
http://pastebin.com/fhGC2Sn7
 
Last edited by a moderator:

MuteDay

Mutation Engine
Veteran
Joined
Oct 19, 2015
Messages
253
Reaction score
39
First Language
English
awsome thank you for the code, and almost witching time here
 

Prescott

argggghhh
Veteran
Joined
Aug 28, 2014
Messages
478
Reaction score
369
First Language
English
Primarily Uses
RMMV
Aha this is perfect! Simple and just what we need.

Thank you very much for this :)
 

Clord

Nya~
Veteran
Joined
Aug 5, 2012
Messages
2,376
Reaction score
394
Primarily Uses
Hmm, it doesn't try to pretend that there are turns. At least what I tested.


Kind of breaks certain ways of trigger stuff during a combat.
 

Blue001

Veteran
Veteran
Joined
Jan 13, 2014
Messages
231
Reaction score
111
First Language
English
Primarily Uses
RMMV
What's the compatibility with other Battle plugins like?

How about with Yanfly Battle Core?
 

MuteDay

Mutation Engine
Veteran
Joined
Oct 19, 2015
Messages
253
Reaction score
39
First Language
English
Hmm, it doesn't try to pretend that there are turns. At least what I tested.

Kind of breaks certain ways of trigger stuff during a combat.
it does but you have to adjust the settings
 

Mellye

Veteran
Veteran
Joined
Oct 24, 2015
Messages
347
Reaction score
278
First Language
Portuguese
Oh, forgot to mention in the OP, you need to save it as "EllyeSimpleATB.js"; file names are important for the parameters to work properly.

Hmm, it doesn't try to pretend that there are turns. At least what I tested.

Kind of breaks certain ways of trigger stuff during a combat.
What happened? As far as I tested, it seemed to work (I tested Battle Events that would fire every 3 turn, tested the duration of status effects, and monsters that would use certain skills after N turns --- but maybe I missed something).

What's the compatibility with other Battle plugins like?How about with Yanfly Battle Core?
It probably will break something, I haven't taken a look yet.
 
Last edited by a moderator:

GeorgeTheUnseen

Dunk my Soul
Veteran
Joined
Nov 20, 2014
Messages
60
Reaction score
19
First Language
English
Primarily Uses
N/A
Alright so I've noticed that when a character has some form of Regen effect on (Like HP Regen) they regenerate their HP/MP/TP everytime a unit performs an action.

This is kinda bothersome really. I'm messing with the settings to see if I can stop it but I'm not sure where to begin >: ....
 

fm2107

Veteran
Veteran
Joined
Jun 12, 2014
Messages
77
Reaction score
19
First Language
english
Oh, forgot to mention in the OP, you need to save it as "EllyeSimpleATB.js"; file names are important for the parameters to work properly.

What happened? As far as I tested, it seemed to work (I tested Battle Events that would fire every 3 turn, tested the duration of status effects, and monsters that would use certain skills after N turns --- but maybe I missed something).

It probably will break something, I haven't taken a look yet.
hasn't broken anything yet, just tested with yep core/battle/core and all three action sequence packs, the action happens as soon as its chosen per actor  which is pretty cool 

and they for commenting the code, really lets ppl learn how to use js for mv 
 
Last edited by a moderator:

Mellye

Veteran
Veteran
Joined
Oct 24, 2015
Messages
347
Reaction score
278
First Language
Portuguese
I just noticed a cool "unintended feature" of my script:

It's really easy to make skills that interact with the ATB system, via the "Formula" field in the database editor, by using the ".atb" property.

A full ATB gauge is 50000 (sorry for using such an arbitrary value), and you can add or subtract from it freely.

For example:

To make a "Quick Strike" skill you can add:

a.atb+=25000;

At the beginning of the formula.

To make a "Tiresome" skill, you can add:

a.atb-=25000;

At the beginning of the formula.

To make a skill that increases the ATB gauge of another ally:

b.atb+=25000;

At the beginning of the formula.

To make a skill that decreases the ATB gauge of the target:

b.atb-=25000;

At the beginning of the formula.

All of those examples use half of a full ATB gauge as a example value, but it doesn't even have to be a fixed number - you can make it depend on damage dealt or such, if you so wish (by using the same formula you use for damage as part of the expression).

Alright so I've noticed that when a character has some form of Regen effect on (Like HP Regen) they regenerate their HP/MP/TP everytime a unit performs an action.

This is kinda bothersome really. I'm messing with the settings to see if I can stop it but I'm not sure where to begin >: ....
Thanks for noticing! I think I know why this is happening, I'll take a look.

Edit: Done, I believe this is fixed now. I'll try to see if any other bugs arrived from that.

I've also noticed a bug with characters set to Auto-Battle (they keep acting all the time). I'll try to fix it soon.

Edit: Fixed too, it seems.
 
Last edited by a moderator:

lucien

Villager
Member
Joined
May 14, 2012
Messages
9
Reaction score
7
First Language
German
Primarily Uses
Hi Mellye,

This is fantastic, espacially the "unintended feature is just what I was looking for :)

Thank you very much!

I just have one visual input: When you increase or decrease the atb in the damage formula, the atb gauge will be emptied before the skill action and the additionel increase or decrease will be desplayed after the skill action. It would look much better if this would happen at the same time. This would mean that the line "this._subject.atb -= full_atb" should be effective after the skill action and not before. Would that be possible?
 

atreyoray

Veteran
Veteran
Joined
Mar 16, 2013
Messages
38
Reaction score
88
First Language
Portuguese
Hey, first I'd like to thank you for this WONDERFUL plugin. I'm making some changes to it in my project to fit my needs (I hope you don't mind me doing so... You make it SO EASY to add cast time/cast bar to skills with it!).

Anyway, while I was doing it, I noticed that even if I set a state's 'Auto Removal Timing' to 'Turn End', it would work as if I had set it to 'Action End', meaning that a state with a 'Duration in Turns' 1 ~ 1, for instance, would only be erased after the battler has acted, and not after the 'turn_atb' reaching 'full_atb' (to indicate that a "virtual" turn has passed).

To fix it, I added these lines:

this.allBattleMembers().forEach(function(battler) {    battler.onTurnEnd();    this.refreshStatus();    this._logWindow.displayAutoAffectedStatus(battler);    this._logWindow.displayRegeneration(battler);}, this);right after

$gameTroop.increaseTurn();

within the 'if' scope inside the 'BattleManager.increaseAtbGauges' method.

This way, all the battlers get their states and regeneration refreshed at TurnEnd.

However, I had to remove similar lines that were causing the issue, so I rewrited your 'BattleManager.endTurn' method to:

BattleManager.endTurn = function() {    this._phase = 'turnEnd';    this._preemptive = false;    this._surprise = false;}So far I have tested and I guess now it works as GeorgeTheUnseen wanted. I've tried looking for bugs or inconsistencies that these changes might have caused, but It's working fine for me.

PS.: If posting changes to your code is unwanted, I'll gladly remove this post asap, followed by with my sincere apologies.
 
Last edited by a moderator:

Mellye

Veteran
Veteran
Joined
Oct 24, 2015
Messages
347
Reaction score
278
First Language
Portuguese
Hey, first I'd like to thank you for this WONDERFUL plugin. I'm making some changes to it in my project to fit my needs (I hope you don't mind me doing so... You make it SO EASY to add cast time/cast bar to skills with it!).

Anyway, while I was doing it, I noticed that even if I set a state's 'Auto Removal Timing' to 'Turn End', it would work as if I had set it to 'Action End', meaning that a state with a 'Duration in Turns' 1 ~ 1, for instance, would only be erased after the battler has acted, and not after the 'turn_atb' reaching 'full_atb' (to indicate that a "virtual" turn has passed).

To fix it, I added these lines:

this.allBattleMembers().forEach(function(battler) {    battler.onTurnEnd();    this.refreshStatus();    this._logWindow.displayAutoAffectedStatus(battler);    this._logWindow.displayRegeneration(battler);}, this);right after

$gameTroop.increaseTurn();

within the 'if' scope inside the 'BattleManager.increaseAtbGauges' method.

This way, all the battlers get their states and regeneration refreshed at TurnEnd.

However, I had to remove similar lines that were causing the issue, so I rewrited your 'BattleManager.endTurn' method to:

BattleManager.endTurn = function() {    this._phase = 'turnEnd';    this._preemptive = false;    this._surprise = false;}So far I have tested and I guess now it works as GeorgeTheUnseen wanted. I've tried looking for bugs or inconsistencies that these changes might have caused, but It's working fine for me.

PS.: If posting changes to your code is unwanted, I'll gladly remove this post asap, followed by with my sincere apologies.
Thanks for noticing this! I'll keep in mind to fix it on my own code too. Do status effects marked to happen "per action" still happen as intended after those changes? I'd imagine that yes, so that's great!

I'm currently also working on a more customizable script to allow for ATB, CTB (Final Fantasy X) and a few other stuff (like skills with Casting Times and Interrupts that can break those). But I do intend to keep this simple version updated too, as I'm a fan of simple plug'n'play stuff, so I do appreciate the effort to find (and even fix!) bugs.
 
Last edited by a moderator:

Edelplastic

Villager
Member
Joined
Jun 21, 2015
Messages
19
Reaction score
5
First Language
German
Your Plugin is not in the Plugin-Manager after i have copy it to the Plugin-Folder ( Galv´s Plugin also isn´t there), what i doing wrong?

 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,129
Reaction score
12,405
First Language
English
Primarily Uses
RMMV
That isn't where plugins go.

If you want them to go into projects by default, you need to copy them into the NewData/js/plugins folder wherever MV is installed.

If you just want to add them to the project, you have to go into the project's folder and add them to the js/plugins folder.

I really don't know what folder that is that you've got there - it doesn't look like either of the required places.
 

Prescott

argggghhh
Veteran
Joined
Aug 28, 2014
Messages
478
Reaction score
369
First Language
English
Primarily Uses
RMMV
The folder you are trying to put them in is the plugins folder of the actual engine, not the game data.
 

Edelplastic

Villager
Member
Joined
Jun 21, 2015
Messages
19
Reaction score
5
First Language
German
Yes thank you, i already have notice that i have install the Yanfly Plugin to the Project-Folder, now i have do the same to your Plugin and it works -> Noob mistake ;D

But one more Question:

Can you edit your Plugin, that it works like the ATB System in Final Fantasy 7? I noticed that the ATB Bar load completely, then the Battlers have to wait for their actions. I mean that the first Battler do his Action, meanwhile he do it, i can not give Fight Commands to the other Battlers (i hope you understand what i want to say). I have to wait that the Move of the first Battler is finished, then i can give a command to the next Battler, but i want to give the commands to all Battlers after the ATB loading is finished (one Battler do his action and while them i want to give the next action command to the next Battler).
 
Last edited by a moderator:

Mellye

Veteran
Veteran
Joined
Oct 24, 2015
Messages
347
Reaction score
278
First Language
Portuguese
Yes thank you, i already have notice that i have install the Yanfly Plugin to the Project-Folder, now i have do the same to your Plugin and it works -> Noob mistake ;D

But one more Question:

Can you edit your Plugin, that it works like the ATB System in Final Fantasy 7? I noticed that the ATB Bar load completely, then the Battlers have to wait for their actions. I mean that the first Battler do his Action, meanwhile he do it, i can not give Fight Commands to the other Battlers (i hope you understand what i want to say). I have to wait that the Move of the first Battler is finished, then i can give a command to the next Battler, but i want to give the commands to all Battlers after the ATB loading is finished (one Battler do his action and while them i want to give the next action command to the next Battler).
So, being able to input actions while a turn is being processed. It sounds simple but it actually would require a bit of a more extended re-structuring of the combat flow.

I'll keep that in mind for a more complete plugin, as it would indeed make the battles less tiresome for the player.
 

Lunesis

Veteran
Veteran
Joined
Oct 4, 2015
Messages
34
Reaction score
6
First Language
English
Primarily Uses
This is the plugin everybody was looking for, so great job! I would like to know if it would be possible for the bars to wait until you are done picking your actions, so that you have a moment to think while also keeping the ATB system in place? I really like the idea of stacking agi to have a noticeable advantage, but also not feeling rushed while making tactical decisions.
 

hmind

Veteran
Veteran
Joined
Sep 30, 2015
Messages
74
Reaction score
33
First Language
German
it is working well so far. just one thing is a little confusing. when it is a battlers turn, he/she doesn't move a step forward.

i liked that step forward as a quick indication whose actions i'm gonna think of, without having to look for whose name is highlighted right now.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 2)

Latest Threads

Latest Profile Posts

Stream will be live shortly with some AI Dungeon! The chronicle of Scrapfly continues~ Feel free to drop by!
tfw, I found one of my skill ability in my game is not worth picking and had to plan to buff it. But my players seemed to use it without complaining. Now, idk if I should buff it or leave it as is.
I have recently discovered a Limit breaker for RPGmaker VXA, needless to say this changes everything.also I really like the changes this website has made.
It seems that my favorite anime page finally kicked the bucket... :,c

Forum statistics

Threads
97,772
Messages
946,883
Members
128,984
Latest member
NexusExe
Top