@MushroomCake28 hmm, i just cant seem to get it to work. im trying to replicate what youre saying, and after that i can analyze how it works.
I think it would really help, if youre not getting TOO tired of my ignorance yet, if you could tell me how to exactly implement it, preferably on the regular screen(where you walk around and such), or the battlescreen - whatever is easiest.
what I did this time was:
put all your stuff ''as is'' in a plugin.
added your "create" bit to the proper function.
tried to call ''Scene_Battle.prototype.hypotheticallAttackMethod()''
got the error ''typeError: Cannot read property 'addDamage' of undefined''
I know im probably not using it right, but currently i dont even know what im doing and I was hoping to learn it from analysing your code when its working.
Lol, when I wrote "hypotheticalAttackMethod", it was not meant to be called like that. It's a "hypothetical" method name. I'll go through it each step by step in the Scene Map for you. In this example, it will make the dmg appear on screen near the heroes when pressing the Z/enter key. The damage will be fictional of course since this is just an example.
1) Install the previous code I wrote in a plugin.
2) Locate the "createAllWindows" method in the Scene_Map function.
3) Create the window there:
Code:
Scene_Map.prototype.createAllWindows = function() {
// Other Stuff
this._windowDmg = new Window_DisplayDmg(0, 0);
this.addChild(this._windowDmg);
};
4) Now the window is created, but not visible because there are no damage number to display. Locate the update method in Scene_Map. We'll have to program the "if Z/Enter is pressed, display damage". Of course, once you get how everything works, you'll make the window damage appear when someone is attacked. So, add this to the update method:
Code:
Scene_Map.prototype.update = function() {
// Other Stuff before
if (Input.isTriggered('ok')) {
var dmg = 500 // Fictional Number.
var x = ( $gamePlayer.x - $gameMap.displayX() ) * 48; // getting player X position
var y = ( $gamePlayer.y - $gameMap.displayY() ) * 48 - 40; // getting player Y position
var frames = 200 // The amount of frames before the window disappear
this._windowDmg.addDamage(dmg, x, y, frames);
}
};
5) Now, when you hit Z or Enter on the map, there should be a 500 appearing above your player for 200 frames before disappearing. If you want to change the text size, or text color, or make the window fade out instead of disappearing, you can modify stuff in the Window DisplayDmg function.
WARNING: Don't leave the code I put here in directly in the rpg_scenes.js file in your main project. When you're done, delete it to not cause problem with other third party plugins.