Page 1 of 1

Map Editor (works with hex grids)

Posted: Sat Feb 01, 2014 6:42 am
by tiger_eye
Hey guys and gals, I made something that I want to share:

https://gitorious.org/tome_map_editor/tome_map_editor

This is a GUI application that can modify existing ToME4 maps! The documentation on the website is a little sparse, so this forum post will serve as the primary documentation for the moment.

Installation
Click the "download" button from the webpage above, or clone the git repo which will let you easily update to the latest version:

Code: Select all

git clone git://gitorious.org/tome_map_editor/tome_map_editor.git
Prerequisites
Python 2.7 and pygame should be the only requirements. Note that Python 3 won't work (at least not yet). Somebody is looking into making a standalone application for Windows users that will have no requirements.

Running the app
From the command prompt:

Code: Select all

python main_pygame.py [filename]
or

Code: Select all

./main_pygame.py
where "filename" is the ToME for map file, such as "data/maps/towns/derth.lua". If no file is given, then a file browser dialogue is opened that allows a file to be chosen.

Features
  • Hexagon tiles and Square tiles are both supported; toggle-able
  • Color of background and text matches what is shown in-game (when using ASCII)
  • Tiles can show in-game text, and the text used in the map file; toggle-able
  • Locations defined by "addSpot" are displayed; toggle-able
  • Save map files directly to usable Lua files
  • Save screenshots
  • The originally loaded map can be shown; toggle-able
  • Virtually unlimited Undo/Redo
  • ...and more!
Screenshots
(click any image below for fullsize image)

Below shows Derth with hexagon tiles, "addSpot" locations shown, using in-game text display:
Image

Next, Last Hope with hexagon tiles, black border/grid disabled, using text as defined in the map file:
Image

Finally, since this is a map editor, here is an example of an edited map just for fun!
Image

Using the editor
The toolbar shown below displays all the tiles for the current map, the currently selected tile, and the available commands:

Image

There are three columns displayed for the tiles.
  • The left column shows the in-game text used in ASCII mode (note that many tiles display "#").
  • The middle column shows the number of these tiles currently used in the map.
  • The right column shows the text for the tile as defined in the map file, which is guaranteed to be unique.
There are many ways to select a tile:
  • Click on the tile in the toolbar
  • Middle-Click on a tile in the map editor
  • Use the mouse wheel to scroll the selection up or down
  • Arrow keys to move the selection up or down
Left-Click on a tile in the editor to change it to the currently selected tile.
Right-Click on a tile to revert it to its original state.

And, uh, that's about it!

Final remarks
This map editor application was developed very rapidly. It currently has a narrow scope of functionality, and I think it performs that functionality wonderfully. However, this is not (yet) a general purpose editor. If you want additional features, then please share. All feedback and contributions are welcome! Actually, contributions would be excellent: feel free to modify the code and please share your modifications.

So, yeah, I hope some of you find this application useful. This actually came about because I want the fixed maps redrawn for the tome-hex addon (please help!), and since ToME has more than 50 fixed maps, editing all of them will take some time.

I can also see this application being useful for the new Quest Addon contest.

Cheers!

Re: Map Editor (works with hex grids)

Posted: Sat Feb 01, 2014 7:56 am
by Marson
Awwwwwesome!

Re: Map Editor (works with hex grids)

Posted: Sat Feb 01, 2014 4:08 pm
by The Revanchist
Does this one only work on Linux?

(That is what .py means, right?)

Because, if so, that is unforntunate for me...

Re: Map Editor (works with hex grids)

Posted: Sat Feb 01, 2014 4:17 pm
by Marson
Python also runs on Windows and MAC: http://www.python.org/download/

Re: Map Editor (works with hex grids)

Posted: Mon Feb 03, 2014 4:46 am
by tiger_eye
I added some features to the map editor that should make it easier to use. Here are the highlights
  • Configuration file ("configs.py") to let you easily change default behavior
  • Command line arguments (run "python main_pygame.py --help" to see usage)
  • Examples of making a new map with new tiles ("example_tiles.py" and "example_map.lua")
The examples should be particularly useful for some people; for instance, those designing a map with new tiles, or those who are working on completely separate modules altogether :)

I am not familiar with installing and using Python 2.7 in Windows, so I am unable to give instructions for how to make this work in Windows. Hopefully somebody else can provide instructions (or a standalone application).

Re: Map Editor (works with hex grids)

Posted: Mon Feb 03, 2014 6:48 pm
by Sradac
tiger_eye, y u so cool?

I think your signature sums it up.

Any chance to get a "build a new map" feature with this, as opposed to just editing what already exists? If ToME had an "easy" to use map builder, I think it would open to floodgates for ToMES popularity so now almost anyone could create custom content without having to know LUA

Re: Map Editor (works with hex grids)

Posted: Thu Mar 13, 2014 8:33 pm
by dyze
yeah so has that somebody had any progress with compiling an executable? :D
i was just thinking that having this could enable players/modders to create versions of the world map, and we could have a randomly selected world map on startup.

Re: Map Editor (works with hex grids)

Posted: Thu Mar 13, 2014 11:01 pm
by joelsdaman1
This is the coolest thing ever!