Status
Not open for further replies.

ethervagabond

Veteran
Veteran
Joined
Aug 20, 2018
Messages
34
Reaction score
7
First Language
English
Primarily Uses
RMMV
Hi, does anyone know of a plugin for MV that can change the name (and changing the color would be nice too, but I'll settle for just the name if I have to) of the MP gauge for some actors, but not all of them? Obviously I know I can change the name of it for all actors in the system menu, but I want to change it for certain ones, like, let me have magic users gauge still be called MP, but have Warrior type characters' gauges be called Stamina. And I don't want to use the TP gauge as a stamina gauge, cause I want to use it for something else. Yanfly's Skill core let's you hide gauges and swap them around, but so far I can't find a plugin or function that'll just let you change the name of the gauge for certain actors.

PS-sorry if this question is in the wrong place. I rarely post here as this forum confuses the hell out of me lol
 

ST0RMTiger

Veteran
Veteran
Joined
Sep 17, 2021
Messages
38
Reaction score
30
First Language
German
Primarily Uses
RMMZ
Hey @ethervagabond,

managed to to that :cool:

ActorMPGaugeNames.PNG

oh and it even is working in the menu:
1632821869888.png

Do you have additional suggestions / wishes for that plugin?

So it noone replies that a plugin already exists, I will release it (after i did all the overhead stuff to complete it).

Best wishes,
ST0RMTiger
 
Last edited:

ST0RMTiger

Veteran
Veteran
Joined
Sep 17, 2021
Messages
38
Reaction score
30
First Language
German
Primarily Uses
RMMZ
So.... couldn't help myself and wrote the plugin ^^

You can configure it like this:
ActorMPGaugeNames_PluginConfig.PNG
For each Actor that you want to customize, make a new Entry and define all the values that you will be asked for. The Actor can be chosen as defined in the Database, color numbers are the same as for text colors like everywhere in the maker and the rest should be self explaining.

The only thing for me is, that is doesn't quite look very nice. But that'd be also the case when you name "MP" to "Stamina" or "Evilness" as in my example here. That is just how the standard menus of the maker look like...
ActorMPGaugeNames_2.PNG

Please just try it out and give me feedback what to change before if i release it somewhere.

And everybody else: Please tell us, if you found a similar plugin somewhere else. I do not want to double release a plugin that already existed.

To try it out, just copy this code to a file named exactly as "ST0RM_ActorMPGaugeNames.js" (without the quotes of course) and save it in your project JS/plugins folder.

JavaScript:
//=============================================================================
// ST0RMTiger - ActorMPGaugeNames
// ST0RM_ActorMPGaugeNames.js
//=============================================================================

  var Imported = Imported || {};
  Imported.ST0RM_ActorMPGaugeNames = true;

  var ST0RM = ST0RM || {};
  ST0RM.ActorMPGaugeNames = ST0RM.ActorMPGaugeNames || {};

//=============================================================================
 /*:
 * @plugindesc v0.0.1
 * Choose Names for MP Gauge for each Actor
 *
 * @author ST0RMTiger
 *
 * @param Region 1
 * @parent ---Regions 1 to 20---
 * @type boolean
 * @desc Set region to trigger RegionEvents only at Button OK.
 * @default false
 *
 * @param ActorMPGaugeConfig
 * @type struct<Actor>[]
 *
 * @help
 * ============================================================================
 * Introduction and Instructions
 * ============================================================================
 *
 * This plugin lets you Choose Names for MP Gauge for each Actor.
 *
 * Define Names in the Plugin Parameters using the Actor IDs from the Database.
 *
 * ============================================================================
 * Notetags
 * ============================================================================
 *
 * none
 *
 * ============================================================================
 * Changelog
 * ============================================================================
 *
 * experimental Version 0.0.1
 * - First version of the plugin. Establishing base functionality.
 *
 *
 * ============================================================================
 * Warranty
 * ============================================================================
 *
 * No warranty at all! All use is in your own responsibility!
 *
 * ============================================================================
 * License
 * ============================================================================
 *
 * You may use this plugin in every rpg maker project, even adult and commercial.
 *
 * You have to credit ST0RMTiger.
 *
 * You are not allowed to commercialize the plugin, only your game itself that
 * may use this plugin.
 *
 * All distributions, modifications etc. of this plugin has to keep the information
 * written here and has to keep the license conditions and attribution of ST0RMTiger.
 *
 */
/*~struct~Actor:
 * @param Actor
 * @type actor
 * @min 1
 * @max 1000
 * @default 0
 *
 * @param MPGaugeName
 * @type text
 * @default Name
 *
 * @param MPGaugeNameColor
 * @type number
 * @min 0
 * @max 31
 * @default 0
 *
 * @param MPGaugeGradientColor1
 * @type number
 * @min 0
 * @max 31
 * @default 0
 *
 * @param MPGaugeGradientColor2
 * @type number
 * @min 0
 * @max 31
 * @default 0
 */
//=============================================================================

//=============================================================================
// Parameter Variables
//=============================================================================

parameters = PluginManager.parameters('ST0RM_ActorMPGaugeNames');
ST0RM.ActorMPGaugeNames.PARAMS = parameters || {};

ST0RM.ActorMPGaugeNames.regionsOK = {};
for (let i = 1; i <= 255; ++i) {
  ST0RM.ActorMPGaugeNames.regionsOK[i] =
    ST0RM.ActorMPGaugeNames.PARAMS[String('Region ' + String(i))] === 'true';
};

//=============================================================================
// Window_Base
//=============================================================================

/*
Window_Base.prototype.drawActorMp = function(actor, x, y, width) {
    width = width || 186;
    var color1 = this.mpGaugeColor1();
    var color2 = this.mpGaugeColor2();
    this.drawGauge(x, y, width, actor.mpRate(), color1, color2);
    this.changeTextColor(this.systemColor());
    this.drawText(TextManager.mpA, x, y, 44);
    this.drawCurrentAndMax(actor.mp, actor.mmp, x, y, width,
                           this.mpColor(actor), this.normalColor());
};
*/

const myMPGaugeName = 'Stamina';
const myMPGaugeNameColor = 20;
const myMPGaugeGradientColor1 = 19; //22
const myMPGaugeGradientColor2 = 18; //23

ST0RM.ActorMPGaugeNames.actorParams = function(actor_id) {
    actors_params = JSON.parse(ST0RM.ActorMPGaugeNames.PARAMS.ActorMPGaugeConfig);
    for (const key in actors_params) {
        if (Object.hasOwnProperty.call(actors_params, key)) {
            const element = actors_params[key];
            actor_params = JSON.parse(element);
            if(actor_params.Actor === String(actor_id)) {
                return actor_params;
            }
        }
    }
}

ST0RM.ActorMPGaugeNames.former_Window_Base_drawActorMp = Window_Base.prototype.drawActorMp;
Window_Base.prototype.drawActorMp = function(actor, x, y, width) {
    // Note for further improvement:
    // If this would be a performance issue, parse everything in a separete list with
    // actor_ids as keys at game start and use this for return of actor_parameters
    const actorParams = ST0RM.ActorMPGaugeNames.actorParams(actor._actorId);
    
    if(actorParams) {
        // call my function for the actors with special definitions
        this.drawCustomizedActorMp(actor, x, y, width, actorParams);
    } else {
        // call standard function for the rest
        ST0RM.ActorMPGaugeNames.former_Window_Base_drawActorMp.call(this, actor, x, y, width);
    }

};

// Introducing a new function
Window_Base.prototype.drawCustomizedActorMp = function(actor, x, y, width, actorParams) {
    console.log(actorParams);
    width = width || 186;
    var color1 = this.textColor(actorParams.MPGaugeGradientColor1);
    var color2 = this.textColor(actorParams.MPGaugeGradientColor2);
    this.drawGauge(x, y, width, actor.mpRate(), color1, color2);
    this.changeTextColor(this.textColor(actorParams.MPGaugeNameColor));
    this.drawText(actorParams.MPGaugeName, x, y, 44);
    this.drawCurrentAndMax(actor.mp, actor.mmp, x, y, width,
    this.mpColor(actor), this.normalColor());
}

//=============================================================================
// End of File
//=============================================================================

As for the case someone wants to use it as is:

License:
* You may use this plugin in every rpg maker project, even adult and commercial.
*
* You have to credit ST0RMTiger.
*
* You are not allowed to commercialize the plugin, only your game itself that
* may use this plugin.
*
* All distributions, modifications etc. of this plugin has to keep the information
* written here and has to keep the license conditions and attribution of ST0RMTiger.

Best,
ST0RMTiger
 

Attachments

  • ActorMPGaugeNames_PluginConfig.PNG
    ActorMPGaugeNames_PluginConfig.PNG
    108.8 KB · Views: 3
Last edited:

ethervagabond

Veteran
Veteran
Joined
Aug 20, 2018
Messages
34
Reaction score
7
First Language
English
Primarily Uses
RMMV
So.... couldn't help myself and wrote the plugin ^^

Holy crap! Thank you so much! Awesome!

Please just try it out and give me feedback what to change before if i release it somewhere.

I will do so. Thanks again!

EDIT: so it works perfectly, it's even compatible with VictorEngine's Control Text plugin, which allows you to use escape codes anywhere (like so I can rename the gauges icons instead of using text if I wish by naming it like \i[283] or something).
The only thing doesn't seem to be compatible with is the function in Yanfly's Skill Core that allows you to swap your gauges around, as it seems to change gauge 2 no matter where you have them arranged with the swap function, and also turn gauge 2 into an MP gauge. So like, if I have a character that I want to have his TP gauge before his Stamina gauge, my thinking would be to use your plugin to rename his MP gauge to Stamina, then use Yanfly's Skill Core to swap his MP and TP gauges. What happens instead though, is that when I set it up like this, the actor's stamina gauge (which has the functionality of an MP gauge, not a TP gauge) appears first, and then he just has another MP gauge which is just a regular MP gauge.

I can live with this, though, I only bring it up because you asked. If it tickles your fancy to make it compatible with the function in Yanfly's Skill Core that allows you to swap gauges around, I would love that, but if not, I can live with it as is. I would much rather have the ability to rename and recolor my gauges than have the ability to swap gauges around. So, once again, thank you so much!!
 
Last edited:

ST0RMTiger

Veteran
Veteran
Joined
Sep 17, 2021
Messages
38
Reaction score
30
First Language
German
Primarily Uses
RMMZ
You're welcome!

So with that Yanfly Plugin... as many people use these (for now i don't), i would like to give it a try.

Though i have to admit, that Yanfly obviously saw this problem coming as he states in his plugin help section:
"This plugin also lets you swap around the HP, MP, and TP Gauges to any order
you want assuming that all the plugins you use will keep the same order of
HP, MP, and TP and does not override the default gauge drawing process. If
you use any plugin extensions, they can be swaped in as well."

Could you please make a screenshot of your plugin configurations (so if i read it right, the skill window with the tag you used for the class AND the plugin parameters window).

That would really help to try to reproduce the issue. That i can try to fix it ;)

Best,
ST0RMTiger
 
Last edited:

ethervagabond

Veteran
Veteran
Joined
Aug 20, 2018
Messages
34
Reaction score
7
First Language
English
Primarily Uses
RMMV
You're welcome!

So with that Yanfly Plugin... as many people use these (for now i don't), i would like to give it a try.

Though i have to admit, that Yanfly obviously saw this problem coming as he states in his plugin help section:
"This plugin also lets you swap around the HP, MP, and TP Gauges to any order
you want assuming that all the plugins you use will keep the same order of
HP, MP, and TP and does not override the default gauge drawing process. If
you use any plugin extensions, they can be swaped in as well."

Could you please make a screenshot of your plugin configurations (so if i read it right, the skill window with the tag you used for the class AND the plugin parameters window).

That would really help to try to reproduce the issue. That i can try to fix it ;)

Best,
ST0RMTiger
I certainly will. Unfortunately I'm now at work, so it will be a few hours.
 

ST0RMTiger

Veteran
Veteran
Joined
Sep 17, 2021
Messages
38
Reaction score
30
First Language
German
Primarily Uses
RMMZ
Hmmm... so i tried it out so far (without knowing your exact configuration) and I ended up with everything perfect:
1632838200674.png

Is this not what you wanted?

I wrote
<Swap Gauge 2: TP>
<Swap Gauge 3: MP>
to class of Therese.

The TP gauge is still TP but shown before the "MP" aka Evilness gauge.


EDIT:
I had an idea that it might be just a question of plugin order. And YES:

I got
1632838733484.png

if i had my plugin below yanfly's plugin.

So this makes sense, as if you put the YEP-Plugin BELOW my plugin, it swaps around what i created. If you put it the other (wrong) way with my plugin below the YEP plugin, my plugin changes gauge 2 still (as you correcly pointed out) and this would be the TP gauge then. This is not due to my plugin but due to the YEP plugin changing around things only on screen but not REALLY.

So you'd have 2 options:
1) put my plugin above the YEP-Plugin (recommended)
2) Change the color and name of the TP gauge and not the MP gauge (of course this would push me against making it possible to change also the TP gauge ;))
 
Last edited:

ethervagabond

Veteran
Veteran
Joined
Aug 20, 2018
Messages
34
Reaction score
7
First Language
English
Primarily Uses
RMMV
Hmmm... so i tried it out so far (without knowing your exact configuration) and I ended up with everything perfect:
View attachment 202606

Is this not what you wanted?

I wrote
<Swap Gauge 2: TP>
<Swap Gauge 3: MP>
to class of Therese.

The TP gauge is still TP but shown before the "MP" aka Evilness gauge.
Yes that's exactly what I was looking for. Did you change something or is that how it works with the version you released earlier for you?
 

ST0RMTiger

Veteran
Veteran
Joined
Sep 17, 2021
Messages
38
Reaction score
30
First Language
German
Primarily Uses
RMMZ
I edited my post, while you wrote. It is an issue of plugin order. Please read above again.
 

ethervagabond

Veteran
Veteran
Joined
Aug 20, 2018
Messages
34
Reaction score
7
First Language
English
Primarily Uses
RMMV
I edited my post, while you wrote. It is an issue of plugin order. Please read above again.
Oh yeah, I didn't try putting it above because I thought maybe it would override the swap function, but looks like it's the other way round. Can't wait to get home and try it out!
 

Sword_of_Dusk

Keyblade Master
Veteran
Joined
Sep 13, 2015
Messages
388
Reaction score
421
First Language
English
Primarily Uses
RMMV
If STORMTiger's doesn't end up working perfectly, this one is supposed to work with Skill Core exactly as you want.

 

ethervagabond

Veteran
Veteran
Joined
Aug 20, 2018
Messages
34
Reaction score
7
First Language
English
Primarily Uses
RMMV
If STORMTiger's doesn't end up working perfectly, this one is supposed to work with Skill Core exactly as you want.
lol ST0RMTiger, looks like you made it for nothing after all. I swapped the order though and it works great. Thanks again!
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,210
Reaction score
1,175
First Language
English
Primarily Uses
RMMV
Well, it's not the same as the NeMV plugin is connected to classes, whereas your request was that it be by actor. That might work interchangeably for your game, but it's still a good addition.
 

ST0RMTiger

Veteran
Veteran
Joined
Sep 17, 2021
Messages
38
Reaction score
30
First Language
German
Primarily Uses
RMMZ
Yeah see, it is exactly as @ATT_Turan said. (Thank you for that!)

@ethervagabond: Additionally, i learned a lot going through this task. AND it was fun! So it was not for nothing even without the difference between both plugins that of course still exists after all.

If you keep it accurate, my plugin fulfills the task and NeMV doesn't because of the class / actor difference. But I also agree with @Sword_of_Dusk though, that for most people the NeMV plugin does the trick. Thank you for posting that! (And by the way, is there a list of plugins somewhere that can be better searched as hoping to find something in the forum?)

EDIT Sep 29, 2021: NeMV doesn't let you change text colors. If you need that stick to my plugin. I will release an updated version soon. Additionally, i will include a function to change the number colors also. /EDIT

Stick to my version though if you need the change for an actor while another actor of the same class shall have a different customization. Of course you can just make a new class and still use NeMV, but if you want to keep both classes synchronized in all other parameters, my version can be easier to go. Additionally my plugin deals with the defined maker colors instead of hex colors. This is more a side issue but it could be easier to keep a consistent look and feel.

If someone reads this and still needs the upgrade of my version also for HP and TP, just message me.
(Moreover, while i read the source code of NeMV and realized there could be an issue with the battle log not being correct with my plugin. If someone needs my version and has trouble with this issue, please message me, too.)

@ethervagabond: If your problem has been solved, please report this thread as "solved".

Best wishes,
ST0RMTiger
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,210
Reaction score
1,175
First Language
English
Primarily Uses
RMMV
(And by the way, is there a list of plugins somewhere that can be better searched as hoping to find something in the forum?)
Not an intact/accurate one that I know of. But, along those lines, you should put yours in a plugin release thread in case it's useful to anyone else in the future.
 

ST0RMTiger

Veteran
Veteran
Joined
Sep 17, 2021
Messages
38
Reaction score
30
First Language
German
Primarily Uses
RMMZ
Not an intact/accurate one that I know of.
That's a pitty. I have an idea to to that AND to keep it up to date automatically. But that would be a major project. In short: Writing some webapp where everyone can upload their plugins and these are automatically stored in a database with some meta, generated from the help-sections within the plugin. This way one could have found even "ClassTPRename" while searching for "Actor MP rename" because "MP" is a keyword inside that help section. Know someone who might be interested in setting that up?^^ I could help coding, but i don't wanna host that...


you should put yours in a plugin release thread in case it's useful to anyone else in the future
I might do that, not before i added HP and TP customization and looked at that "battle_log" issue.
 

ethervagabond

Veteran
Veteran
Joined
Aug 20, 2018
Messages
34
Reaction score
7
First Language
English
Primarily Uses
RMMV
@ethervagabond: If your problem has been solved, please report this thread as "solved".
How do I do that, exactly? You mean to click the little report button on my original post and just type in "solved?"
 

ST0RMTiger

Veteran
Veteran
Joined
Sep 17, 2021
Messages
38
Reaction score
30
First Language
German
Primarily Uses
RMMZ
How do I do that, exactly? You mean to click the little report button on my original post and just type in "solved?"
Exactly!


And for the end of this post, here is the latest version of my plugin with the battle_log working:
JavaScript:
//=============================================================================

// ST0RMTiger - ActorMPGaugeNames

// ST0RM_ActorMPGaugeNames.js

//=============================================================================



  var Imported = Imported || {};

  Imported.ST0RM_ActorMPGaugeNames = true;



  var ST0RM = ST0RM || {};

  ST0RM.ActorMPGaugeNames = ST0RM.ActorMPGaugeNames || {};



//=============================================================================

 /*:

 * @plugindesc v0.1.1

 * Customize Names and Colors for MP and it's Gauge for each Actor

 * (even in being in the same class!)

 *

 * @author ST0RMTiger

 *

 * @param Region 1

 * @parent ---Regions 1 to 20---

 * @type boolean

 * @desc Set region to trigger RegionEvents only at Button OK.

 * @default false

 *

 * @param ActorMPGaugeConfig

 * @type struct<Actor>[]

 *

 * @help

 * ============================================================================

 * Introduction and Instructions

 * ============================================================================

 *

 * This plugin lets you Choose Names for MP Gauge for each Actor.

 *

 * Define Names in the Plugin Parameters using the Actor IDs from the Database.

 *

 * ============================================================================

 * Notetags

 * ============================================================================

 *

 * For compatibility with YEP_SkillCore you have to put ST0RM_ActorGaugeNames

 * ABOVE the YEP_SkillCore plugin!

 * (Reason: The YEP-Plugin does some changes only on screen instead of

 * "really" changing gauges if you swap gauges with that plugin.

 * If you'd put the YEP plugin above this plugin and you are using the gauge

 * swapping function, you'd change the "wrong" gauges. This is NOT an issue of

 * THIS plugin.)

 *

 * ============================================================================

 * Changelog

 * ============================================================================

 * v0.1.1

 * - fixed the battle_log that was not showing the changed gauge names and

 * still wrote always "MP" if MP damage was taken.

 *

 * v0.1.0

 * - Plugin has been tested and functionality confirmed. Added note for order

 * with YEP_SkillCore to precent compatibility issue.

 *

 * experimental Version 0.0.1

 * - First version of the plugin. Establishing base functionality.

 *

 *

 * ============================================================================

 * Warranty

 * ============================================================================

 *

 * No warranty at all! All use is in your own responsibility!

 *

 * ============================================================================

 * License

 * ============================================================================

 *

 * You may use this plugin in every rpg maker project, even adult and commercial.

 *

 * You have to credit ST0RMTiger.

 *

 * You are not allowed to commercialize the plugin, only your game itself that

 * may use this plugin.

 *

 * All distributions, modifications etc. of this plugin has to keep the information

 * written here and has to keep the license conditions and attribution of ST0RMTiger.

 *

 */

/*~struct~Actor:

 * @param Actor

 * @type actor

 * @min 1

 * @max 1000

 * @default 0

 *

 * @param MPGaugeName

 * @type text

 * @default Name

 *

 * @param MPGaugeNameColor

 * @type number

 * @min 0

 * @max 31

 * @default 0

 *

 * @param MPGaugeGradientColor1

 * @type number

 * @min 0

 * @max 31

 * @default 0

 *

 * @param MPGaugeGradientColor2

 * @type number

 * @min 0

 * @max 31

 * @default 0

 */

//=============================================================================



//=============================================================================

// Parameter Variables

//=============================================================================



parameters = PluginManager.parameters('ST0RM_ActorMPGaugeNames');

ST0RM.ActorMPGaugeNames.PARAMS = parameters || {};



ST0RM.ActorMPGaugeNames.regionsOK = {};

for (let i = 1; i <= 255; ++i) {

  ST0RM.ActorMPGaugeNames.regionsOK[i] =

    ST0RM.ActorMPGaugeNames.PARAMS[String('Region ' + String(i))] === 'true';

};



//=============================================================================

// Window_Base

//=============================================================================



/* original function in "rpg_windows.js"

Window_Base.prototype.drawActorMp = function(actor, x, y, width) {

    width = width || 186;

    var color1 = this.mpGaugeColor1();

    var color2 = this.mpGaugeColor2();

    this.drawGauge(x, y, width, actor.mpRate(), color1, color2);

    this.changeTextColor(this.systemColor());

    this.drawText(TextManager.mpA, x, y, 44);

    this.drawCurrentAndMax(actor.mp, actor.mmp, x, y, width,

                           this.mpColor(actor), this.normalColor());

};

*/



const myMPGaugeName = 'Stamina';

const myMPGaugeNameColor = 20;

const myMPGaugeGradientColor1 = 19; //22

const myMPGaugeGradientColor2 = 18; //23



ST0RM.ActorMPGaugeNames.actorParams = function(actor_id) {

    actors_params = JSON.parse(ST0RM.ActorMPGaugeNames.PARAMS.ActorMPGaugeConfig);

    for (const key in actors_params) {

        if (Object.hasOwnProperty.call(actors_params, key)) {

            const element = actors_params[key];

            actor_params = JSON.parse(element);

            if(actor_params.Actor === String(actor_id)) {

                return actor_params;

            }

        }

    }

    return null;

}



ST0RM.ActorMPGaugeNames.former_Window_Base_drawActorMp = Window_Base.prototype.drawActorMp;

Window_Base.prototype.drawActorMp = function(actor, x, y, width) {

    // Note for further improvement:

    // If this would be a performance issue, parse everything in a separete list with

    // actor_ids as keys at game start and use this for return of actor_parameters

    let actorParams = ST0RM.ActorMPGaugeNames.actorParams(actor._actorId);

   

    if(actorParams) {

        // call my function for the actors with special definitions

        this.drawCustomizedActorMp(actor, x, y, width, actorParams);

    } else {

        // call standard function for the rest

        ST0RM.ActorMPGaugeNames.former_Window_Base_drawActorMp.call(this, actor, x, y, width);

    }



};



// Introducing a new function

Window_Base.prototype.drawCustomizedActorMp = function(actor, x, y, width, actorParams) {

    width = width || 186;

    var color1 = this.textColor(actorParams.MPGaugeGradientColor1);

    var color2 = this.textColor(actorParams.MPGaugeGradientColor2);

    this.drawGauge(x, y, width, actor.mpRate(), color1, color2);

    this.changeTextColor(this.textColor(actorParams.MPGaugeNameColor));

    this.drawText(actorParams.MPGaugeName, x, y, 44);

    this.drawCurrentAndMax(actor.mp, actor.mmp, x, y, width,

    this.mpColor(actor), this.normalColor());

}



//=============================================================================

// Window_BattleLog

//=============================================================================



/* original function in "rpg_windows.js"

Window_BattleLog.prototype.makeMpDamageText = function(target) {

    var result = target.result();

    var damage = result.mpDamage;

    var isActor = target.isActor();

    var fmt;

    if (damage > 0 && result.drain) {

        fmt = isActor ? TextManager.actorDrain : TextManager.enemyDrain;

        return fmt.format(target.name(), TextManager.mp, damage);

    } else if (damage > 0) {

        fmt = isActor ? TextManager.actorLoss : TextManager.enemyLoss;

        return fmt.format(target.name(), TextManager.mp, damage);

    } else if (damage < 0) {

        fmt = isActor ? TextManager.actorRecovery : TextManager.enemyRecovery;

        return fmt.format(target.name(), TextManager.mp, -damage);

    } else {

        return '';

    }

};

*/

ST0RM.ActorMPGaugeNames.former_Window_BattleLog_makeMpDamageText = Window_BattleLog.prototype.makeMpDamageText;

Window_BattleLog.prototype.makeMpDamageText = function(target) {

    if(target.isActor()) {

        let actorParams = ST0RM.ActorMPGaugeNames.actorParams(target._actorId) || null;

        console.log(target);

        console.log(actorParams);

        if(actorParams) {

            return this.makeCustomizedMpDamageText(target, actorParams);

        }

    }

    // in all other cases use the standard function

    return ST0RM.ActorMPGaugeNames.former_Window_BattleLog_makeMpDamageText.call(this, target);

}



// Introducing a new function

Window_BattleLog.prototype.makeCustomizedMpDamageText = function(target, actorParams) {

    var result = target.result();

    var damage = result.mpDamage;

    var isActor = true;

    var fmt;

    if (damage > 0 && result.drain) {

        fmt = isActor ? TextManager.actorDrain : TextManager.enemyDrain;

        return fmt.format(target.name(), actorParams.MPGaugeName, damage);

    } else if (damage > 0) {

        fmt = isActor ? TextManager.actorLoss : TextManager.enemyLoss;

        return fmt.format(target.name(), actorParams.MPGaugeName, damage);

    } else if (damage < 0) {

        fmt = isActor ? TextManager.actorRecovery : TextManager.enemyRecovery;

        return fmt.format(target.name(), actorParams.MPGaugeName, -damage);

    } else {

        return '';

    }

};



//=============================================================================

// End of File

//=============================================================================

The plugin now should completely work just fine for the Actor MP Gauge customization.

Compatibility with Yanfly Skill Core should also be no problem if you keep the plugin order as we have figured out above.

And for the last: If you like me to test your game sometime, I'd appreciate it. The sole need of this function that you requested sounds interesting enough to me and i'm a bit curious what exactly you plan to do with that ;) Good luck!

Best,
ST0RMTiger
 
Last edited:

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
9,003
Reaction score
5,891
First Language
Dutch
Primarily Uses
RMXP

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

Finally got my website fixed and the security sorted so it's been a productive day. Can I go to sleep now? I mean... I don't need to work right?
It's always a good idea to refresh yourself on what your plugins do. I'm working on a map with opening walls, and I was about to tear my hair out over how much image editing and hand-constructing of autotiles I'd have to do, when I looked again and saw @Shaz 's Tile Changer could copy areas from another map.
"sorry it took me so long to respond" - can we please agree not to say that anymore unless it actually took a long time?! (Like 36hrs at least) I mean, I'm running out of funny responses here xD
Ugh... 4:53AM over here and I can't sleep so why not just game make.
I just love the MV feature that allows you to create your own animations!

Forum statistics

Threads
115,914
Messages
1,093,996
Members
151,174
Latest member
sardin
Top