- Joined
- May 22, 2016
- Messages
- 138
- Reaction score
- 1,023
- First Language
- German
- Primarily Uses
- RMMV
Hey there,
players have been reporting the "Uncaught Error: Header is wrong" message when playing my game.
I'm pretty sure that it's caused by the loading screen plugin (based on RED_RandomLoadingScreen) that I've almost completely rewritten into spaghetti, so please bear with my terrible code.
So far I've been unable to reproduce the error as it seems to happen randomly
Description of the plugin:
I wanted to adjust the plugin to be able to permanently adjust the range of the loading screens used, so instead of giving a range, I adjusted it to accept an array of numbers.
Because I wanted to add unlockable screens over the course of the game, I added a second array (filled with only 0 or 1) where the array index corresponds to the loading screen number and the 0/1 decides whether the screen had been unlocked yet.
I also have common events set up that run after loading the game and closing the menu in order to constantly refresh the loading screen range.
I am suspecting that the error is likely from an erronous input/plugin command but since I don't know what the error means, I can't pinpoint the mistake
I am completely at a loss here, so any help would be much appreciated!
players have been reporting the "Uncaught Error: Header is wrong" message when playing my game.
I'm pretty sure that it's caused by the loading screen plugin (based on RED_RandomLoadingScreen) that I've almost completely rewritten into spaghetti, so please bear with my terrible code.
So far I've been unable to reproduce the error as it seems to happen randomly

Description of the plugin:
I wanted to adjust the plugin to be able to permanently adjust the range of the loading screens used, so instead of giving a range, I adjusted it to accept an array of numbers.
Because I wanted to add unlockable screens over the course of the game, I added a second array (filled with only 0 or 1) where the array index corresponds to the loading screen number and the 0/1 decides whether the screen had been unlocked yet.
Code:
/*:
* @param ID of loading images
* @desc ID of loading images, seperate with ','
* @default 0
*
* @param Max number of images
* @desc number of screens (minus locked ones)
* @default 0
*
* @help
* ================================================================================
* COMMANDS:
* setLoadingScreen # #
* ~~~Allows you to manually set the loading screen range, f.e. 1 1 2 3 4 6
*
* setScreen screenID 1|0
* ~~~Choose to lock or unlock the version of the loading screen. 0 to lock, 1 to unlock
* setScreen 2 1
* to unlock loading screen 2
*
* ================================================================================
*/
(function() {
var parameters = PluginManager.parameters('RED_RandomLoadingScreen');
var screens = parameters['ID of loading images'].split(/\s*,\s*/).filter(function(value) { return !!value; }); //array for loading screens available
var maxscreens = Number(parameters['Max number of images']);
var screenSwitches = []; //array for choosing locked/unlocked version
var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args)
{
_Game_Interpreter_pluginCommand.call(this, command, args);
if (command.toLowerCase() === 'setloadingscreen') //fill array with the numbers specified
{
screens = [];
for(var i = 0; i < args.length; i++){
screens.push(Number(args[i]));
}
}
if (command.toLowerCase() === 'setscreen'){ // sets array field of the screen id to 0 or 1
screenSwitches[args[0]] = (Number(args[1]));
}
};
var startLoading_leftovers = Graphics.startLoading;
Graphics.startLoading = function() {
do{
var liran = Math.randomInt(screens.length);
var newlimg = 'img/system/Loading.png';
var picid = Number(screens[liran]);
if(picid <= maxscreens && (screenSwitches[picid] === 1)){
screens[liran]+=maxscreens;
screens[liran]=screens[liran]%(maxscreens*2+1); //errorhandling
}
} while(Number(screens[liran])>(maxscreens*2)); //error handling
newlimg = 'img/system/Loading' + Number(screens[liran]) + '.png';
Graphics.setLoadingImage(newlimg);
startLoading_leftovers.call(this);
};
}) ();
I also have common events set up that run after loading the game and closing the menu in order to constantly refresh the loading screen range.
I am suspecting that the error is likely from an erronous input/plugin command but since I don't know what the error means, I can't pinpoint the mistake
I am completely at a loss here, so any help would be much appreciated!