Error using Olivia's Aggro Management Plugin

I get an error whenever I use Olivia's Aggro Management plugin, which is shown below.

error.PNG


The logs that I get from the console is this:

Code:
YEP_CoreEngine.js:1094 TypeError: Failed to execute 'createLinearGradient' on 'CanvasRenderingContext2D': The provided double value is non-finite.
    at Bitmap.gradientFillRect (rpg_core.js:1289)
    at Bitmap.gradientFillRect (YEP_CoreEngine.js:1010)
    at _0x5115e3.(anonymous function).(anonymous function) [as drawGaugeRect] (chrome-extension://odlameecjipmbmbejkplpemijjgpljce/js/plugins/Olivia_AggroManagement.js:186:13597)
    at _0x5115e3.(anonymous function).(anonymous function) [as drawGauge] (chrome-extension://odlameecjipmbmbejkplpemijjgpljce/js/plugins/Olivia_AggroManagement.js:186:13072)
    at _0x5115e3.redraw (Olivia_AggroManagement.js:186)
    at _0x5115e3.(anonymous function) [as updateGaugeAnimation] (chrome-extension://odlameecjipmbmbejkplpemijjgpljce/js/plugins/Olivia_AggroManagement.js:186:10391)
    at _0x5115e3.(anonymous function).(anonymous function) [as updateBitmap] (chrome-extension://odlameecjipmbmbejkplpemijjgpljce/js/plugins/Olivia_AggroManagement.js:186:9734)
    at _0x5115e3.(anonymous function).(anonymous function) [as update] (chrome-extension://odlameecjipmbmbejkplpemijjgpljce/js/plugins/Olivia_AggroManagement.js:186:9458)
    at Sprite.update (YEP_X_CoreUpdatesOpt.js:7783)
    at Spriteset_Battle.Sprite.update (YEP_X_CoreUpdatesOpt.js:7783)

Not sure if it's this specific events causes the error, but what I do to always replicate it is this:
- Actor 1 attacks, increasing his aggro
- Actor 2 attacks, increasing his aggro
- Actor 3 attacks, increasing his aggro
- Actor 1 dies
- Actor 2 dies
- Actor 3 attacks, causes the error

I've tested this using only four plugins:
- YEP_CoreEngine
- YEP_X_CoreUpdatesOpt
- YEP_BattleEngineCore
- Olivia_AggroManagement

Even with just those four plugins activated, the error still occurs.
What version are your project files? This is not necessarily the version of MV (editor) that you are running. You can find it by opening your project folder, go into the js subfolder and open the rpg_core.js file in a text editor. If there's a version number on the top few lines, that's what I'm asking for. If there is no version number, it's 1.0.0
What version are your project files? This is not necessarily the version of MV (editor) that you are running. You can find it by opening your project folder, go into the js subfolder and open the rpg_core.js file in a text editor. If there's a version number on the top few lines, that's what I'm asking for. If there is no version number, it's 1.0.0

Would it be this line?

Code:
//=============================================================================
// rpg_core.js v1.6.1
//=============================================================================
That's the one.

Did you create a new project and add the plugin to it? Was there a demo for the plugin, and if so, if you go into the demo's core files, what version is that?
That's the one.

Did you create a new project and add the plugin to it? Was there a demo for the plugin, and if so, if you go into the demo's core files, what version is that?

I did try using this on my project, as well as a brand new project, no dice. The plugin itself didn't come with a demo. The description of the plugin does mention that it is for 1.6.1+, but it still produces the error on 1.6.1 and 1.6.2.
1.6.1 and 1.6.2 are exactly the same, apart from the version numbers. Someone said it was because the Japanese version had an update with new resources or something similar, so the English version was updated too, to keep the versions consistent, even though we didn't get the new resources.

What version of Yanfly's core engine are you running? The line numbers in the error messages you have don't match the version I'm looking at which is 1.31 - is yours an older or a newer version?

If you disable all the Yanfly plugins (in fact ANY plugins except this one), save, play and choose New Game, do you still have the error?

If you get the error again without any other plugins enabled, could you hit F8, go to the Console tab, and grab a screenshot of that? Make sure it's the console tab (a lot of people post the Elements tab which is not useful) - it will have fairly similar messages to what you've got on the screen in the images above, but will have a little more info.

Also (I am googling) have you named all your plugins correctly? Is it really meant to be called Olivia_AggroManagement.js?
1.6.1 and 1.6.2 are exactly the same, apart from the version numbers. Someone said it was because the Japanese version had an update with new resources or something similar, so the English version was updated too, to keep the versions consistent, even though we didn't get the new resources.

What version of Yanfly's core engine are you running? The line numbers in the error messages you have don't match the version I'm looking at which is 1.31 - is yours an older or a newer version?

If you disable all the Yanfly plugins (in fact ANY plugins except this one), save, play and choose New Game, do you still have the error?

If you get the error again without any other plugins enabled, could you hit F8, go to the Console tab, and grab a screenshot of that? Make sure it's the console tab (a lot of people post the Elements tab which is not useful) - it will have fairly similar messages to what you've got on the screen in the images above, but will have a little more info.

Also (I am googling) have you named all your plugins correctly? Is it really meant to be called Olivia_AggroManagement.js?

It says that the version of Yanfly's core engine I'm using is 1.31:
index.php


I've tried it with only the Aggro Management plugin on a brand new project, still getting an error.
error2.PNG


That was the name of the file as it was downloaded. I also considered that, since according to the header the name was: Olivia.AggroManagementManagement.js, but changing the name didn't solve anything, still had the same crash as above.
YEP_X_CoreUpdatesOpt isn't need if you have 1.6.1, but more if you use rpg < 1.3.x

if you disable that plugin, does it still give errors?
does the plugin says which plugin are required to use it?
are the notetags correct (if its include) can you show a screenshot or its code used
for the aggro?
YEP_X_CoreUpdatesOpt isn't need if you have 1.6.1, but more if you use rpg < 1.3.x

if you disable that plugin, does it still give errors?
does the plugin says which plugin are required to use it?
are the notetags correct (if its include) can you show a screenshot or its code used
for the aggro?

Yeah I've tried it without using YEP_X_CoreUpdatesOpt, still an error.

It doesn't say that it needs any plugins to run, and I made extra sure the note tags are correct.

note1.PNG

note2.PNG
if you bought it, there should be a demo included, if not, than I have no idea what the cause can be.
I dont have it, so I cant check it either.

Hopefully someone using this plugin is able to help you out.
if you bought it, there should be a demo included, if not, than I have no idea what the cause can be.
I dont have it, so I cant check it either.

Hopefully someone using this plugin is able to help you out.

There was no demo sadly, only the plugin file itself.

That's what I'm hoping for too, haha. Thanks for trying to help.
@raeson after searching a bit, some people have trouble with showing the aggro gauges,
others have problem while its always full and do nothing (no matter the aggro gauge is full or not,
and others dont get it to work either, but no errors at all.

While the plugin can be nice, but the if the function is working or not or does it job is hard to tell,
but I think there is something missing or bugging in the plugin that it doesn't work properly.

what you can try (at least) if you have Yanfly's Battle A.I. Core, Target Core, and/or Selection Control plugins,
install those and place the aggro below, and see if the error still persist or not,

if the error disappear, turn off selection and retry, if no error, turn off target core, if no error,
turn of Battle A.I. core, if the error pops up than, the AI core is than needed at least, but you
dont need to use that function if you dont want too.

in case you dont have those plugins at all, I cant help you futher, but I doubt anyone can unless they
have that plugin and can take a look why the error pops up and the other functions I stated above not working.

Good luck further on your project (you might skip the aggro part unless someone can help you or an alternate
way for aggro progressing).
@raeson after searching a bit, some people have trouble with showing the aggro gauges,
others have problem while its always full and do nothing (no matter the aggro gauge is full or not,
and others dont get it to work either, but no errors at all.

While the plugin can be nice, but the if the function is working or not or does it job is hard to tell,
but I think there is something missing or bugging in the plugin that it doesn't work properly.

what you can try (at least) if you have Yanfly's Battle A.I. Core, Target Core, and/or Selection Control plugins,
install those and place the aggro below, and see if the error still persist or not,

if the error disappear, turn off selection and retry, if no error, turn off target core, if no error,
turn of Battle A.I. core, if the error pops up than, the AI core is than needed at least, but you
dont need to use that function if you dont want too.

in case you dont have those plugins at all, I cant help you futher, but I doubt anyone can unless they
have that plugin and can take a look why the error pops up and the other functions I stated above not working.

Good luck further on your project (you might skip the aggro part unless someone can help you or an alternate
way for aggro progressing).

Yeah I also googled the problem, and that's not the issue I'm having. The gauges work fine.

The functions do work, as far as I can tell. The enemies always targets the one with the highest aggro, which is what I wanted. It's just that the crash happens sometimes, and that specific set of events is the best way I found to replicate it.

Yeah I already tried turning off a bunch of plugins off and on in different combinations, still no dice.

If it becomes too common of an error, I might just have to do away with it. Just sucks that it's a paid plugin. Thank you for the help!
I don't have the plugin myself, but in my experience that error only ever naturally happens when damage is dealt to a battler that is an infinitely repeating float value, and the gauge function used to draw the Hp gauge requires whole numbers to draw the gradient effect, causing the crash.

With that said, that obviously isn't the case here, and your steps to reproduce the problem indicate to me that this is likely a bug within the plugin itself. I'd say when an actor who has aggro on an enemy dies, the aggro value becomes undefined or null instead of being set to zero. This might cause the gauge to attempt to draw a gradient (using the createLinearGradient function) with NaN as one of its parameters, making it crash.

Like I said, I don't have the plugin, so I can't confirm. What I can suggest is checking through the plugin for any aliasing of the performCollapse() function, and see what the creator is adding to player death to clear aggro. My bet is that the gauge tries to draw the third actors aggro as a percentage of the highest aggro, but the highest aggro is actually an undefined value, and can't make the gauge properly. I'd wager it might also happen if only one actor dies first, rather than both.
I don't have the plugin myself, but in my experience that error only ever naturally happens when damage is dealt to a battler that is an infinitely repeating float value, and the gauge function used to draw the Hp gauge requires whole numbers to draw the gradient effect, causing the crash.

With that said, that obviously isn't the case here, and your steps to reproduce the problem indicate to me that this is likely a bug within the plugin itself. I'd say when an actor who has aggro on an enemy dies, the aggro value becomes undefined or null instead of being set to zero. This might cause the gauge to attempt to draw a gradient (using the createLinearGradient function) with NaN as one of its parameters, making it crash.

Like I said, I don't have the plugin, so I can't confirm. What I can suggest is checking through the plugin for any aliasing of the performCollapse() function, and see what the creator is adding to player death to clear aggro. My bet is that the gauge tries to draw the third actors aggro as a percentage of the highest aggro, but the highest aggro is actually an undefined value, and can't make the gauge properly. I'd wager it might also happen if only one actor dies first, rather than both.

Yeah I just tested it out, does seem to happen when only one actor dies.

So I took a look at the plugin itself, and it seems to be kinda weird? It's like everything is written in hexadecimal and it was all in a single line. Which is strange because their other plugins weren't written like this. I couldn't find performCollapse() anywhere in the code.

I did find a temporary fix, however. Just turning off the gauge seems to stop the errors from occurring.
Yeah, I just tested it out, it does seem to happen when only one actor dies.

So I took a look at the plugin itself, and it seems to be kinda weird? It's like everything is written in hexadecimal and it was all in a single line. Which is strange because their other plugins weren't written like this. I couldn't find performCollapse() anywhere in the code.

I did find a temporary fix, however. Just turning off the gauge seems to stop the errors from occurring.
You can try this to see the code better. Just copy and paste your code in the site then do the beauty and copy and paste it on the js file again.
Anyway, I've read all answers, but no one seems to ask, but did you try to contact the author?
Olivia is very difficult to contact, apparently. So I didn't bother asking.
You can try this to see the code better. Just copy and paste your code in the site then do the beauty and copy and paste it on the js file again.
Anyway, I've read all answers, but no one seems to ask, but did you try to contact the author?

Didn't seem to help sadly.
Yeah I tried searching up for a way to contact Olivia, but I couldn't find a way.

Original thread: https://forums.rpgmakerweb.com/threads/error-using-olivias-aggro-management-plugin.120469/