Technically this error occurs when an array or in general an index is set to 1 more than it should be. This is weird really.
Are you using a plugin or any code of any kind? If you do, please tell us.
Did you changed anything to the core scripts? If you did please tell us.
Tip:
An array starts counting from 0. Thus a FOR loop should start from 0 too.
If not, you might get an error. If you need to access 5 things in the array, those things are stored in indexes 0,1,2,3 and 4
When it tries to access 5 it is out of bounds.
What bugs me is that it doesn't happen when you add more enemies.
If you use a custom batlle system it might glitch.
But as you can see I am just guessing here.
Can you give us more info on your issue? 🙂
One reason this might happen is if you ever reduced one of the database lists by reducing the number with "change maximum", but had used one of the higher items before the change.
For example, if you removed enemies from the enemy database after they had been added to a troop, but forgot to remove that entry from the troop.
Or used an item in a event command, and then removed the ID from the item list.
Can you tell if you ever reduced one of the list sizes in the database (any part of it)?
can you run with developer tools on (F8 after starting game) and provide a screenshot of the console log after the crash?