Gameover Stats/score

Ctrl_Alt

Warper
Member
Joined
Jul 15, 2019
Messages
4
Reaction score
1
First Language
English
Primarily Uses
RMMV
I'm trying to figure out how to create a plug in that shows the Players Stats, Like Exp, at the game over screen, like a Score System.
Much like in the picture- shown as an example

I thought it would be something like


this.displayExp();

but that doesn't seem to work, I've never used JS, only c++.
does anyone know how this would be written out in JS?
Also, would there be any way to draw the "term" for Exp from the settings "term" tab?
So Score would be drawn up as what ever the term was under "EXP"?
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,118
Reaction score
1,526
First Language
EN
Primarily Uses
RMMZ
Well, for reference this is the code that draws the title on Scene_Title:
Code:
Scene_Title.prototype.drawGameTitle = function() {
    var x = 20;
    var y = Graphics.height / 4;
    var maxWidth = Graphics.width - x * 2;
    var text = $dataSystem.gameTitle;
    this._gameTitleSprite.bitmap.outlineColor = 'black';
    this._gameTitleSprite.bitmap.outlineWidth = 8;
    this._gameTitleSprite.bitmap.fontSize = 72;
    this._gameTitleSprite.bitmap.drawText(text, x, y, maxWidth, 48, 'center');
};
So you can try something like this (save as a .js file & import as a plugin):
Code:
// cf Scene_Title (rpg_scenes.js)
Scene_Gameover.prototype.drawScore = function() {
  var x = 20;
  var y = Graphics.height * 0.6;
  var w = Graphics.width - x * 2;
  var txt = TextManager.exp + ': ' + $gameActors.actor(1).currentExp();
  var sp = this._scoreSprite = new Sprite(new Bitmap(Graphics.width, Graphics.height));
  sp.bitmap.outlineColor = 'white';
  sp.bitmap.outlineWidth = 1;
  sp.bitmap.fontSize = 48;
  sp.bitmap.drawText(txt, x, y, w, 48, 'center');
  this.addChild(sp);
};

// Add a "draw score" call after the default code
(function(alias) {
  Scene_Gameover.prototype.createBackground = function() {
    alias.call(this);
    this.drawScore();
  };
})(Scene_Gameover.prototype.createBackground);
Here I've used actor 1's current total experience as the score, feel free to change that and any other stuff as you like~ :kaothx:
 

Ctrl_Alt

Warper
Member
Joined
Jul 15, 2019
Messages
4
Reaction score
1
First Language
English
Primarily Uses
RMMV
the good stuff
Wow, Thank you so much! This is absolutely perfect! I figured it would have been something along those lines.
Again, thanks so much!
Sorry for being lazy I couldn't seem to find the source file my self, is it in one of the js files in plug ins? I searched through scenes and windows so far and havent been able to find it :(

But again thanks so much!
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,118
Reaction score
1,526
First Language
EN
Primarily Uses
RMMZ
You're welcome! :kaojoy:
...I couldn't seem to find the source file my self, is it in one of the js files in plug ins? I searched through scenes and windows so far and havent been able to find it :(
The basic rpg_stuff.js code files can be found in your project's js folder (one level above plugins). Scene_Title starts at line 420 of rpg_scenes.js, at least in v1.5.2 (probably the same in the latest version). :)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,047
Messages
1,018,540
Members
137,834
Latest member
EverNoir
Top