EDIT/correction: even when MPP_MapLight.js is turned, off, upon trying to move the player seemingly disappears.
EDIT 2: solved by replacing calling of the original function by the contents of the original function... am confused as to why, perhaps there was another overwrite somewhere that it conflicted with, but it works.
I am working on a plugin to switch map sprites (motions, like climbing or crawling) depending on the region/tag the sprite happens to be on. The changing of sprites seems to work, so as a next step I want to tweak the move speed and the stepping speed when the character is using a different motion. The stepping speed goes okay:
but upon changing the move speed, a conflict occurs with MPP_MapLight.js:
The "accuseth" part of MPP_MapLight.js is as follows, with the line starting with "const grad =" being line 1155 from the console output.
The wording of the error seems to suggest that there is a division with 0 happening, but I'm not seeing this... Any thoughts as to what might be the cause?
EDIT 2: solved by replacing calling of the original function by the contents of the original function... am confused as to why, perhaps there was another overwrite somewhere that it conflicted with, but it works.
I am working on a plugin to switch map sprites (motions, like climbing or crawling) depending on the region/tag the sprite happens to be on. The changing of sprites seems to work, so as a next step I want to tweak the move speed and the stepping speed when the character is using a different motion. The stepping speed goes okay:
JavaScript:
//adjust stepping speed per motion
var CnD_CharacterBase_animationWait = Game_CharacterBase.prototype.animationWait;
Game_CharacterBase.prototype.animationWait = function() {
const _Tag = this.terrainTag();
if (_Tag === pMotionCrawlTerrain && pMotionCrawlTerrain > 0){
return (9 - this.realMoveSpeed()) * 3/pMotionCrawlStep;
} else {
CnD_CharacterBase_animationWait.apply(this,arguments);
}
};
but upon changing the move speed, a conflict occurs with MPP_MapLight.js:
JavaScript:
//adjust walking speed per motion
var CnD_CharacterBase_realMoveSpeed = Game_CharacterBase.prototype.realMoveSpeed;
Game_CharacterBase.prototype.realMoveSpeed = function() {
const _Tag = this.terrainTag();
if (_Tag === pMotionCrawlTerrain && pMotionCrawlTerrain > 0){
return this._moveSpeed + (this.isDashing() ? 1 : 0) - (4 - pMotionCrawlSpeed);
} else {
CnD_CharacterBase_realMoveSpeed.apply(this,arguments);
}
};
ErrorUncaught TypeError: Failed to execute 'createRadialGradient' on 'CanvasRenderingContext2D': The provided double value is non-finite.DevTools failed to load SourceMap: Could not load content for chrome-extension://njgcanhfjdabfmnlmpmdedalocpafnhl/js/libs/pixi.js.map: System error: net::ERR_FILE_NOT_FOUND
rmmz_managers.js:1974 Uncaught TypeError: Failed to execute 'createRadialGradient' on 'CanvasRenderingContext2D': The provided double value is non-finite.
SceneManager.onError @ rmmz_managers.js:1974
rmmz_managers.js:1975 chrome-extension://njgcanhfjdabfmnlmpmdedalocpafnhl/js/plugins/MPP_MapLight.js 1155
SceneManager.onError @ rmmz_managers.js:1975
MPP_MapLight.js:1155 Uncaught TypeError: Failed to execute 'createRadialGradient' on 'CanvasRenderingContext2D': The provided double value is non-finite.
at DarknessLayer.paintNormalMapLight (MPP_MapLight.js:1155)
at Tilemap._paintLayerLights (MPP_MapLight.js:1019)
at Tilemap._paintDarknessLayer (MPP_MapLight.js:1002)
at Tilemap.updateTransform (MPP_MapLight.js:965)
at Tilemap.updateTransform (TF_LayeredMap.js:386)
at Sprite.Container.updateTransform (pixi.js:8168)
at Spriteset_Map.Container.updateTransform (pixi.js:8168)
at Scene_Map.Container.updateTransform (pixi.js:8168)
at Renderer.render (pixi.js:22057)
at Application.render (pixi.js:23257)
DarknessLayer.paintNormalMapLight @ MPP_MapLight.js:1155
Tilemap._paintLayerLights @ MPP_MapLight.js:1019
Tilemap._paintDarknessLayer @ MPP_MapLight.js:1002
Tilemap.updateTransform @ MPP_MapLight.js:965
Tilemap.updateTransform @ TF_LayeredMap.js:386
Container.updateTransform @ pixi.js:8168
Container.updateTransform @ pixi.js:8168
Container.updateTransform @ pixi.js:8168
Renderer.render @ pixi.js:22057
Application.render @ pixi.js:23257
Graphics._onTick @ EffekseerForRPGMakerMZ_Ex.js:163
TickerListener.emit @ pixi.js:9093
Ticker.update @ pixi.js:9548
Ticker._tick @ pixi.js:9298
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
rmmz_managers.js:1974 Uncaught TypeError: Failed to execute 'createRadialGradient' on 'CanvasRenderingContext2D': The provided double value is non-finite.
SceneManager.onError @ rmmz_managers.js:1974
rmmz_managers.js:1975 chrome-extension://njgcanhfjdabfmnlmpmdedalocpafnhl/js/plugins/MPP_MapLight.js 1155
SceneManager.onError @ rmmz_managers.js:1975
MPP_MapLight.js:1155 Uncaught TypeError: Failed to execute 'createRadialGradient' on 'CanvasRenderingContext2D': The provided double value is non-finite.
at DarknessLayer.paintNormalMapLight (MPP_MapLight.js:1155)
at Tilemap._paintLayerLights (MPP_MapLight.js:1019)
at Tilemap._paintDarknessLayer (MPP_MapLight.js:1002)
at Tilemap.updateTransform (MPP_MapLight.js:965)
at Tilemap.updateTransform (TF_LayeredMap.js:386)
at Sprite.Container.updateTransform (pixi.js:8168)
at Spriteset_Map.Container.updateTransform (pixi.js:8168)
at Scene_Map.Container.updateTransform (pixi.js:8168)
at Renderer.render (pixi.js:22057)
at Application.render (pixi.js:23257)
DarknessLayer.paintNormalMapLight @ MPP_MapLight.js:1155
Tilemap._paintLayerLights @ MPP_MapLight.js:1019
Tilemap._paintDarknessLayer @ MPP_MapLight.js:1002
Tilemap.updateTransform @ MPP_MapLight.js:965
Tilemap.updateTransform @ TF_LayeredMap.js:386
Container.updateTransform @ pixi.js:8168
Container.updateTransform @ pixi.js:8168
Container.updateTransform @ pixi.js:8168
Renderer.render @ pixi.js:22057
Application.render @ pixi.js:23257
Graphics._onTick @ EffekseerForRPGMakerMZ_Ex.js:163
TickerListener.emit @ pixi.js:9093
Ticker.update @ pixi.js:9548
Ticker._tick @ pixi.js:9298
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
requestAnimationFrame (async)
Ticker._tick @ pixi.js:9301
The "accuseth" part of MPP_MapLight.js is as follows, with the line starting with "const grad =" being line 1155 from the console output.
JavaScript:
DarknessLayer.prototype.paintNormalMapLight = function(x, y, rgb, r, alpha) {
const size = param_DarknessSize;
const dx = x * size;
const dy = y * size;
const dr = r * size;
const bitmap = this.bitmap;
const context = bitmap.context;
const grad = context.createRadialGradient(dx, dy, 0, dx, dy, dr);
grad.addColorStop(0, `rgba(${rgb},1)`);
grad.addColorStop(1, `rgba(${rgb},0)`);
context.globalAlpha = alpha;
context.globalCompositeOperation = 'lighter';
bitmap.drawCircle(dx, dy, dr, grad);
context.globalAlpha = 1;
};
The wording of the error seems to suggest that there is a division with 0 happening, but I'm not seeing this... Any thoughts as to what might be the cause?
