MegaGlest Forum

Modding and game content creation => Tools => Topic started by: jammyjamjamman on 11 December 2017, 11:41:09

Title: Python script map loader! (can be used to convert maps to e.g. JSON files)
Post by: jammyjamjamman on 11 December 2017, 11:41:09
==COPIED FROM MEGAGLEST BOARD==
I wanted to read megaglest maps so I could use them in other things. So, I wrote this *dirty* python 3 script to read a map into a python dictionary. The dictionary is formatted such that it can be easily written to disk as e.g. a JSON file.
Here's a link if anyone else is interested in reading maps in python: https://drive.google.com/file/d/190gXUyiuNKR3ITFtN_zF5MFc6Qogca_f/view?usp=sharing (https://drive.google.com/file/d/190gXUyiuNKR3ITFtN_zF5MFc6Qogca_f/view?usp=sharing)


The code is very badly written and has the following problems (in descending order of importance):

I may fix these problems sometime, or feel free to fix them yourself if you want :).
The code is licensed under the MIT License (https://opensource.org/licenses/MIT).
Title: Re: Python script map loader! (can be used to convert maps to e.g. JSON files)
Post by: tomreyn on 11 December 2017, 14:07:41
Sounds like a handy utility. Maybe put it on a public source code repository (GitHub, Gitlab, Bitbucket etc.) so it's easier to inspect the code and provide patches?

I've placed a backup copy of today's state at https://downloads.megaglest.org/tools/read_map_a2.zip
Title: Re: Python script map loader! (can be used to convert maps to e.g. JSON files)
Post by: jammyjamjamman on 11 December 2017, 23:17:38
Sounds like a handy utility. Maybe put it on a public source code repository (GitHub, Gitlab, Bitbucket etc.) so it's easier to inspect the code and provide patches?

I've placed a backup copy of today's state at https://downloads.megaglest.org/tools/read_map_a2.zip

Thanks for backing it up! Yeah I shouldn't really be using g-drive for storing the script especially since I think there's some clause that "they own the data there"  :O  :look: (don't quote me on that). I'll try to move it over to a git repo asap.

P.s. I've added the license for the script to my post, And I will add it to the top of my script later.