Hi folks,
I've reached out to the developer of a plugin I'm using for support, but haven't received a response in a few days, so I figured I'd make a post here to see if this is maybe something I could fix myself (and hopefully learn a bit more about what is happening).
I'm using the plugin "Ritter Ultimate Event Spawner", which is more or less working completely fine in my project. The only issue I have is that the plugin will crash the moment I launch the game from the editor, but it will only do this once. After I close and re-launch the game, it works, and will continue to work until I stop launching the game for a while (change windows, do something else, or work in the editor for a bit). After waiting, launching the game will cause the crash again, but only the first time.
This is the error report:
The plugin is a paid one, so I'll just post the one function that is causing the crash at line 1160:
The specific line at 1160 in the crash report is:
While I can simply not set any spawn map in the parameters to pre-load, this causes other issues with event spawning, so having a pre-loaded spawn map is a necessity. But, having any set in the parameters causes the crash (whether it is one map ID, multiple, and regardless of how many events are on the spawn map).
A link to the plugin can be found here, if anyone wants to look at it (or already has it): https://notritter.itch.io/ritter-ultimate-event-spawner-rpg-maker-mz
Some things I have already tried:
Any advice on how I might fix this crash is much appreciated!
I've reached out to the developer of a plugin I'm using for support, but haven't received a response in a few days, so I figured I'd make a post here to see if this is maybe something I could fix myself (and hopefully learn a bit more about what is happening).
I'm using the plugin "Ritter Ultimate Event Spawner", which is more or less working completely fine in my project. The only issue I have is that the plugin will crash the moment I launch the game from the editor, but it will only do this once. After I close and re-launch the game, it works, and will continue to work until I stop launching the game for a while (change windows, do something else, or work in the editor for a bit). After waiting, launching the game will cause the crash again, but only the first time.
This is the error report:
The plugin is a paid one, so I'll just post the one function that is causing the crash at line 1160:
JavaScript:
/**
* --------------------------------------------------------------------------------
* Spawn Map Data Preloading
* --------------------------------------------------------------------------------
*/
DataManager.preloadMaps = function() {
if (!Ritter.Params.preloadMaps) return;
var mapIds = Ritter.Params.preloadMaps;
for (var i = 0; i < Ritter.Params.preloadMaps.length; i++) {
DataManager.loadSpawnMap(mapIds[i]);
}
};
/**
* Loads Map Data for Spawner.
* Can also spawn events on map load.
* This allows for you to spawn an event from any map
* without preloading.
* Just enter mapId and eventId into spawnEvent to spawn
* any event from any map without preloading.
*
* @param {number} mapId - The Map Id # or "Map Name".
* @param {number} eventId - The Event Id # or "Event Name".
* @param {number} x - The X Location to Spawn an Event.
* @param {number} y - The Y Location to Spawn an Event.
* @param {boolean} save - Spawn as Saved Event?
*/
DataManager.loadSpawnMap = function(mapId, eventId, x, y, save) {
var map = new XMLHttpRequest();
var url = 'data/Map%1.json'.format(mapId.padZero(3));
map.open("GET", url);
map.overrideMimeType("application/json");
map.onload = function() {
Ritter._SpawnMaps.push(mapId);
const mapData = JSON.parse(map.responseText);
$MapData[mapId].events = mapData.events;
$MapData[mapId].events.forEach(event => {
if (event !== null) DataManager.extractMetadata(event);
})
if (Imported.Ritter_BoundarySystem) Ritter.Boundary.extractBoundaryData(mapData);
if (typeof eventId === "string") eventId = Ritter._getEventIdFromString(mapId, eventId);
if (eventId > 0) $gameMap.spawnEvent(mapId, eventId, x, y, save);
};
map.onerror = function() { throw new Error('Failed to load: ' + url); };
map.send();
};
The specific line at 1160 in the crash report is:
JavaScript:
$MapData[mapId].events = mapData.events;
While I can simply not set any spawn map in the parameters to pre-load, this causes other issues with event spawning, so having a pre-loaded spawn map is a necessity. But, having any set in the parameters causes the crash (whether it is one map ID, multiple, and regardless of how many events are on the spawn map).
A link to the plugin can be found here, if anyone wants to look at it (or already has it): https://notritter.itch.io/ritter-ultimate-event-spawner-rpg-maker-mz
Some things I have already tried:
- Disabling all other plugins
- Changing the location of my project files from my NAS to local storage (incase it was a loading speed/performance issue)
- Making a different spawn map and trying it instead
- Replacing all of my core files
Any advice on how I might fix this crash is much appreciated!