Issue with Moghunter's Boss HP Bar [SOLVED]

Hey guys,

So I just installed the Moghunter boss hp bar because most of the scripts in my game are from moghunter and it looked visually good. Sadly though it wasn't as simple as I thought... After installing it I went into the troops section and tried a simulation battle, there were no issues there, the bar appeared and functioned as it should.
So thinking that nothing was wrong I continued with my game, until it came down to playtest it. As soon as an encounter occurred I got this error:


Script 'MOG_Boss_HP_Meter' line 222: NoMethodError occured.
undefined method '[ ]=' for nil:NilClass

So trying to figure out what the problem was I went into the script editor and that brought me straight to line 222 in the boss hp script:


214 def clear_enemy_setup
215 @Name = ""
216 @hp = 0
217 @hp2 = 0
218 @hp3 = 0
219 @maxhp = 0
220 @hp_old = 0
221 @level = nil
222 $game_system.boss_hp_meter[2] = false
223 $game_system.boss_hp_meter[3] = ""
224 $game_system.boss_hp_meter[4] = 0
225 $game_system.boss_hp_meter[5] = 1
226 $game_system.boss_hp_meter[7] = nil
227 $game_system.boss_hp_meter[8] = 0
228 $game_system.boss_hp_meter[9] = true
229 end

Could anyone help me with this? This is currently the only issue I'm having with the script section.
If anyone can help than thank you very much in advance 🙂

I've moved this thread to Script Support. Thank you.

do a broad search for ":boss_hp_meter", " @boss_hp_meter =", "def boss_hp_meter" or "class boss_hp_meter"

if any returns a result, you probably need to put the scripts on a specific order.
if neither returns a result, you're probably missing a main script which defines it.
do a broad search for ":boss_hp_meter", " @boss_hp_meter =", "def boss_hp_meter" or "class boss_hp_meter"

if any returns a result, you probably need to put the scripts on a specific order.
if neither returns a result, you're probably missing a main script which defines it.
I'm not sure I've done it correctly, but I searched all scripts I imported and only found those keywords in the boss HP Bar script. I've tried moving it up in the materials order, and that didn't work either.
Also, it's stated in the information of the script that it's a stand alone script (or so I understood). I'll post it down below, it's in portugese so I'm using google translate so don't expect good english 😛

The description on their site:
Adds an excited meter with the boss's energy.
This script is standalone and can be used or not with the HP Meter Enemy script.

I'll just post a link to the script, that way it might be easier to find something.


Thank you again 🙂
did you google translate the whole script and then put it into your project?
If so, it probably changed something in the script that it's not suppose to.
Which I can see right on line 58. there is a space between the : and the text.
Use the original script and only translate the text one piece at a time.
did you google translate the whole script and then put it into your project?
If so, it probably changed something in the script that it's not suppose to.
Which I can see right on line 58. there is a space between the : and the text.
Use the original script and only translate the text one piece at a time.
The script in my project is the direct copy from the web, I didn't want to potentially ruin something my translating it and decided to just copy from the script itself. In this script only the text bit should be translated, but I'll post it again if something is wrong with it.

This is the untranslated one:
ok that looks better, so with this in your project you are still getting problems?
If I put this into a new project it works fine.
bosshp.PNG

If you have problems then it's a script incompatibility. Try using Rycochet - Disable Script to find which one is the problem.
ok that looks better, so with this in your project you are still getting problems?
If I put this into a new project it works fine.
View attachment 66353

If you have problems then it's a script incompatibility. Try using Rycochet - Disable Script to find which one is the problem.
Yeah, I suspected so to begin with, the problem is that most of my scripts are from moghunter, and they were supposed to work together :/ Never the less I'll look into the script disabler and see what script is causing the problems and let you know 🙂
ok that looks better, so with this in your project you are still getting problems?
If I put this into a new project it works fine.
View attachment 66353

If you have problems then it's a script incompatibility. Try using Rycochet - Disable Script to find which one is the problem.
I've gone through each and every script, but still no luck. I even tried to disable all scripts except for the boss hp meter, but still no luck. The error still popped up. Maybe I should just give up on this script :/
The problem then is just trying to find another boss hp meter that is visually appealing.
Either way, thanks for trying. I think I'll just give up on this script :/
I've gone through each and every script, but still no luck. I even tried to disable all scripts except for the boss hp meter, but still no luck. The error still popped up. Maybe I should just give up on this script :/
The problem then is just trying to find another boss hp meter that is visually appealing.
Either way, thanks for trying. I think I'll just give up on this script :/
Could you share a demo that throws the specific error?
I can't recreate it.
Could you share a demo that throws the specific error?
I can't recreate it.
You know... I just re-installed the script (something I've tried multiple times now) and suddenly it worked! Got no idea how, but I'm not gonna think about it. Thanks for everyone that tried to help, even though it wasn't necessary I appreciate it 😀
@boss_hp_meter = [ix,iy,false,"",0,1,0,nil,0,false]

that is what I was referring to.
it's there, aparently where it should be.
you were probably loading up the scripts in the wrong order.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/issue-with-moghunters-boss-hp-bar-solved.79801/