YEP.38 – Battle System – Charge Turn Battle

Yanfly Engine Plugins is a plugin library made for RPG Maker MV, a wonderful piece of software to help you make that role playing game of your dreams. You can find out more about RPG Maker MV here.

You can grab the plugin here:
English Dropbox
English Mirror

This plugin requires Battle Engine Core. The fabled Battle System – CTB! Battle participants are placed in a visible turn order based on their agility and speed. When it becomes their turn, they input an action and execute it immediately, then proceed back in line. The CTB system focuses heavily on turn manipulation to change the strategic flow of battle.

If you want to grab some nice icons for CTB to use, I highly recommend getting them from this thread found on RPG Maker Web! ūüėÄ

SUPPORT FOR CTB HAS BEEN DISCONTINUED BY YANFLY. Reasons are explained in this post. You can continue using it, but do not expect everything to work with it.


Introduction


The Battle System – Charge Turn Battle plugin is an extension plugin for¬†Yanfly Engine Plugins’ Battle Engine Core. This extension plugin will not¬†work without the main plugin.

To use the CTB system, go to the Battle Engine Core plugin and change the¬†‘Default System’ setting in the parameters to ‘ctb’.

The Charge Turn Battle system functions by calculating every battlers’ speed¬†and balancing them relative to one another. When it’s a battler’s turn, the¬†battler will either choose an action to perform immediately or charge it for¬†later depending if the skill requires charging.

This is a battle system where agility plays an important factor in the progress of battle where higher agility values give battlers more advantage and lower agility values give battlers less advantage.


Plugin Commands


To change your battle system to Charge Turn Battle if it isn’t the default¬†battle system, you can use the following Plugin Command:

Plugin Command:

setBattleSys CTB
Sets battle system to Charge Turn Battle.

setBattleSys DTB
Sets battle system to Default Turn Battle.

Using the above Plugin Commands, you can toggle between the Default Battle System and Charge Turn Battle!


Notetags


The following are notetags that pertain to and affect the CTB system.

Actor and Enemy Notetags:
<CTB Icon: x>
This sets the icon used for the actor/enemy to be x.

<CTB Border Color: x>
This sets the border color used for the actor/enemy to text color x.

<CTB Background Color: x>
This sets the background color used for the actor/enemy to text color x.

Skill and Item Notetags:
<CTB Help>
text
text
</CTB Help>
For those planning on using multiple battle systems, sometimes you may have your skills perform differently while using CTB. If so, using this notetag will allow skills and items to display different help text while CTB is enabled.

<CTB Speed: x>
Usable only during CTB. This sets the target’s current speed to x.

<CTB Speed: x%>
Usable only during CTB. This sets the target’s current speed to x% of¬†the CTB turn completion target.

<CTB Speed: +x>
<CTB Speed: -x>
Usable only during CTB. This increases or decreases the target’s current¬†speed by x.

<CTB Speed: +x%>
<CTB Speed: -x%>
Usable only during CTB. This increases or decreases the target’s current¬†speed or charge by x% of the CTB turn completion target.

<CTB Order: +x>
<CTB Order: -x>
Moves target’s position in the turn order by +x or -x. +x will make the¬†target having to wait more before getting their turn while -x will make¬†the target having to wait less. The effect is minimal and will only last¬†for the current turn cycle.
* Note: If you use this for multiple targets, each target will shift turns individually at a time.

<After CTB: x>
<After CTB: x%>
This will set the skill/item user’s CTB speed value to x or x%. If ‘x’ is¬†used, this will be the exact CTB value. If x% is used, this will be the¬†percentage of the CTB turn completion target that it will be at.

Actor, Class, Enemy, Weapon, Armor, and State Notetags:
<CTB Start: +x>
<CTB Start: +x%>
Usable only during CTB. This will give the actor, class, enemy, weapon, armor, or state the property of starting battle with X CTB Speed or X% of the CTB turn completion target.

<CTB Turn: +x>
<CTB Turn: +x%>
Usable only during CTB. This will give the actor, class, enemy, weapon, armor, or state the property of starting a turn with X CTB Speed or X% of the CTB turn completion target.


Lunatic Mode – Conditional CTB Speed and Conditional CTB Charge


For those who have a bit of JavaScript experience and would like to have more unique ways of performing CTB speed and charge changes, you can use the following notetags:

Skill and Item Notetags:
<Target CTB Speed Eval>
speed = x;
charge = x;
</Target CTB Speed Eval>
You can omit speed and/or charge. Whatever you set ‘speed’ to will change¬†the CTB speed of the target. If the target is charging, ‘charge’ will¬†cause the target’s charge to change to that value. To make things more¬†simple, ‘max’ will be the full gauge value.

Here is an example:

<Target CTB Speed Eval>
speed = target.hp / target.mhp * max;
charge = target.hp / target.mhp * max;
</Target CTB Speed Eval>
The above code will set the user’s current CTB gauge to position equal to¬†the target’s HP ratio. If the target has 25% HP, the CTB gauge will go to¬†25% full for the target.

— — — — —

<Target CTB Order Eval>
order = x;
</Target CTB Order Eval>
Set the ‘order’ variable to how much you want to alter the target’s¬†current turn order by. If ‘order’ is positive, the order will need to wait¬†that many more turns before its turn comes up. If ‘order’ is negative, it¬†will will that amount of turns less before the order comes up.

Here is an example:

<Target CTB Order Eval>
if (target.hp > 1000) {
order = 3;
} else {
order = -1;
}
</Target CTB Order Eval>
If the target when attacked has over 1000 HP left, the target will have to wait 3 more turns before its turn arrives. If the target has 1000 or less, the target actually waits 1 less turn.

— — — — —

<After CTB Eval>
speed = x;
</After CTB Eval>
This is the CTB set after the user has used the skill/item and the custom¬†CTB amount you want the user to be at after. ‘max’ be the value of the¬†full gauge value. Whatever you set ‘speed’, the user’s CTB speed value¬†will change to that much:

Here is an example:

<After CTB Eval>
speed = user.mp / user.mmp * max;
</After CTB Eval>
The above code will set the user’s CTB gauge after using the skill/item to¬†equal the user’s MP ratio. If the user has 25% MP, the CTB gauge will go¬†to 25% full for the user.


Yanfly Engine Plugins – Battle Engine Extension – Action Sequence Commands


You can make use of these extra CTB related action sequences.


CTB ORDER: target, +X
CTB ORDER: target, -X
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Usable only for CTB. Moves target’s position in the turn order by +x or -x.¬†+x will make the target having to wait more before getting their turn while¬†-x will make the target having to wait less. The effect is minimal and will¬†only last for the current turn cycle.¬†* Note: If you use this for multiple targets, each target will shift turns¬†individually at a time.
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Usage Example: ctb order: target, -2
ctb order: target, +3


CTB SPEED: target, X
CTB SPEED: target, X%
CTB SPEED: targets, +X
CTB SPEED: targets, +X%
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Usable only for CTB. Sets the target’s CTB speed to X or X%. This only¬†applies when the target is filling up its CTB gauge. This will not affect¬†the user to prevent mechanical issues.
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Usage Example: ctb speed: targets, +5000
ctb speed: target, -50%


Happy RPG Making!


Happy RPG Making!


These plugins and Tips & Tricks ideas are made possible thanks to our creative patrons on Patreon! The majority of our Tips & Tricks ideas are placed within the Patreon-exclusive Sample Project for quick and easy access! If you'd like to make a Tips & Tricks suggestion, Yanfly's Patreon-based Suggestion Box a visit here:


If you have any bugs to report, visit the following link:


If you have any questions about Action Sequences, visit the following link:



Thank you!