Ok, I was able to put together a Mod Script that will fix the specific problem. WITH GREAT POWER... and all that. When set to DELETE = true, this will go page-by-page through the game and PERMANENTLY DELETE paths over the size set in the THRESHOLD variable. That will make your pages load, but it will remove those paths, if you had an intended purpose. // Find oversized paths across all pages in the campaign.
// Set DELETE = true to actually remove them. Defaults to dry run.
var THRESHOLD = 10000;
var DELETE = false;
on("ready", function() {
var pages = findObjs({_type: "page"});
var pageNames = {};
pages.forEach(function(pg) {
pageNames[pg.id] = pg.get("name") + " (" + pg.get("width") + "x" + pg.get("height") + ")";
});
var paths = findObjs({_type: "path"});
log("Scanning " + paths.length + " paths across " + pages.length + " pages, threshold=" + THRESHOLD);
// Sanity check. If these are still 0, the campaign-load is the problem, not the script.
if (paths.length === 0 && pages.length === 0) {
log("WARNING: no paths or pages visible to the API. Sandbox may not have loaded campaign data.");
log("Try other object counts as a sanity check:");
log(" characters: " + findObjs({_type: "character"}).length);
log(" graphics: " + findObjs({_type: "graphic"}).length);
log(" handouts: " + findObjs({_type: "handout"}).length);
return;
}
var byPage = {};
paths.forEach(function(p) {
var w = parseFloat(p.get("width")) || 0;
var h = parseFloat(p.get("height")) || 0;
if (w > THRESHOLD || h > THRESHOLD) {
var pid = p.get("_pageid");
if (!byPage[pid]) byPage[pid] = [];
byPage[pid].push({id: p.id, w: w, h: h, layer: p.get("layer"), controlledby: p.get("controlledby"), obj: p});
}
});
var pageIds = Object.keys(byPage);
if (pageIds.length === 0) {
log("No oversized paths found.");
return;
}
log("Found oversized paths on " + pageIds.length + " page(s):");
var totalRemoved = 0;
pageIds.forEach(function(pid) {
var pageLabel = pageNames[pid] || "(unknown page)";
log("");
log("Page " + pid + " " + pageLabel);
byPage[pid].forEach(function(item) {
log(" path " + item.id + " " + item.w + "x" + item.h + " layer=" + item.layer + " controlledby=" + item.controlledby);
if (DELETE) {
item.obj.remove();
totalRemoved++;
}
});
});
if (DELETE) {
log("");
log("Removed " + totalRemoved + " path(s).");
} else {
log("");
log("Dry run. Set DELETE = true to actually remove these.");
}
});