ID:157255
 
I really have no clue how I would go about doing this - Basically, I have a version of SS13 which I'd like to add a function for admins to have the game export a set of images, one for each Z level of the map that can be added as reference. How would I go about doing this, are there any relatively straightforward ways of dumping an "as-the-user-sees-it" map of the world to a file?
There aren't any quick and easy ways to save map screenshots. To create custom map screenshot previews in Proelium 2, I used presized pngs in conjunction with icon.Insert() to create an image of the map. This was prior to icon.Crop() being able to dynamically create larger /icons to use.

Obviously if the map is big enough, this will take quite some time, but with smaller maps, while still a resource drain, won't be nearly as bad.
In response to tenkuu
tenkuu wrote:
There aren't any quick and easy ways to save map screenshots. To create custom map screenshot previews in Proelium 2, I used presized pngs in conjunction with icon.Insert() to create an image of the map. This was prior to icon.Crop() being able to dynamically create larger /icons to use.

Obviously if the map is big enough, this will take quite some time, but with smaller maps, while still a resource drain, won't be nearly as bad.

Time's not at all an issue, the idea is it'll be an empty, invisible server :P Thanks for icon.Crop / icon.Insert, I'll have a look at those.
In response to Topkasa
Okay, I have most of this working... except I still have no idea how I'm supposed to actually save the completed map sections (the map is over 4096x4096px, so I have to split it up into 4096x4096 sections).
In response to Topkasa
How big are the maps total? Crop() is limited in how big it can create an icon, but as far as I recall, you can import icons of any size to use. IE, you create a blank 5000x5000 png and then DM can open doing this:
var/icon/I = icon('yourcustomimage.png')
I.Insert(new_images)
etc...


So that might be something you want to look into. Obviously that option won't scale nicely if map dimensions change at some point since you'll have to externally recreate new blank pngs.

You can either use ftp() or fcopy() to save the new image, by the way.