mjshi

Jack of Most Trades
Regular
Joined
Feb 16, 2013
Messages
998
Reaction score
886
First Language
English
Primarily Uses
N/A

Stat Polygon v1.0
by mjshi- OK for use in all projects with credit

Get it here!

A fancy radar chart for your stats!
Commissioned by the wonderful Lonewulf123 of these very forums.
Features
- Customize which and how many stats to show!
- Supports icon labels!
- Change the colors as you like-- just be sure to use hex color codes!
- Compatible with Yanfly Status Menu Core-- read help for more info

Screenshots
spolyexample1_orig.png

spolyex2_orig.png

spolyex4_orig.png

Version History
1.0 plugin released

Credit
mjshi
 

Lonewulf123

Regular
Regular
Joined
Oct 13, 2014
Messages
367
Reaction score
102
First Language
Enlish
Thank you for taking on my request! It's awesome and works perfectly for me!
 

kovak

Silverguard
Regular
Joined
Apr 3, 2016
Messages
1,266
Reaction score
1,572
First Language
PT - EN
Primarily Uses
RMMV
Just in case you can't download remember to login in your dropbox account.
 

kovak

Silverguard
Regular
Joined
Apr 3, 2016
Messages
1,266
Reaction score
1,572
First Language
PT - EN
Primarily Uses
RMMV
I had to edit my post cuz for some reason i could download it only after log in my acc
 

Lionheart_84

Regular
Regular
Joined
Oct 27, 2015
Messages
644
Reaction score
60
First Language
Italian
Primarily Uses
Beautiful idea !!! You can do that figure in the middle ... blinking ???
 

Johnboy

Regular
Regular
Joined
Jan 13, 2016
Messages
360
Reaction score
139
First Language
English
Primarily Uses
RMMV
@mjshi Is there any way I can replace the bars in Yanfly's Status Menu core? I would like to remove the bars and have just this polygon to represent my statistics to my players. Or maybe even call this in a separate window or with a separate menu command?
 

mjshi

Jack of Most Trades
Regular
Joined
Feb 16, 2013
Messages
998
Reaction score
886
First Language
English
Primarily Uses
N/A
@Johnboy In StatPolygon.js, find these lines:

Code:
if (Imported.YEP_StatusMenuCore) {
Window_StatusInfo.prototype.drawParameters = function() {
    var dx = indent;
    var dy = this.lineHeight() / 2;
    var dw = this.contents.width - indent;
    var dh = this.lineHeight();
    var dw2;
    var text;
    this.changeTextColor(this.systemColor());
    this.drawText(Yanfly.Param.StatusGraphText, dx, dy, dw, 'center');
    dy = this.lineHeight();
    dx = indent;
    dw -= this.standardPadding() * 2;
    for (var i = 2; i < 8; ++i) {
        dy += this.lineHeight();
        var rate = this.drawParamGauge(dx, dy, dw, i);
        this.changeTextColor(this.systemColor());
        this.drawText(TextManager.param(i), dx + 4, dy, dw - 4);
        text = Yanfly.Util.toGroup(this._actor.param(i))
        this.changeTextColor(this.normalColor());
        dw2 = dw * rate;
        this.drawText(text, dx, dy, dw2 - 4, 'right');
    }

and delete everything from this.changeTextColor(this.systemColor()); to this.drawText(text, dx, dy, dw2 - 4, 'right')... all the way to the closing brace } (lines 248 to 262).
 

MORINGA

Regular
Regular
Joined
Apr 23, 2017
Messages
30
Reaction score
11
First Language
English
Primarily Uses
RMMV
Hum...can anyone help me with this one? I can't seem to make it work at all...
(Edit: turned off Yanfly's StatusMenuCore, it works! Thanks a lot! =)
I won't be using StatusMenuCore, anyway, so this might be perfect for my project. Again, thanks a lot!)
 
Last edited:

Lonewulf123

Regular
Regular
Joined
Oct 13, 2014
Messages
367
Reaction score
102
First Language
Enlish
Hum...can anyone help me with this one? I can't seem to make it work at all...

You've come to the right place, but you'll need to be more specific with the issue you have. What other scripts are you using? Did you try in a fresh project?
 

mjshi

Jack of Most Trades
Regular
Joined
Feb 16, 2013
Messages
998
Reaction score
886
First Language
English
Primarily Uses
N/A
@MORINGA This plugin is compatible with Status Menu Core. Make sure to read the help file! If it isn't showing up your Center X and Center Y values probably need to be adjusted.
 

Harken_W

Regular
Regular
Joined
Oct 13, 2015
Messages
81
Reaction score
23
First Language
English
Primarily Uses
N/A
Incoming ridiculous question.

Visually I much prefer this way of showing information compared to just having a list of stats and numbers.

The list of stats and numbers window appears in other places such as the equip screen and status screen.

Is there any way in which this Stat Polygon can just replace that entirely?
So when other plugins/scenes want to show that list of stats, the Stat Polygon would be there instead of the list.

TL;DR No more list, only Polygon.
 

mjshi

Jack of Most Trades
Regular
Joined
Feb 16, 2013
Messages
998
Reaction score
886
First Language
English
Primarily Uses
N/A
@Harken_W

Do you mean to have two different stat polygons in the equip/status screen that show the changes?
Really, the part of the plugin drawing the entire thing is just the stuff in

Window_Status.prototype.drawParameters = function(x, y) {
and under

//Begin edits
//draw polygon

The actual function that draws the polygon is just

this.contents.SPolyDrawStatPolygon(this._actor);

so if you copy/pasted that to other windows you could have stat polygons there also. However, if you wanted to make two stat polygons side by side you'd have to move the x and y coordinates around a bit and to show the changes rather than this._actor use this._tempActor for the second stat polygon.

But otherwise, there's no built in function for that.
 

Harken_W

Regular
Regular
Joined
Oct 13, 2015
Messages
81
Reaction score
23
First Language
English
Primarily Uses
N/A
Not two stat polygons side by side, just this same stat polygon appearing in different places,
so I believe it was the 'this.contents.SPolyDrawStatPolygon(this._actor);' part that I was after!

Thanks for the quick reply and awesome plugin :D
 

mjshi

Jack of Most Trades
Regular
Joined
Feb 16, 2013
Messages
998
Reaction score
886
First Language
English
Primarily Uses
N/A
@Harken_W No problem! Also, if you want to make that polygon anywhere else but also have the icons/text etc just copy/paste the relevant portions later on labelled "//draw icon" and "//draw text", respectively.

You might run into issues later on with positioning since the entire thing uses a global x and y variable. You can remedy that by finding this part:

Code:
Bitmap.prototype.SPolyDrawStatPolygon = function(actor) {
    var cx = centerX, cy = centerY;

...(etc code stuff)...

};

and changing that var cx = centerX thing to this:
Code:
Bitmap.prototype.SPolyDrawStatPolygon = function(actor, x, y) {
    if (x !== undefined) {
        var cx = x, cy = y;
    } else {
        var cx = centerX, cy = centerY;
    }

...(etc code stuff)...

};

This way when you call this.contents.SPolyDrawStatPolygon(this._actor); you can also specify a center x and y coordinate.

Example:
this.contents.SPolyDrawStatPolygon(this._actor, 100, 200);
to center it at x=100 and y=200.
 

oloimp

Artist
Regular
Joined
Jun 12, 2013
Messages
187
Reaction score
26
First Language
German
Primarily Uses
RMMV
This is so simple yet so awesome and helps to show players information in a way that lets them immediately distinguish strengths and weaknesses. This would be awesome for element resistances etc. too!
Thanks and great job!

Edit:
I do seem to have a problem. Showing the stats on level 1 seems just fine, but as soon as I test it with their initial level being something like 20, all the graphs are completely maxed out.
Do I do something wrong or does the graph not "grow" with the stats? It should probably always be a relative value.
 
Last edited:

Lonewulf123

Regular
Regular
Joined
Oct 13, 2014
Messages
367
Reaction score
102
First Language
Enlish
This is so simple yet so awesome and helps to show players information in a way that lets them immediately distinguish strengths and weaknesses. This would be awesome for element resistances etc. too!
Thanks and great job!

Edit:
I do seem to have a problem. Showing the stats on level 1 seems just fine, but as soon as I test it with their initial level being something like 20, all the graphs are completely maxed out.
Do I do something wrong or does the graph not "grow" with the stats? It should probably always be a relative value.

You have to adjust the “max stats” value in the plugin parameters I believe. You can’t change the maximum value dynamically with each level.
 

mjshi

Jack of Most Trades
Regular
Joined
Feb 16, 2013
Messages
998
Reaction score
886
First Language
English
Primarily Uses
N/A
@Zack Phoenix It's just as Lonewulf123 said. The default "max stat" values are set intentionally low, so that differences in stats are immediately obvious the second you enable the plugin. However, for it to be useful realistically, you're going to have to decide what approximate upper maximum the stats in your game are going to have.

If you know a little bit about coding and want to change how that's decided though, the relevant portion is this:
Code:
Bitmap.prototype.SPolyDrawStatPolygon = function(actor) {
    var cx = centerX, cy = centerY;

    //draw graph background
    for (var i = 0; i < numSegments; i++) this.SPolyDrawRegularPolygon(cx, cy, radius - (i * radius/numSegments), sides, secondaryColor, lineWeight);
  
    //draw lines
    for (var i = 0; i < sides; i++) this.SPolyDrawLine(cx, cy, cx + radius * Math.cos(Math.PI/2 + i * 2 * Math.PI / sides), cy - radius * Math.sin(Math.PI/2 + i * 2 * Math.PI / sides), secondaryColor, lineWeight);

    //draw stat polygon
    var points = [];
    for (var i = 0; i < stats.length; i++) {
        points.push(cx + Math.min(actor.param(stats[i]) / maxStats[i], 1) * radius * Math.cos(Math.PI/2 + i * 2 * Math.PI / sides));
        points.push(cy - Math.min(actor.param(stats[i]) / maxStats[i], 1) * radius * Math.sin(Math.PI/2 + i * 2 * Math.PI / sides));
    }
    this.SPolyDrawPolygon(points, primaryColor, lineWeight2);
};

Change what the bolded text is. This value should go from 0 to 1 (so 0 to 100% of the polygon). Currently it's based on the percentage created from the actor's current stats divided by the approximate maximum stat.
Math.min(actor.param(stats) / maxStats, 1)
 

Latest Threads

Latest Profile Posts

I have completed what is clearly the most important part of participating in the game jam: coming up with a name!
My shrink has me trying to limit 30 mins a day for each of my personal projects so I can have a healthier life. But lately the rpg making in particular has been hard to pull away from and I keep getting lost in it.
Everyone has a test project named like this...right?

1701263020760.png
Pardon my japanese but this is my honest reaction to yesterday's "tangent":
1701262223568.png
I know these are all simple things for experienced users, but working on this Game Jam I have officially learned how to:
  • Use my own title screen image
  • Use scrolling text
  • Fade in a picture
  • Use any image for the Face in a dialog box
Probably silly for many people, but observable progress for me!

Forum statistics

Threads
136,570
Messages
1,267,665
Members
180,252
Latest member
JDimensional
Top