- Joined
- May 28, 2018
- Messages
- 37
- Reaction score
- 2
- First Language
- English
- Primarily Uses
- RMMZ
Good afternoon/evening/morning.
I'm trying to find information in regards to trying to understand the code behind TBPS.
My end goal is to completely nix the relativity between the battlers, and instead have a single variable/value that is static that the battler's speeds becomes relative to e.g. this value is set to X and rate of which the TBPS gauges fill up are checked against X rather than each other. As an extension of this, I was also trying to figure out how to specifically have state's turn count decay also relative to this universal value of which gauges are relative to (rather than states decaying based on the battler; also for design purposes.)
I thought this might go in the JS boards but it seems the JS boards are primarily made for plugins and I'm not trying to make a plugin but rather edit rmmz_objects.js to get the results I'm looking for (though I'm not sure if the states decaying based on something not related to battlers is something that can be directly editted or if it requires a plugin)
Despite that if this belongs somewhere else that's fine. I'm mostly just looking to learn the logic because i cant seem to connect the dots between the code block up there in regards to what each method does exactly and how they not only influence each other, but how they work together, and how they contribute to TBPS's gauge.
I'm trying to find information in regards to trying to understand the code behind TBPS.
JavaScript:
Game_Battler.prototype.tpbAcceleration = function() {
const speed = this.tpbRelativeSpeed();
const referenceTime = $gameParty.tpbReferenceTime();
return speed / referenceTime;
};
Game_Battler.prototype.tpbRelativeSpeed = function() {
return this.tpbSpeed() / $gameParty.tpbBaseSpeed();
};
Game_Battler.prototype.tpbSpeed = function() {
return Math.sqrt(this.agi) + 1;
};
Game_Battler.prototype.tpbBaseSpeed = function() {
const baseAgility = this.paramBasePlus(6);
return Math.sqrt(baseAgility) + 1;
};
Game_Battler.prototype.tpbRequiredCastTime = function() {
const actions = this._actions.filter(action => action.isValid());
const items = actions.map(action => action.item());
const delay = items.reduce((r, item) => r + Math.max(0, -item.speed), 0);
return Math.sqrt(delay) / this.tpbSpeed();
My end goal is to completely nix the relativity between the battlers, and instead have a single variable/value that is static that the battler's speeds becomes relative to e.g. this value is set to X and rate of which the TBPS gauges fill up are checked against X rather than each other. As an extension of this, I was also trying to figure out how to specifically have state's turn count decay also relative to this universal value of which gauges are relative to (rather than states decaying based on the battler; also for design purposes.)
I thought this might go in the JS boards but it seems the JS boards are primarily made for plugins and I'm not trying to make a plugin but rather edit rmmz_objects.js to get the results I'm looking for (though I'm not sure if the states decaying based on something not related to battlers is something that can be directly editted or if it requires a plugin)
Despite that if this belongs somewhere else that's fine. I'm mostly just looking to learn the logic because i cant seem to connect the dots between the code block up there in regards to what each method does exactly and how they not only influence each other, but how they work together, and how they contribute to TBPS's gauge.