% next to TP?

Ichida za Zeal

Veteran
Veteran
Joined
Oct 23, 2015
Messages
69
Reaction score
7
First Language
English
I'm treating my TP meter in my game like a battery charge, so I would love to have a % next to all TP numbers in my game. Is there a way/plugin to do this?
 

Weremole

Veteran
Veteran
Joined
Jan 22, 2016
Messages
269
Reaction score
230
First Language
Swedish
Primarily Uses
Put it down by whatever term you're using for the thing in the Database?
 

WhiteW

The Murderous Clown
Veteran
Joined
Oct 16, 2016
Messages
170
Reaction score
127
First Language
EN/PT
Primarily Uses
RMMV
I don't know much JS and there's probably some other BETTER way to do it, but you can add this
Code:
    this.drawText('%', x, y, 64, 'right');
line after line 580 in your rpg_windows.js
or you can do like Weremole suggested it

TBH imo I would suggest using a fancy icon of a battery instead perhaps? There's probably a plugin somewhere that would allow that I think.

 
Last edited:

WhiteW

The Murderous Clown
Veteran
Joined
Oct 16, 2016
Messages
170
Reaction score
127
First Language
EN/PT
Primarily Uses
RMMV
Well, I want it to be like "21%"
Ops... I wasn't sure where the symbol would go, I'm half asleep, sorry.

Try this as line 581 and 582:

Code:
    this.drawText(actor.tp, x + width - 44, y, 44);
    this.drawText('%', x + width - 64, y, 64, 'right');



EDIT:

NO WAIT DO THIS INSTEAD As line 581, just that, without the other line

Code:
    this.drawText(actor.tp + '%', x + width - 64, y, 64, 'right');



Now the number doesn't float in the middle of the middle of everything if it's only 1 digit, yey

EDIT2:

im a mess
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,837
Reaction score
7,896
First Language
German
Primarily Uses
RMMV
@WhiteW @Ichida za Zeal
STOP

Editing the core files is a VERY BAD idea. Whenever a project gets updated to a new version those core files are overwritten, removing all changes.
And MV is still in support, so you can expect further updates beyond the current 1.6.2

Those updates are not automatic exactly because there are cases where people need to stay at older versions (for plugin compatibility for example), but artificially blocking yourself from updates is not a good idea.

All you need to do is to take the original function you want to modify and overwrite it with a plugin that contains such changes and no matter how the core files get updated the change would stay.
 

WhiteW

The Murderous Clown
Veteran
Joined
Oct 16, 2016
Messages
170
Reaction score
127
First Language
EN/PT
Primarily Uses
RMMV
@WhiteW @Ichida za Zeal
STOP

Editing the core files is a VERY BAD idea. Whenever a project gets updated to a new version those core files are overwritten, removing all changes.
And MV is still in support, so you can expect further updates beyond the current 1.6.2

Those updates are not automatic exactly because there are cases where people need to stay at older versions (for plugin compatibility for example), but artificially blocking yourself from updates is not a good idea.

All you need to do is to take the original function you want to modify and overwrite it with a plugin that contains such changes and no matter how the core files get updated the change would stay.

But what if something in the function gets changed in an update?
I get your point, although I'm not sure if it's really worth it for a change of only 6 extra characters that can be easily readded in case of update...
 
Last edited:

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,119
First Language
English
Primarily Uses
RMMV
I get your point, although I'm not sure if it's really worth it for a change of only 6 extra characters that can be easily readded in case of update...

At a surface level you are correct, only 1 line of code is changed, but it's a slippery slope. You'll think - what's another few lines - more times and then all of a sudden your core files are 20+ lines different than everyone else's, which might be significant.

Two other points to consider:
1.) If the game crashes, it spits out the line number of the crash. If you ask for help, your line number may be different than other people's, which will cause confusion when troubleshooting.
2.) If you're messing around in the core files and actually cause an issue (say, a compatibility issue that doesn't reveal itself until much later) you'll have to track it down manually. All your development and testing has to stop until you find the issue. Whereas if you had put the changed code into a separate file, you can just turn that file Off.

So yeah, changing one line of code is probably fine, if you want to change that line again each time you upgrade your project. But it would be much better to get in the habit of separating changes to the core code into a separate file.
 

Ichida za Zeal

Veteran
Veteran
Joined
Oct 23, 2015
Messages
69
Reaction score
7
First Language
English
So is there a way to do this without having to fear for my life every time an upgrade happens? XD
 

Ichida za Zeal

Veteran
Veteran
Joined
Oct 23, 2015
Messages
69
Reaction score
7
First Language
English
That worked! Did you have that on hand or did you custom make this for me?
Either way, thanks a lot! I will be sure to credit you. :D
 

WhiteW

The Murderous Clown
Veteran
Joined
Oct 16, 2016
Messages
170
Reaction score
127
First Language
EN/PT
Primarily Uses
RMMV
That worked! Did you have that on hand or did you custom make this for me?
Either way, thanks a lot! I will be sure to credit you. :D

It's... all I did was add 6 characters in the end really, don't worry too much, happy to help!
 

Latest Threads

Latest Profile Posts

>Testing with fonts change.
>Tries installing a plugin. Doesn't work.
>Tries changing the plugin commands. Doesn't work.
>Tries installing another plugin. Doesn't work.
>Changes a few more plugin commands. Doesn't work.
>Goes directly to the gamefont file and changes the src. Works.

YYEEEAAAAHHHAAAA

Perseverance is key, bois and girls.
What Reviews say on RPG Maker MZ?
Looking back at some sketches, and game design documents on my PC dated summer of 2015. I started development with the release of MZ, but in 2015, I felt a strong desire to make a game out of the blue. I remember feeling sad for no apparent reason, and all these ideas rushed into my head. Now that I think about it, since that day, everything has become easier to do on my PC . . . it’s very creepy.
Everything's going to be alright! We're all in this together. <3
Aaaaannd published my game's tech demo. :D

Feel free to download and play it. And give feedback!

Forum statistics

Threads
107,802
Messages
1,032,317
Members
139,947
Latest member
bitepp
Top