What is this Error?

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,116
Reaction score
813
First Language
English
Primarily Uses
RMMV
1596495488357.png
This is the 3rd time I've gotten this error, but haven't been able to reproduce it reliably. It happens only when the enemy is inflicted with a Bleed state and the error occurs when I move the cursor over this enemy.
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
704
Reaction score
429
First Language
English
Primarily Uses
RMMV
This error comes up when the engine attempts to draw a gauge (usually HP/MP or TP) and either the subjects current hp, mp, or tp, or their maximum hp, mp or tp is not an integer.

Given your description of when it happens, your bleed state is doing fractional damage to the enemy. Put in a Math.round() function into whatever it is you're using for that state to do damage. If a battler has 100/100 hp and you deal 6.1 damage to them instead of 6, the function that draws the gauge returns a NaN value, which cannot be drawn, and causes it to crash upon attempting to do so.

edit: it could also be that the bleed damage itself is undefined, which causes it to subtract 'undefined' from the targets current hp, which becomes NaN, which cannot be drawn. In this case, you'd need to look at the code being used to cause the bleed damage to see why it could be undefined instead of an expected value.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,116
Reaction score
813
First Language
English
Primarily Uses
RMMV
@ramza Ah, that makes sense. Thank you! This is what's in my Bleed state:
<Custom DoT Formula>
var bleed = target.result() * 0.75;
value = Math.round(bleed / 3);
variance = 0;
element = 0;
</Custom DoT Formula>

It was already using Math.round so I don't think it's a decimal issue...

Edit: Turns out it was the "target.result()" portion giving me an issue...
 
Last edited:

Solar_Flare

Veteran
Veteran
Joined
Jun 6, 2020
Messages
523
Reaction score
230
First Language
English
Primarily Uses
RMMV
I'm pretty sure target.result() is an object. You probably want something like target.result().damage instead. I don't remember if that's correct, but you can look up Game_ActionResult in rpg_objects.js for the valid attributes.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Recent threads, and my very poor algorithm for my minimap plugin have made me face the fact that I need to review algorithms and such.

Going through Cracking the Coding Interview now. I am so excited.
Kes
I've seen a reference to a Community Lighting plugin for MZ, but cannot find it. Is it still in beta?

Todo:
Add fog of war
Add enemy indicators
Make window draggable
Optimise map drawing algorithm (5 seconds to load the map you see, so it's a... poo-poo algorithm)

Any suggestions? :kaoblush:
bleh studio hell job haha at least they like it didnt had time to do much laundry tho ;w;'....YES I DO AT LEAST TAKE A SHOWER everyday!
Ami
--- Food Ingredients ---

Hero: Since the Chef are in Hospital,we can't eat his Dish in 3 Days.
F.Mage: What we have to Eat?
M.Healer: Don't worry,we can Eat the Food Ingredients.
Hero & F.Mage
: Really?

(3 Days Later)

Chef: Hi,Guys. I'm Ba---
(Entire Party Collapse After Eat Raw Meat)
Chef: Wha...WHAT GOING ON HERE!!!!!!

Forum statistics

Threads
102,913
Messages
995,919
Members
134,363
Latest member
Wilsonliz
Top