TPX v1.0
Drakkonis
Introduction
This is a small little plugin made by request, but it's not too specific that others can't use it too. It simply converts the actor TP gauge into an EXP gauge.
Features
-Make the TP bar useful if you're not using the TP system.
-Two modes: Show current EXP value, or show the percentage towards the next level.
-No need to set any values or change actor TP charge rates, the gauge stays locked to the actor's experience.
How to Use
If you copy the code from below, save it in a file named Drak_TPX.js, and put it in your project's plugin folder and set it up like any other plugin. Alternatively, the file is included below for download.
In the parameters window, select which mode you'd like to use.
Make sure you have "Show TP in Window" checked in the options of the system tab.
You'll probably want to change the TP name setting to something more appropriate, like XP or EXP. Unless you WANT it to still say TP, of course.
Script
Spoiler: TPX Script
Code: - /*:
- @plugindesc Turns the TP bar into an EXP bar. Only use if you're not going to use the TP system at all.
- @author Drakkonis
- @param dispMode
- @type select
- @option Current EXP
- @option Percentage
- @text TP Guage Display
- @desc Do you want the gauge to display the EXP amount, or a percentage towards the next level?
- @default Current EXP
- */
- var Imported = Imported || {};
- Imported.Drak_TPX = true;
- var TPX = TPX || {};
- TPX.Parameters = PluginManager.parameters('Drak_TPX');
- TPX.mode = TPX.Parameters['dispMode'];
- const battler_refresh = Game_BattlerBase.prototype.refresh; //alias the original function, so we can call the original version
- Game_BattlerBase.prototype.refresh = function() {
- battler_refresh.call(this); //call the aliased (original) version of this function, since we're adding to it, not replacing it
- if (this.isActor()) {
- if (TPX.mode == "Current EXP") {
- this._tp = this.currentExp();
- } else if (TPX.mode == "Percentage") {
- this._tp = Math.round((this.currentExp() / this.nextLevelExp()) * 100);
- };
- };
- };
- Game_Actor.prototype.maxTp = function() {
- if (TPX.mode == "Current EXP") {
- return this.nextLevelExp();
- } else return 100;
- };
- Game_BattlerBase.prototype.isPreserveTp = function() { //allows you to see the right amount of xp outside of battle
- return true;
- };
- Sprite_Gauge.prototype.drawValue = function() {
- var val = this.currentValue();
- if (this._battler && this._statusType == "tp" && TPX.mode == "Percentage") {
- val += "%";
- };
- const currentValue = val;
- const width = this.bitmapWidth();
- const height = this.bitmapHeight();
- this.setupValueFont();
- this.bitmap.drawText(currentValue, 0, 0, width, height, "right");
- };
复制代码
FAQ
Post question and answers to common question here in the following format:
Q: Can I change the gauge color?
A: Not with this plugin, no. Maybe in the future if there's a need for it. In the meantime, any plugins that let you customize gauge colors should work just fine.
Q: How will this affect the TP system?
A: Since this only affects actors, it won't affect any TP system you have for enemies. And because this links an actor's TP to their EXP directly, you don't have to modify any TP costs/gains attached to items/skills, they won't have any actual effect on actors. This means that if you have a mechanic for enemies that DOES use the TP system, this shouldn't interfere with it.
Credit and Thanks
- Drakkonis, author
- Sirius270, who made the request. This plugin literally wouldn't exist otherwise. At least, not from me.
Author's Notes
I don't have MV, I have MZ. The request was for MV, and as far as I can tell, works just fine in both.
Side note, I find it hilarious that, with so many potential uses for the TP system, this plugin provides a use for the gauge by NOT using the TP system!
This plugin is free to use in any RPG Maker MV or MZ project, commercial or otherwise. No credit necessary, though would be appreciated!
本贴来自国际rpgmaker官方论坛作者:Drakkonis处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/turn-tp-bar-into-an-exp-bar.134864/