I recently posted a request for help editing this plugin, but since then I found an updated version that is supposed to fix the issue I had with it originally. The only problem is that it doesn't. It's supposed to be a plugin to add an HP bar to the map as you walk around that can be turned on/off using a switch, but it just won't work, and the HP bar never appears no matter what I do. I think the issue may be that it's outdated, because back in 2016 when it was made it worked just fine for everyone who tried to use it, but now multiple people are reporting that no matter what they do they can't get it to work. Basically, I need someone to tell me what code I need to enter in order to fix the plugin and make it work, as well as where in the code I need to put it.
If you do decide to help, please write out the code I need to add, as I can't read code (otherwise I would just do it myself) and tell me exactly where to put it. Thank you so much in advance! This will not only help me but multiple other people as well, and I'm very frustrated :,)
Here's the original author
https://forums.rpgmakerweb.com/index.php?members/mrcopra.66846/
And here's the code for the plugin
/*:
* @plugindesc HealthBar
* v 1.1
* @author mrcopra
*
* @param Switch ID
* @desc If the switch off it will make health bar disappear
* @Default 0
*
* @Help
*
*/
(function() {
//////////////////////////////////////////////////////////////////////////////////////
var parameters = PluginManager.parameters('HealthBar');
var sId = Number(parameters['Switch ID'] || 0);
var _Scene_Map_start = Scene_Map.prototype.start;
Scene_Map.prototype.start = function() {
_Scene_Map_start.call(this);
this._myWindow = new My_Window(100,100);
if ($gameSwitches.value(sId)){
this.addWindow(this._myWindow);}
};
var _Scene_Map_update = Scene_Map.prototype.update;
Scene_Map.prototype.update = function() {
_Scene_Map_update.call(this);
////////////////////////////////////////////////// this is the conditional switch/////////////////
if ($gameSwitches.value(sId)){
this.addWindow(this._myWindow);
};
this._myWindow.refresh();
};
function My_Window() {
this.initialize.apply(this, arguments);
}
My_Window.prototype = Object.create(Window_Base.prototype);
My_Window.prototype.constructor = My_Window;
My_Window.prototype.initialize = function(x, y) {
Window_Base.prototype.initialize.call(this, 0, 0, this.windowWidth(), this.windowHeight());
this._value = -1;
this.refresh();
};
My_Window.prototype.refresh = function(){
//$gameMessage.add(String(sId))
this.contents.clear();
///////////////////////////this is the conditional switch//////////////////////////
if ($gameSwitches.value(sId)){
this.open();
this.drawActorHp($gameParty.leader(), 0, 0, 200);
}else{this.close();}
};
My_Window.prototype.windowWidth = function(){
return 240;
};
My_Window.prototype.windowHeight = function(){
return 80;
};
///////////////////////////////////////////////////////////////////////////////////////////////
})();
If you do decide to help, please write out the code I need to add, as I can't read code (otherwise I would just do it myself) and tell me exactly where to put it. Thank you so much in advance! This will not only help me but multiple other people as well, and I'm very frustrated :,)
Here's the original author
https://forums.rpgmakerweb.com/index.php?members/mrcopra.66846/
And here's the code for the plugin
/*:
* @plugindesc HealthBar
* v 1.1
* @author mrcopra
*
* @param Switch ID
* @desc If the switch off it will make health bar disappear
* @Default 0
*
* @Help
*
*/
(function() {
//////////////////////////////////////////////////////////////////////////////////////
var parameters = PluginManager.parameters('HealthBar');
var sId = Number(parameters['Switch ID'] || 0);
var _Scene_Map_start = Scene_Map.prototype.start;
Scene_Map.prototype.start = function() {
_Scene_Map_start.call(this);
this._myWindow = new My_Window(100,100);
if ($gameSwitches.value(sId)){
this.addWindow(this._myWindow);}
};
var _Scene_Map_update = Scene_Map.prototype.update;
Scene_Map.prototype.update = function() {
_Scene_Map_update.call(this);
////////////////////////////////////////////////// this is the conditional switch/////////////////
if ($gameSwitches.value(sId)){
this.addWindow(this._myWindow);
};
this._myWindow.refresh();
};
function My_Window() {
this.initialize.apply(this, arguments);
}
My_Window.prototype = Object.create(Window_Base.prototype);
My_Window.prototype.constructor = My_Window;
My_Window.prototype.initialize = function(x, y) {
Window_Base.prototype.initialize.call(this, 0, 0, this.windowWidth(), this.windowHeight());
this._value = -1;
this.refresh();
};
My_Window.prototype.refresh = function(){
//$gameMessage.add(String(sId))
this.contents.clear();
///////////////////////////this is the conditional switch//////////////////////////
if ($gameSwitches.value(sId)){
this.open();
this.drawActorHp($gameParty.leader(), 0, 0, 200);
}else{this.close();}
};
My_Window.prototype.windowWidth = function(){
return 240;
};
My_Window.prototype.windowHeight = function(){
return 80;
};
///////////////////////////////////////////////////////////////////////////////////////////////
})();