MZ Cannot read 'clamp' (Visustella OTB)

Hi,
so my project has been suddenly been crashing during battles. If I remove Visustella's OTB plugin, it does not.
And I cannot figure out what I've changed or why it suddenly became happening out of nowhere! Other than updating the software (do you think it matters?)
Full details.
Rpgmaker MZ version 1.8.0
Project corescript 1.7.0

This is the message:
message.PNG

(Cannot read property 'clamp' of null)

This my plugin list narrowed down
pluginlist.PNG

(if i toggle off Visustella OTB, it doesn't crash)

This is the console message after crash
console.PNG


It happens both on my PC as well as on my Macbook Air.

...Help! 🙂

Thank you

Edit: attached pictures, thank you for your tip.
As a tip, you can attach images to your post using the Attach Files button or the picture frame in the edit bar. Trying to open your imgur link doesn't work for me.

It's saying one of your enemies doesn't have a parameter (I've most often seen this with HP, but it's impossible to tell from that error).

Double check that you have values filled in for everything in the database, and that you aren't using some kind of troop event that could erase one.

Is there something lower down in your plugin list that you're using FOSSIL for?
Thank you for your fast answer. I have attached the pictures now.
There are two same enemies in the battle. These are their values:
enemy.png



Lastly, yes, I do have some plugins down there, that are to be used with Fossils, they are currently disabled!
From the console screenshot, the error is on line 3050 of rmmz_objects. In v1.7.0, that clamps the battler's _tp to its min/max. So the error implies an enemy's internal _tp value is null. I don't know why any of your plugins would affect that, though.

Things you could try:
  1. If you're not using FOSSIL, then disable/remove it. MZPlusQuickStart looks redundant, too, since there's an editor option for that now (Game -> Skip Title Screen), but maybe it does other stuff. Remember to save your project to apply Plugin Manager changes before testing.

  2. Turn off any plugins not necessary for the OTB plugin to work. Save your project, then test. This can help to identify if it's a plugin conflict.

  3. Reset the OTB plugin's parameters to their default values: delete it from the Plugin Manager, then re-add it. Save your project, then test with those default settings. This can correct any bad edits of plugin parameters.

  4. Double-check any other places where you may have entered an incorrect line of script, e.g. notetags or Script commands.

  5. Follow these VisuStella MZ troubleshooting guidelines:
    Notably: try to reproduce the issue in a minimal project.

  6. Revert to editor version 1.7.0, since you seem suspicious that it may have affected things. For the Steam version this is easy:
    • Steam Library -> RPG Maker MZ -> right-click -> Properties -> Betas.
    If that helps, probably best to either stick with it, or try editor version 1.8.0 and upgrade your project's core scripts to match.
From the console screenshot, the error is on line 3050 of rmmz_objects.
That's what I get for being careless...I saw "VisuStella" and didn't bother actually looking at the console screenshot 😛
Thank you for your help, I really appreciate it.

- I have cleaned up the troop of any events
- Disabled Fossil and MZPlusQuickStart plugin, used the game->skip title screen (nice!)
- Disabled all plugins except: 1) VS Core Engine 2) VS Battle Core 3) VS BattleSystemOTB
- Deleted the OTB plugin, then added it again. It is currently with all default options.
- I am now back to MZ version 1.7.0
Still crashing. 🙁

This is my current console message, does it help?
console2.PNG

What I can try next: open a new project and try to reproduce it, following the Visustella guidelines. Semi-worst case scenario, reinvent the game without OTB. Very worst case scenario, discover something else is broken too.

You mentioned that the error message was related to the TP.
One thing that I remember doing is: I don't need TP in my project. Starting from a new project, I noticed that some skills had "tp gain +X", and this was being shown in the skill menu with visustella plugins. So I opened skills.json in notepad and searched for any "tp gain" that was different than 0 and put them back to 0. Do you think I could have messed up something that was in that file, or is this irrelevant?

Thank you! <3
I opened skills.json in notepad and searched for any "tp gain" that was different than 0 and put them back to 0. Do you think I could have messed up something that was in that file
😅 Anyone can make a mistake! I'm not sure how any value of gain could cause the TP to end up as null, and I think any edits should be overwritten next time you save changes to a skill in the database, but why guess when you can test?

You could temporarily move your project's current Skills.json file somewhere else, e.g. the desktop, then copy the Skills.json from a new project into your current project. Then test again. If that fixes it, double-check the original data file for any mistakes.
Hi
So I disabled OTB and tried to do a full battle.
This was happening: after the first turn, my actor's (only 1 actor in the party) "attack" and "guard" option were greyed out and I couldn't use them. Neither the enemy, turns were just skipping by.

So I compared my project to the default project and noticed that I had 0 value to "tp gain" in "attack" and "guard", while the default project had 5 and 10.

I put back 5 and 10.
Now it doesn't crash. The battle seems to run well.

I have kept on playing and testing the game for hours and I confirm that some skills, if they have 0 tp gain, cause this error everytime. Others, don't. I'm just solving it by changing the TP gain value, which doesn't interfere with gameplay. Now it works, I'm just happy it works 🙂

The reason that I put it to 0 in the first place was that it's shown in the skill menu preview, but my menu is altered by visustella, so my next step will be looking for ways (probably in the visustella plugins) to disable "tp gain" from being shown.

Thanks for helping me through it 🙂
There's still something screwy, then - in a new, test project, there are no problems at all with making Attack and/or Guard have no TP gain.

Good luck with your project!

Original thread: https://forums.rpgmakerweb.com/threads/cannot-read-clamp-visustella-otb.165089/