Ok, so I've recently come to the conclusion I'm going to have to write my own ATB/TPB system. This is mostly because I use LeTBS (LeCode's Tactical Battle System), which obviously makes all the available plugins incompatible. I've tried posting on Classifieds, but to no avail. The way I see it is, all the turn phases and unit turn code are already set up. I just need to replace LeTBS's default turn order formula. This is what's already there:
...where
Thus, I need to apply the ATB/TPB logic on the
So let's say we have 4 units in a battle; 2 actors & 2 enemies. They have the following SPEED (Luck):
Edit: It looks like
So I'm thinking...I need to have each unit start counting/incrementing a value equal to the unit's Speed ÷ the fastest unit's Speed. Whenever it crosses a whole number/integer, that'll be a turn. Or an action rather...a "turn" would occur once the # of actions equals the # of battlers, which is 4 in this example's case.
Edit2: I found these very informative threads!
forums.rpgmakerweb.com
forums.rpgmakerweb.com
JavaScript:
BattleManagerTBS.determineTurnOrderSimple = function () {
var array = [];
this._turnOrder = [];
this._activeIndex = 0;
this.allPlayableEntities().forEach(function (entity) {
array.push(entity);
});
array = array.sort(function (a, b) {
return eval(Lecode.S_TBS.turnOrderSortMethod);
});
this._turnOrder = array;
this._turnOrderVisual.set(this._turnOrder);
};
Lecode.S_TBS.turnOrderSortMethod is: b._battler.luk - a._battler.lukThus, I need to apply the ATB/TPB logic on the
._turnOrder array.So let's say we have 4 units in a battle; 2 actors & 2 enemies. They have the following SPEED (Luck):
- Actor1: 20
- Actor2: 12
- Enemy1: 10
- Enemy2: 18
Edit: It looks like
._activeIndex is what I need to manipulate. The default code simply has the index start at 0 (aka the fastest unit, which is the 1st in the array) and then increments from there, cycling back to 0 when it hits a value equal to the number of battlers.
JavaScript:
BattleManagerTBS.nextTurn = function () {
do {
this._activeIndex++;
if (this._activeIndex >= this._turnOrder.length) {
this._activeIndex = 0;
this.onTurnOrderEnd();
}
} while (this.activeEntity()._dead);
if (this.activeEntity().isTurnHidden()) {
this.nextTurn();
return;
}
this._turnOrderVisual.updateOnNextTurn(this._turnOrder, this._activeIndex);
this.startTurn();
};
So I'm thinking...I need to have each unit start counting/incrementing a value equal to the unit's Speed ÷ the fastest unit's Speed. Whenever it crosses a whole number/integer, that'll be a turn. Or an action rather...a "turn" would occur once the # of actions equals the # of battlers, which is 4 in this example's case.
Edit2: I found these very informative threads!
Basic knowledge on writing ATB(Active Time Battle) system plugins
Related topics Solid understanding on writing ATB(Active Time Battle) system plugins Thorough Comprehension on writing ATB(Active Time Battle) system plugins(Possibly upcoming) Goal Shares my experiences and understandings on writing a basic ATB system plugin and their addons...
forums.rpgmakerweb.com
Solid understanding on writing ATB(Active Time Battle) system plugins
Related topics Basic knowledge on writing ATB(Active Time Battle) system plugins Thorough Comprehension on writing ATB(Active Time Battle) system plugins(Possibly upcoming) Goal Shares my experiences and understandings on writing a decent ATB system plugin and their addons, meaning...
forums.rpgmakerweb.com