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 Spoiler Version History 1.0 plugin released Credit mjshi
@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?
@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).
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!)
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?
@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.
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.
@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.
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
@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.
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.
@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)