RMMV JavaScript Unofficial Bugfix Snippets

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,971
Reaction score
13,604
First Language
English
Primarily Uses
RMMV
This thread will be used to compile code snippets written to correct JavaScript bugs with the default scripts.  Add these as plugins, at the top of your plugin list.  These are only guaranteed to work with the default scripts.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,971
Reaction score
13,604
First Language
English
Primarily Uses
RMMV
Steam version won't update until tomorrow either, I suspect.  I'm in the dark, like you, right now :)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,971
Reaction score
13,604
First Language
English
Primarily Uses
RMMV
Is this a fix for a bug with the standard scripts?  That is what this thread is for.  Are you saying there is something wrong with the default scripts?
 

Ramiro

Now with an army of Mecha-Ralphs!
Veteran
Joined
Aug 5, 2015
Messages
858
Reaction score
364
First Language
Spanish
Is this a fix for a bug with the standard scripts?  That is what this thread is for.  Are you saying there is something wrong with the default scripts?
They doesn't work if the function doesn't have a name. So this fixes that.

But I don't really know if I could consider that a bug or not. You won't have problems if:

  • Your class is not inside an object but window.
  • Your class is created with a name.
This is a way to solve the case when  one of those two conditions are not met...

By default:

function Class {}; // this can be serialized (saved inside a json file and loaded)var Class = function {}; // this can't be serializedSceneManager.Subclass = function {}; // this class can't be serialized too_Of course that is the oly thing I could see with not too much viewing the code of the engine...

So while it doesn't automatically fixes those problems, it give a way to solve it quickly...
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,971
Reaction score
13,604
First Language
English
Primarily Uses
RMMV
They doesn't work if the function doesn't have a name. So this fixes that.
What doesn't work? This thread is for bugs with the default scripts. "Your class" implies stuff YOU are doing/changing, so is not related to the default scripts. Therefore it is not a bug fix.
 

Ramiro

Now with an army of Mecha-Ralphs!
Veteran
Joined
Aug 5, 2015
Messages
858
Reaction score
364
First Language
Spanish
What doesn't work? This thread is for bugs with the default scripts. "Your class" implies stuff YOU are doing/changing, so is not related to the default scripts. Therefore it is not a bug fix.
Sorry then, I think I need some rest, but yes, it's not a bugfix for core classes...

I'll check the default classes with more attention tomorrow... before I fall sleep at my pc...
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,971
Reaction score
13,604
First Language
English
Primarily Uses
RMMV
okay, cool. If it's a plugin you'll be able to post it when we open up plugin posting. This is JUST for core script fixes :)
 

Ramiro

Now with an army of Mecha-Ralphs!
Veteran
Joined
Aug 5, 2015
Messages
858
Reaction score
364
First Language
Spanish
There is a bug I found, if you enter a battle with dead/sleep characters, they don't show up:

I found why and this is the fix:

Now, it looks like this:

But It may broke other things... for now I can't find a moment when it does.

Here is the code:

//=============================================================================// Sprite_ActorFix.js// By Ramiro Rojo// Version: 1.0.0// Released under CC0 Universal 1.0// You can read the full license from here:// https://creativecommons.org/publicdomain/zero/1.0/legalcode// but basically means "public domain" in fancy words//-----------------------------------------------------------------------------// If you are using the YEP_CorenEngine, put this after...//=============================================================================/*: * @plugindesc Fixes some bugs on battle sprites. * @help * Just add it and enjoy, you may want to configure the parameters to work... */var Imported = Imported || {};Imported.Sprite_ActorFix = true;(function () { var moveToStartPosition = Sprite_Actor.prototype.moveToStartPosition; var setBattler = Sprite_Actor.prototype.setBattler; var setHome = Sprite_Actor.prototype.setHome; var startMove = Sprite_Battler.prototype.startMove; Sprite_Actor.prototype._getActorHomeX = function (index) { if (Imported.YEP_BattleEngineCore) { if ($gameSystem.isSideView()) { return eval(Yanfly.Param.BECHomePosX); } else { return eval(Yanfly.Param.BECFrontPosX); } } return Graphics.boxWidth - 216 + index * 32; } Sprite_Actor.prototype._getActorHomeY = function (index) { if (Imported.YEP_BattleEngineCore) { if ($gameSystem.isSideView()) { return eval(Yanfly.Param.BECHomePosY); } else { return eval(Yanfly.Param.BECFrontPosY); } } return Graphics.boxHeight - 344 + index * 48; } Sprite_Actor.prototype.setHome = function(x, y) { var battler = this._actor; if (battler) { if (!battler.canMove()) { var index = battler.index(); this._homeX = this._getActorHomeX(index); this._homeY = this._getActorHomeY(index); this.startMove(0, 0, 0); console.log("%i, %i", this._homeX, this._homeY); return; } } setHome.apply(this, arguments); } Sprite_Battler.prototype.startMove = function () { var battler = this._actor; if (battler && !battler.canMove()) { this._offsetX = 0; this._offsetY = 0; return; } startMove.apply(this, arguments); }})();
I can't find why marsha's pose is still wrong anyway...
 
Last edited by a moderator:

Jeneeus Guruman

The Returnee
Veteran
Joined
Mar 28, 2012
Messages
1,078
Reaction score
197
First Language
Filipino
So I found a bug on the default script without any plugins installed when choosing the escape command. Whether escaping is successful or not, all statuses that will be removed after the battle will be removed even if the party fails to escape. Here's my code to fix it though.
 

Fernyfer775

Veteran
Veteran
Joined
Oct 6, 2013
Messages
1,317
Reaction score
818
First Language
English
So I found a bug on the default script without any plugins installed when choosing the escape command. Whether escaping is successful or not, all statuses that will be removed after the battle will be removed even if the party fails to escape. Here's my code to fix it though.
Are you sure the states option "remove at battle end" isn't checked?
 

Jeneeus Guruman

The Returnee
Veteran
Joined
Mar 28, 2012
Messages
1,078
Reaction score
197
First Language
Filipino
Are you sure the states option "remove at battle end" isn't checked?
The bug I found only occurs with those states that has "remove at battle end" option checked. Those that are unchecked are just fine and stays at the end if the battle, regardless if escaping is successful or failed.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,971
Reaction score
13,604
First Language
English
Primarily Uses
RMMV
Yep, confirmed this is a bug.  Have logged with KDKW for a fix.  Thanks :)
 

Kaliya

// Caffeine Overload
Developer
Joined
Nov 1, 2015
Messages
506
Reaction score
566
First Language
English
Primarily Uses
RMMV
This script is a fix for a bug that causes a crash/an exception when no damage formula is entered for a skill. Prior to this script it would return Not-a-number causing the crash when trying to evaluate what value to give the gauges. This script overwrites the damage formula evaluating function and if its supposed to return NaN it will return 0 (no damage).

This bug occurs when using side-view-battle (no plugins), I am unsure if it did occur when using front view or when using other plugins, but if it did that should also be fixed.

Script:

http://pastebin.com/YFhpkVDv
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,971
Reaction score
13,604
First Language
English
Primarily Uses
RMMV
Is this the error?

TypeError

Failed to execute 'creaeLinearGradient' on 'CanvasRenderingContext2D': float parameter 3 is non-finite.

That's a weird-looking error for a damage formula being missing!
 

Kaliya

// Caffeine Overload
Developer
Joined
Nov 1, 2015
Messages
506
Reaction score
566
First Language
English
Primarily Uses
RMMV
Is this the error?

TypeError

Failed to execute 'creaeLinearGradient' on 'CanvasRenderingContext2D': float parameter 3 is non-finite.

That's a weird-looking error for a damage formula being missing!
Yes that is the error :) . I believed it is caused because, when there is no formula the evaluation function doesn't actually return a number which is why that 'createLinearGradient' function is producing an error over a float parameter that doesn't exists. 
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,971
Reaction score
13,604
First Language
English
Primarily Uses
RMMV
thanks. Reproduced, and logged.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,971
Reaction score
13,604
First Language
English
Primarily Uses
RMMV
You mentioned walk speed, but I don't see that that bit of code has anything to do with walk speed specifically (rather, walk-speed changing would be a symptom of the problem, but there would be many other symptoms as well). Can you clarify/confirm? Do you have a link to the original thread?
 

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

Latest Threads

Latest Profile Posts

Welp, ended up at the hospital with the oldest so mebbe might make the game jam's deadline. Maybe not. Regardless, really digging MZ.
I had lots of fun! Kids loved me, and some took pictures. Unfortunately, the videos didn't send... but you'll see Chica in action when I do a trailer for Fandom Scouts!
Dama wrote on akoniti's profile.
Hi
Thanks for your review.
I was checking the trailer for details and as the woman shut the door at the exact moment the song I was hearing said "you slim the door" and I couldn't resist to add it there. :D And I used this idea one more time on another scene.
Just doing some tileset tinkering again...

Forum statistics

Threads
104,693
Messages
1,008,181
Members
136,189
Latest member
MalaacSoran
Top