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,337
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,298
Reaction score
6,055
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,298
Reaction score
6,055
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,337
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,298
Reaction score
6,055
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,793
Reaction score
4,635
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

And my first batch of gobbo battlers is up *yay* (images should show now as they first didnt - Just my luck lol)
I've released the game I've been working on for the past 7 years, and wrote a postmortem detailing the struggles of developing a game alone. Check it out! https://meiri.itch.io/apple-pie/devlog/160774/apple-pie-a-postmortem
Petty boss is working today. Hope he realizes today that messing with me is gonna ruin his day like yesterday. I can operate very comfortably on the fringes of policy XD
I know it's such a small thing, but I love when games let you interact with everything. Like pressing A on some papers on the floor pops up dialogue, etc.

Forum statistics

Threads
99,549
Messages
966,645
Members
131,184
Latest member
Ba_hq
Top