lemons

Villager
Member
Joined
Aug 16, 2013
Messages
26
Reaction score
14
First Language
english
Primarily Uses
RMMV
Hello,

In my game, each time someone levels up, they gain a skill point (a variable), and I need a way to show this in-game somehow, preferably on the status screen. I'm aware Yanfly has Status Core/ Actor Variable plugins, but it would require that I create an entire new page just to show one variable, which would look bad/silly design wise. I'd just like to smack the variable somewhere on the default status screen, perhaps under the EXP text, I'm not too picky lol.
 

Llareian

Jack of All Trades, Master of None
Veteran
Joined
Jan 26, 2017
Messages
608
Reaction score
1,436
First Language
English
Primarily Uses
RMMZ
Is it just a regular game variable you're using to store this information? And there's a different variable for each actor? How many actors do you have?
 

lemons

Villager
Member
Joined
Aug 16, 2013
Messages
26
Reaction score
14
First Language
english
Primarily Uses
RMMV
Yes; I just have one actor.
 

Llareian

Jack of All Trades, Master of None
Veteran
Joined
Jan 26, 2017
Messages
608
Reaction score
1,436
First Language
English
Primarily Uses
RMMZ
I have a busy morning ahead but I will try to work on this later today.
 

lemons

Villager
Member
Joined
Aug 16, 2013
Messages
26
Reaction score
14
First Language
english
Primarily Uses
RMMV
Thank you so much. :)
If I were to hypothetically add more than one actor, would that significantly change what needs to get written? Or does it matter?
 

Llareian

Jack of All Trades, Master of None
Veteran
Joined
Jan 26, 2017
Messages
608
Reaction score
1,436
First Language
English
Primarily Uses
RMMZ
Yeah, it would. I would need to be able to identify different variables for different actors in the script. I was thinking I would mock it up the script that way anyway though, just to be safe.

I'm planning to put in parameters that would allow you to change the variable associated with the actor(s) as well, in case you need to shift things around for whatever reason, and so I don't need to know which variable you've assigned while I'm writing the script. So I'll just need to add parameters to allow for more than one actor. Shouldn't be too tough.
 

Llareian

Jack of All Trades, Master of None
Veteran
Joined
Jan 26, 2017
Messages
608
Reaction score
1,436
First Language
English
Primarily Uses
RMMZ
EDIT: Sorry for the double post! :\ My mistake.

Whew! I added in the option to add the TP gauge to the Status screen, since there was plenty of space after adding in the variable on the right. I had a little bit of trouble ironing out a bug I wrote in (got it finally), but I'm super happy with the result. I might want to use this for one of my games!

Copy and paste the text into a basic text editor like notepad, and Save As LLA_LemonsStatusVariable.js

Let me know if you have any problems or need improvements!

//=============================================================================
// Llareian - Lemons Status Variable (v1.0), LLA_LemonsStatusVariable.js
//=============================================================================
/*:
@author Llareian
@plugindesc Adds a variable value to the standard status menu, beneath EXP & To Next Level.

@param Show TP?
@desc Whether to show TP bar on Status Menu. (true or false)
@Default true

@param Variable Label
@desc Exactly how you want the variable to be labeled on Status Menu.
@Default Current SP

@param ---Variables---

@param Actor1 VarID
@desc The Variable ID number for Actor 01.

@param Actor2 VarID
@desc The Variable ID number for Actor 02.

@param Actor3 VarID
@desc The Variable ID number for Actor 03.

@param Actor4 VarID
@desc The Variable ID number for Actor 04.

@param Actor5 VarID
@desc The Variable ID number for Actor 05.

@param Actor6 VarID
@desc The Variable ID number for Actor 06.

@param Actor7 VarID
@desc The Variable ID number for Actor 07.

@param Actor8 VarID
@desc The Variable ID number for Actor 08.

@param Actor9 VarID
@desc The Variable ID number for Actor 09.

@param Actor10 VarID
@desc The Variable ID number for Actor 10.

@param Actor11 VarID
@desc The Variable ID number for Actor 11.

@param Actor12 VarID
@desc The Variable ID number for Actor 12.

@param Actor13 VarID
@desc The Variable ID number for Actor 13.

@param Actor14 VarID
@desc The Variable ID number for Actor 14.

@param Actor15 VarID
@desc The Variable ID number for Actor 15.

@param Actor16 VarID
@desc The Variable ID number for Actor 16.

@param Actor17 VarID
@desc The Variable ID number for Actor 17.

@param Actor18 VarID
@desc The Variable ID number for Actor 18.

@param Actor19 VarID
@desc The Variable ID number for Actor 19.

@param Actor20 VarID
@desc The Variable ID number for Actor 20.
*/

llaLsvSwitchTp = (PluginManager.parameters('LLA_LemonsStatusVariable')["Show TP?"].toLowerCase() == 'true');
llaLsvVarLabel = PluginManager.parameters('LLA_LemonsStatusVariable')["Variable Label"];
llaLsvVarValues = [''];
for (i = 1; i <= 20; i++) {
iparam = 'Actor' + i + ' VarID'
ivalue = PluginManager.parameters('LLA_LemonsStatusVariable')[iparam];
if (ivalue != '') {llaLsvVarValues.push(ivalue)};
};

// changes the vertical spacing of Status Menu
Window_Status.prototype.refresh = function() {
this.contents.clear();
if (this._actor) {
var lineHeight = this.lineHeight();
this.drawBlock1(lineHeight * 0);
this.drawHorzLine(lineHeight * 1);
this.drawBlock2(lineHeight * 2);
this.drawHorzLine(lineHeight * 8);
this.drawBlock3(lineHeight * 9);
this.drawHorzLine(lineHeight * 15);
this.drawBlock4(lineHeight * 16);
}
};

// adds a TP guage if parameter "Show TP?" is set to true
var alias_prototype_statusdrawbasicinfo = Window_Status.prototype.drawBasicInfo;
Window_Status.prototype.drawBasicInfo = function(x, y) {
alias_prototype_statusdrawbasicinfo.call(this, x, y);
if (llaLsvSwitchTp) {
this.drawActorTp(this._actor, x, y + this.lineHeight() * 4, 186);
};
};

// fetches the variable label
Window_Status.prototype.getLSVarLabel = function() {
return llaLsvVarLabel;
};

// fetches the variable value for the current actor
Window_Status.prototype.getLSVarValue = function() {
return $gameVariables.value(llaLsvVarValues[this._actor.actorId()]);
};

// adds the variable label and value to Status Menu
var alias_prototype_statusdrawexpinfo = Window_Status.prototype.drawExpInfo;
Window_Status.prototype.drawExpInfo = function(x, y) {
alias_prototype_statusdrawexpinfo.call(this, x, y);
var value3 = this.getLSVarValue();
this.changeTextColor(this.systemColor());
this.drawText(this.getLSVarLabel(), x, y + this.lineHeight() * 4, 270);
this.resetTextColor();
this.drawText(value3, x, y + this.lineHeight() * 5, 270, 'right');
};

//=====END=OF=FILE=============================================================
 

lemons

Villager
Member
Joined
Aug 16, 2013
Messages
26
Reaction score
14
First Language
english
Primarily Uses
RMMV
Thank you so much!!! :kaoluv: You are an angel!!! I appreciate you taking the time to do this for me, it works perfectly.
 

Latest Threads

Latest Posts

Latest Profile Posts

Have you ever had the problem of not knowing how to name your game?
I tried to draw it to keep the aspect ratio of 48*48
It doesn't look good, but I'm not sure if there are other ways to render larger characters. and then maintain the sharpness or not
SF_Enemy1_6 added!
index.php

Just thought I'd share how my battlers are looking for my 4 main characters. From left to right... Ashlyn the brave fighter, Lizzabelle the peaceful mage, Suki the thief, Saedra the not-so-peaceful mage.

pLZHVLI.png
Power to the Game Make!

Forum statistics

Threads
118,780
Messages
1,118,657
Members
155,950
Latest member
Sorcuris
Top