Game crashes because of healthbar scripts

Yanntastisch

The yanntastic
Member
Joined
May 10, 2020
Messages
26
Reaction score
0
First Language
German
Primarily Uses
RMVXA
I got a weird game crashing error.
I think it appears because I combined V.M's Healthbars script and his Sleek Gauges script.
I don't know exactly why it happens, but it happens when a enemy gets defeated with one hit or by the "Change Enemy HP" function. Here's the error message and the line of the Healthbars script that gets pinned (170):
Unbenannt.PNG
Unbenannt1.PNG
If it can help: I already tried switching the scripts places in my script editor. Healthbars is now below Sleek Gauges.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,335
Reaction score
483
First Language
English
Primarily Uses
RMVXA
Has to be another issue or script. I just tested those two together and there are no issues in my test demo.
 

Yanntastisch

The yanntastic
Member
Joined
May 10, 2020
Messages
26
Reaction score
0
First Language
German
Primarily Uses
RMVXA
I think it also has to do something with the scanning and with the number and gauges counting down.
In my game a enemy gets scanned via status effect for 1 turn after a attack. Also, here are the options I made:

Healthbars:
Unbenannt1.PNG
Sleek Gauges:
Unbenannt2.PNG
 
Last edited:

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,288
Reaction score
6,042
First Language
Indonesian
Primarily Uses
RMVXA
HP Bar script already requires the Sleek Gauge script to work, so you're not wrong.
However, the Sleek Gauge script is coded wrong. Try to put this little patch below Sleek Gauge (or both, doesn't matter)
Code:
class Window_Base
  def gauges
    @gauges ||= {}
  end
end
See if that fixes the issue.
 

Yanntastisch

The yanntastic
Member
Joined
May 10, 2020
Messages
26
Reaction score
0
First Language
German
Primarily Uses
RMVXA
YES! It works now. Thank you. I think it also was because of my general script order. I changed it a little bit. Oh, and I think you ment that Sleek Gauges requires HP Bars? Because then you wrote it opposite.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,288
Reaction score
6,042
First Language
Indonesian
Primarily Uses
RMVXA
Oh, and I think you ment that Sleek Gauges requires HP Bars? Because then you wrote it opposite.
No, exactly what I wrote.
HP Bar lite won't work without the Sleek Gauge script. It has a code that only present in Sleek Gauge.
 

Yanntastisch

The yanntastic
Member
Joined
May 10, 2020
Messages
26
Reaction score
0
First Language
German
Primarily Uses
RMVXA
Then I don't use Lite. I can use HP Bars without Sleek Gauges.
 

Yanntastisch

The yanntastic
Member
Joined
May 10, 2020
Messages
26
Reaction score
0
First Language
German
Primarily Uses
RMVXA
Well the descriptions says this:
Unbenannt.PNG
And as I said, I can use states. SO I guess it's modfied.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,335
Reaction score
483
First Language
English
Primarily Uses
RMVXA
SO I guess it's modfied
No it's not. The Lite version has that in it, You said you were using the full version since you could use it without the other script. But I also can use it without the sleek gauges.
Then I don't use Lite. I can use HP Bars without Sleek Gauges
I tried the lite version without TheoAllen's addon and didn't have an issue. Must be slight differences from you project to my test project.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,288
Reaction score
6,042
First Language
Indonesian
Primarily Uses
RMVXA
I tried the lite version without TheoAllen's addon and didn't have an issue. Must be slight differences from you project to my test project.
It may or may not trigger the error. In some rare cases, it may trigger the error. There is a possibility that the variable @gauges hasn't been yet initialized and being referenced in the HP Bar which may result in an error. However, I don't want to investigate why as I could just remove the possibility by adding the patch.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
6,780
Reaction score
4,618
First Language
Dutch
Primarily Uses
RMXP

I've moved this thread to Script Support. Please be sure to post your threads in the correct forum next time. Thank you.

 

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

Latest Threads

Latest Posts

Latest Profile Posts

Yo Ho Ho... Time flies when you are having rum...

I'm rewatching Glee, just watched grilled cheesus.
Now I'm not sure if I'm hungry or I want to cry.
I just completed Ara Fell - completing the game unlocks an Epilogue. An interesting thing to possibly consider for my games.
I decided to try to make a mucha-styled artwork, and by now I've sunk more time in studies and sketches than I usually do in the whole thing. Fingers crossed it's worth it!

Forum statistics

Threads
99,451
Messages
965,434
Members
131,067
Latest member
LeoWolf
Top