Bug encounter on battle with Yanfly and Olivia plugin

Grumphlu

Veteran
Veteran
Joined
Mar 25, 2015
Messages
34
Reaction score
7
First Language
Français
Primarily Uses
Hi Everyone,

I am using Yanfly plugins and Olivia plugins and during a boss battle i use some "Force-Actions" when life drop at 50% then 25%.
Sometimes the game enter in conflict and sometimes not. I have no clue to know what make this happen.

I took a screenshot if someone understand it better than me he will be my savior,

Thanks in advance
 

Attachments

  • Error.png
    Error.png
    869.9 KB · Views: 10

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
40,829
Reaction score
14,021
First Language
English
Primarily Uses
RMMV
I think this generally means the JSON can't be parsed, which indicates you have something wrong with your notes somewhere.

Can you narrow it down to a particular force action or a particular skill or weapon or something? If not, you'll have to start checking every slot in every database tab, to see if you can find one that's not correct.
 

Grumphlu

Veteran
Veteran
Joined
Mar 25, 2015
Messages
34
Reaction score
7
First Language
Français
Primarily Uses
My force actions are all particular skills casted by my boss.

This error generaly happen in the end of a turn. Do you think this is a problem with my skill notetag ?

Look like there is a problem with the position of my ennemies maybe (i am realy not good with plugin and general coding...)
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
40,829
Reaction score
14,021
First Language
English
Primarily Uses
RMMV
As the error is in JSON.parse, I think it's SOMETHING wrong with whatever it's trying to make a copy of. Could be a skill, could be an actor or enemy, don't know without looking at the plugin. I would first look at your notes, but it could also be some weird characters in a description or name somewhere.

Can you get a screenshot of the console when you get the error (play, get the error, hit F8 to open developer tools, click on Console tab). That might have more information.
 

Grumphlu

Veteran
Veteran
Joined
Mar 25, 2015
Messages
34
Reaction score
7
First Language
Français
Primarily Uses
Ok i will try to get the error, it might take some time, i will have to run many fights ^^

(Also thanks you so much for helping me :) )
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,227
Reaction score
1,634
First Language
EN
Primarily Uses
RMMZ
This may be the same problem as discussed here:
Previously when I've encountered this "JSON.parse token u at position 0" error, it has meant that something tried to JSON.parse(undefined). Given that line 2015 of Yanfly's Battle Engine Core seems to be this:
JavaScript:
      action: JsonEx.makeDeepCopy(this._action),
...I would suspect that the error is due to BattleManager._action being undefined. This is possible if the battler in question is immobilised, since in that case their action queue will be empty and the first action undefined. :kaoback:
There could be other reasons for an empty action queue, e.g. if they've already completed their action phase this turn. Since this "remember previous action" thing is introduced by Yanfly's Battle Engine Core, I think the most effective solution would be to patch that plugin somehow. It would be best to try to reliably reproduce the problem first, though: that way you can be much more certain that any fix you find actually does (or doesn't) work. :kaopride:

I came up with something that might solve the problem (just theory, I haven't tested it). Save the following code as a .js file (Save As > File Type: All Files, Filename: whateverYouLike.js), import as a plugin, and make sure to load it immediately after Battle Engine Core in the Plugin Manager~
JavaScript:
// Place immediately below YEP_BattleEngineCore in the Plugin Manager

// Override - "no action" failsafe to avoid JSON.parse failure
BattleManager.setPreForceActionSettings = function() {
  return {
    subject: this._subject,
    action: this._action ? JsonEx.makeDeepCopy(this._action) : undefined,  // <- edit 1 of 1
    actionList: JsonEx.makeDeepCopy(this._actionList),
    targets: this._targets.slice(),
    allTargets: this._allTargets.slice(),
    indTargets: this._individualTargets.slice(),
    phaseSteps: JsonEx.makeDeepCopy(this._phaseSteps),
    returnPhase: this._returnPhase,
    phase: this._phase,
    conditionFlags: JsonEx.makeDeepCopy(this._conditionFlags),
    trueFlags: JsonEx.makeDeepCopy(this._trueFlags)
  }
};

// Override - do not restore "no action"
BattleManager.loadPreForceActionSettings = function() {
    var settings = this._forceActionQueue[0];
    if (settings) {
      this._forceActionQueue.shift();
      if (!settings.action) return false;  // <- edit 1 of 1
      this.resetPreForceActionSettings(settings);
      return this._subject && this._subject.isAppeared();
    } else {
      return false;
    }    
};
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
8,033
Reaction score
5,334
First Language
Dutch
Primarily Uses
RMXP

I've moved this thread to Plugin Support. Please be sure to post your threads in the correct forum next time. Thank you.

 

Grumphlu

Veteran
Veteran
Joined
Mar 25, 2015
Messages
34
Reaction score
7
First Language
Français
Primarily Uses
Got again the same error after view test. It seems to happen also when a state "Paralysis" (made with Yanfly Tips and Tricks) goes on my last Heros to play, just before the new turn starts.

In the console i got this "
SceneManager.catchException = function(e) {
if (e instanceof Error) {
Graphics.printFullError(e.name, e.message, e.stack);
console.error(e.stack);
} else {
Graphics.printError('UnknownError', e);
}
AudioManager.stopAll();
this.stop();

I tried to understand and do more changes but i don't get where is the error.
 

Attachments

  • Error.png
    Error.png
    941 KB · Views: 2

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,227
Reaction score
1,634
First Language
EN
Primarily Uses
RMMZ
Did you try the fix suggested in the post I quoted? Here, try importing this as a plugin:
Load it in the Plugin Manager, immediately after YEP_BattleEngineCore. Remember to save your project before testing. If it works for you, let me know! :)
 

Grumphlu

Veteran
Veteran
Joined
Mar 25, 2015
Messages
34
Reaction score
7
First Language
Français
Primarily Uses
Hi @caethyril thanks for your answer, i did try to put your fix by going on your post and saving as whatevernam.js and it still did the same error. What i tried also is to change Yanfly Paralysis state notes by cuting the "message" part. (Now i did dowload your Fix by google drive to see if it's maybe also me that just stupid haha)

But i think by reading the console it seems that there is a problem with position, force actions and messages.
And the error always appear when my last guy get Paralysed before the boss turn starts (then he has to force action and bam error).

I send you the Paralyze Tips and Tricks from Yanfly to see if you can understand better the bug and if you think i am right http://www.yanfly.moe/wiki/Paralyze_(MV_Plugin_Tips_&_Tricks)

Again thanks for your time :)
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,227
Reaction score
1,634
First Language
EN
Primarily Uses
RMMZ
It looks like that state just removes actions. Are you making the boss do Force Action, or your (paralyzed) guys?

Does the error happen if you turn off all other plugins except Battle Engine Core and Buffs & States Core, save your project, and test? Maybe it's some kind of plugin conflict or load order problem. :kaoswt2:

Actually, I just checked and it doesn't look like line 2040 in YEP_BattleEngineCore has any code in my copy (v1.51). For me, setPreForceActionSettings ends on line 2029. Which versions are you using of:
  1. Battle Engine Core?
    Latest version here: http://www.yanfly.moe/wiki/Battle_Engine_Core_(YEP)
    While you're there, maybe check your Yanfly plugins are in the recommended order: link.

  2. RPG Maker MV?
    You can check the editor version via Help > About.

  3. Project core scripts?
    You can check your core script version from the editor by choosing Game > Open Folder, then open js/rpg_core.js in a text editor (e.g. Notepad). The version should be in the first couple of lines, e.g. I see this in mine:
    Code:
    //=============================================================================
    // rpg_core.js v1.6.2
    //=============================================================================
It might be just because you're using an old version of Battle Engine Core, or loading plugins in an unusual order, so check that stuff then save your project to see if that helps~

If your core scripts and editor aren't the same version, that might be a problem. You can follow the instructions in this announcement to update your project:
Otherwise I'm not sure what to suggest... :kaoswt:
 

Grumphlu

Veteran
Veteran
Joined
Mar 25, 2015
Messages
34
Reaction score
7
First Language
Français
Primarily Uses
Hi @caethyril, i update Battle Engine Core, my Version of Rpg Maker is 1.6.1

I am using Force Actions on my boss for him to cast more spells depending on how the battle evolve.
I will try to see if the error appears again because it always happen only in the end of the turn and if my last character is paralysed (because my boss use Thunder spells and have a chance to Paralyse, so a lot of random conditions to arrive to the point where my last character is getting tuched, paralysed and the effect of paralyse appears (33% chance to stop him to make his action)

So i will run more test untill the error appears or not. But anyway thanks for help, i will say that this post is closed, if i have this error again i will try to fix it even if i will need to change this paralyse state.

Thanks again :)
 

Latest Threads

Latest Posts

Latest Profile Posts

I'm moving on from RMXP finally. I've been stuck in a difficult decision between XP and MZ, and I've given up and moved on to MZ. Overall I'm really liking it, I wish tilesets were easier to setup like XP, but it's actually not that bad!
Have you ever gone full 'Ship of Theseus' while frankenspriting? Because I just did.
I saw my new eye doctor today, he reminds me of Satoru Iwata for some reason
I've been using a modified version of a script called Multiple Messages. It makes my text boxes look like a Mario & Luigi game! There is something about it that bothers me a little bit, but I shouldn't worry about that now.

Side note, Mist's walking animation is almost perfectly in sync with Loose Yourself by Eminem.
Starting work on some stuff for the community. Hopefully it will be fun, and useful to somebody.

Forum statistics

Threads
107,772
Messages
1,032,033
Members
139,914
Latest member
smudge
Top