Giter VIP home page Giter VIP logo

legendsexportsprocessor's Introduction

THIS PROJECT IS OBSOLETE

I have moved my maintenance efforts entirely to the legends processor module of the PyLNP, which is more stable and efficient. While this bundle will remain available, I suggest using the PyLNP instead unless you have good reason not to.

https://bitbucket.org/Pidgeot/python-lnp

LegendsExportsProcessor

A simple script to compress and sort the files exported from Dwarf Fortress' Legends Mode.
Compressing the .bmp maps to .png usually reduces file size by 95 to 99+ percent (yes, really).
Compressing the legends.xml, which is tens to hundreds of MB, often reduces the file size by a similar margin.
The script then moves the compressed files to region-specific folder and puts site maps and world maps in separate subfolders.

To get a copy, can use the 'download as a zip' option on the right and place the whole unzipped folder in the LNP/utilities folder of the DF Starter pack or the contents in the same folder as the Dwarf Fortress executable.

This script is released under the GPL3. License files for 7zip and OptiPNG are included.


General overview of functions:

  1. Find the folder to work in (must contain "Dwarf Fortress.exe"), either in current folder or the relative path from a Starter Pack utilities folder

  2. Establish which region's exports we're working with, by iterating back from 99 and looking from a match. Display message explaining function of the script if nothing is found.

  3. Call OptiPNG to compress the bitmaps to PNG format.

  4. Call 7zip to compress the legends XML in .zip format. If all required files are available, an archive compatible with "Legends Viewer" will be created (includes other text history files and a map).

  5. Move all output files to a "User Generated Content" folder next to the Dwarf Fortress folder, and delete color key text files.


The Python version is written for Python 3 as a cross-platform implementation.

It is more robust regarding unexpected circumstances, and uses the built-in zipfile function instead of 7z.
However, it isn't quite cross-platform as I'm unsure how to comvert bitmaps without optipng available.
It must be run in the DF folder, and won't work from anywhere else - unlike the .bat version.

legendsexportsprocessor's People

Contributors

peridexiserrant avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

legendsexportsprocessor's Issues

Breaks if dropped into the LNP/utilities folder

For consistency, it's good for Dwarf Fortress utilities to function normally if placed in the LNP's utilities folder, instead of wherever they expect to be.

This is a trivial fix - simply check the folder, copy the dependencies into place, and cd to the correct directory. Testing the issues system mostly...

Avoid having to copy dependencies around by using `%~dp0` instead of `%cd%`

Avoid having to copy dependencies around by using %~dp0 instead of %cd%

The script currently copies many dependencies to the DF folder when running from a LNP utilities folder. If these dependencies are called using %~dp0 they could be left in the origin folder, and avoid cluttering the DF folder.

Multi-platform support would be really nice

It's not really something I'm up to, but it would be good to support other platforms.

I tried writing a Python 3 version a while ago (which I'll put up soon), which is at least comparable to pre-satellite map versions. Completing this would be good.

It may be more widely useful if ported to Unix shell script, but I can't do that. I also assume that it would need different 7-zip libraries and presumably also for optiPNG.

Dwarf Fortess Folder not found

When trying to use the version that is included in current Starter Pack, the Exports Processor throws:

Error: Dwarf Fortress Folder not found!

I didn't move it anywhere and I'm lunching it using the Starter Pack Launcher.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.