XML Output in Map Editor

The server can't save your maps? Don't worry, code is here!

During your adventure in creating maps, you might encounter a few hiccups along the way. For example, the level editor might hiccup and fail to save your hard work, or the server could decide to take a little break!

But don't worry, instead of feeling frustrated or saying farewell to your efforts, our wonderful friend, prosuwanted, has come to the rescue with a clever solution. They've figured out how to safeguard your progress by converting it into an xml format. This means you can breathe easy and not stress about losing any of your valuable work.

Here's the simple code you need to run in the console:

// Code by prosuwanted
{
  let s = '';
  for (const o in es) {
      if (!es[o].exists) continue;
      s += compi_obj(o);
  }
  
  // Create a Blob containing the XML content
  const blob = new Blob([s], {type: 'application/xml'});
  
  // Create a URL for the Blob
  const url = URL.createObjectURL(blob);
  
  // Create a download link
  const a = document.createElement('a');
  a.href = url;
  a.download = mapid + '.xml';
  
  // Download & clean up
  a.click();
  a.remove()
}

Once you run the code, you will download the xml file. In the future, you can simply import that file to bring back your map, allowing you to hold onto your progress without the need for goodbyes!

Last updated