[Problem] The provided double value is non-finite (Fixed, dumb mistake)

Discussion in 'Javascript/Plugin Support' started by JugoTHEBot, May 21, 2019.

Thread Status:
Not open for further replies.
  1. JugoTHEBot

    JugoTHEBot ME EAT YOU WHOLE Member

    Messages:
    4
    Likes Received:
    3
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    So, yeah this is my first post so i'm sorry if i'm doing something wrong.

    Anyways back on the topic, i've been doing some tests battles and for some reason whenever an enemy does the "Dual Attack", "Triple Attack" and a custom "Tackle" skill the game crashes leaving this message.
    I've also made a screenshot for plugin order, said skills and what the console says about it.
    [​IMG] [​IMG] [​IMG] [​IMG]

    It only happens if the enemy does it, and Tackle SOMETIMES crashes the game (every time the player survives the attack).
    Also i've noticed that it missed once and the game Didn't crash so i'm thinking it does that everytime the attack kills a party member.

    Sidenote: Yeah don't worry about the default stuff, it's mostly placeholders (trying to learn how to draw first), and about the skills, while it is crashing because of the default skills and i'm removing them later, i'm still concerned it may happen to other skills i'll add.

    Thank you.
     
    #1
  2. JugoTHEBot

    JugoTHEBot ME EAT YOU WHOLE Member

    Messages:
    4
    Likes Received:
    3
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    EDIT: Nevermind i'm dumb, I fixed it myself.
    Turns out the game doesn't really like enemies to use skills with formulas based around the character's level, i removed it and the attack works now.
    So i guess from now on if i want an enemy to use Skills based on level i should probably use the Enemy Level plugin.
    Sorry for the inconvenience!
     
    #2
  3. Aloe Guvner

    Aloe Guvner Walrus Veteran

    Messages:
    1,517
    Likes Received:
    959
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    For anyone who might find this later with a similar issue, here is what happened:

    1. If you use any values inside a damage formula that are not defined, Javascript refers to this as undefined
    2. Any mathematical operation with undefined will result in a value of NaN - which means "Not a Number"
    3. RPG Maker MV core code has a safety check where if the value of the damage is NaN (unsafe), it sets the value to zero (safe)
    4. Some plugins such as YEP Damage Core remove this safety check for an unknown reason, which leads to unsafe behavior
    5. If the character has a HP of 100 and then the damage is applied: 100 minus NaN is NaN
    6. The game then tries to draw the HP gauge with NaN/100 HP. NaN is a non-finite value, and therefore it crashes because you can't draw a gauge with a non-finite value, because NaN is not a number
     
    #3
    JugoTHEBot and Ebanyle like this.
  4. slimmmeiske2

    slimmmeiske2 Little Red Riding Hood Moderator

    Messages:
    5,320
    Likes Received:
    3,958
    Location:
    Belgium
    First Language:
    Dutch
    Primarily Uses:
    RMXP

    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.

     
    #4
Thread Status:
Not open for further replies.

Share This Page