Tileset Editor 1.0 (Proof of Concept)

Is it possible to select a -1 tile background for multiple tiles?

My problem is, that if I save my tileset with your program, all “bg”: -1 are gone.
I used it for tiles with no background. If the line is gone, every multiple tile (e.g. blood) without a background has the standard grass tile as background.

[quote=“Thuztor, post:81, topic:5029”]Is it possible to select a -1 tile background for multiple tiles?

My problem is, that if I save my tileset with your program, all “bg”: -1 are gone.
I used it for tiles with no background. If the line is gone, every multiple tile (e.g. blood) without a background has the standard grass tile as background.[/quote]It should be possible to just have no background. I think. If you leave the “background” slot in the tile select window blank, the tile should remain transparent. Or is there something else? Blood on the ground is laid over the terrain tile, if that’s what you’re seeing, exactly because it has no background. You need a black background if you don’t want it to blend.

Mass editing however, is one of the features I was considering. But I have other problems.
The first thing I did with my newfound independence is break the ASCII generator script so thoroughly it doesn’t work anymore. XD I’m trying to find what exactly I broke without resorting to restoring a backup. So that’ll be a while. :stuck_out_tongue:

A lot of my tiles have a blank background in your program.
But when the program writes the tile_config.json, all “bg”: -1 are deleted.
If “bg”: -1 doesn’t exist for a tile without a background, the game shows always the grass tile as background.

Really? That is crazy behavior… and undocumented at wiki. Oh well, if that’s the case, I have to change my editor as well.

[quote=“Thuztor, post:83, topic:5029”]A lot of my tiles have a blank background in your program.
But when the program writes the tile_config.json, all “bg”: -1 are deleted.
If “bg”: -1 doesn’t exist for a tile without a background, the game shows always the grass tile as background.[/quote]That does not make literally a single lick of sense. If that were the case, the problem that led to the creation of the “Generate ASCII Tiles (with background)” function would not exist. And transparent tiles would not be possible. Please post the tileset you get in output, or send it to my email (controllersean at mail dot ru) so I can test it and see what is actually going on.

edit: in other news, found that error of mine. Turns out some items’ flags fields aren’t set as an array but as a plain text field, and trying to read them as arrays halts the function. Java, why you fail quietly without any sort of information?

Here is an example of fd_blood of my tileset.

First the output of the Tileset Editor:

{
“rotates”: false,
“multitile”: true,
“additional_tiles”: [
{
“id”: “center”,
“fg”: 655
},
{
“id”: “corner”,
“fg”: 656
},
{
“id”: “edge”,
“fg”: 657
},
{
“id”: “t_connection”,
“fg”: 658
},
{
“id”: “end_piece”,
“fg”: 659
},
{
“id”: “unconnected”,
“fg”: 654
}
],
“id”: “fd_blood”,
“fg”: 654
},

And here is my original, handwriten code:

{
“id”:“fd_blood”,
“fg”:476,
“multitile”:true,
“additional_tiles”:
[
{
“id”:“center”,
“fg”:2289,
“bg”:-1
},
{
“id”:“corner”,
“fg”:2290,
“bg”:-1
},
{
“id”:“edge”,
“fg”:2291,
“bg”:-1
},
{
“id”:“t_connection”,
“fg”:2292,
“bg”:-1
},
{
“id”:“end_piece”,
“fg”:2293,
“bg”:-1
},
{
“id”:“unconnected”,
“fg”:476,
“bg”:-1
}
],
“rotates”:false
},

You can believe me, with the output file every tile without a background has a grass tile as background.

I would like to believe you, but since I do not experience that problem myself I cannot debug it. Trust, but verify. For me, all tiles that simply omit the “bg” line have transparent backgrounds. The program works as intended.

Please post your tileset in an attachment or send it to my email. I cannot fix a problem I do not experience.

Okay, here is the output of my tileset with the Tileset Editor.
If you compare the one in the current version, it’s not much different, except the sorting.

https://dl.dropboxusercontent.com/u/69737873/Sonstiges/Cataclysm/ThuztorTilesetoutput%40.7z

File was to big for the Attachments. :wink:

Okay, found it. It’s a bug in Cataclysm itself.

[code] JsonArray tiles = config.get_array(“tiles”);
while (tiles.has_more()) {
JsonObject entry = tiles.next_object();

    tile_type *curr_tile = new tile_type();
    std::string t_id = entry.get_string("id");
    int t_fg = entry.get_int("fg", -1);
    int t_bg = entry.get_int("bg", -1);
    bool t_multi = entry.get_bool("multitile", false);
    bool t_rota = entry.get_bool("rotates", t_multi);
    if (t_multi) {
        // fetch additional tiles
        JsonArray subentries = entry.get_array("additional_tiles");
        while (subentries.has_more()) {
            JsonObject subentry = subentries.next_object();

            tile_type *curr_subtile = new tile_type();
            std::string s_id = subentry.get_string("id");
            int s_fg = subentry.get_int("fg", 0);
            int s_bg = subentry.get_int("bg", 0);[/code]

Or, well, more like an oversight. When loading tile data, the foreground and background both default to -1, as needed. But when loading subsequent subtiles in a multitile, it defaults to 0, which means multitiles with no background defined will use the zeroth tile. I guess one way to bypass this, at the moment, is make sure the zeroth tile is transparent. For instance, by adding a “00” tile definition, and force-selecting a transparent image as its foreground, then clicking Sort so it’s in the top. In the meantime, we should probably file a bugreport.

Does this program work with the 64 bit version of java on win7 64. I downloaded version 0.11 from the original post but when i launch the program i get a ‘busy’ cursor for about 1/10th of a second, and nothing else happens. No errors, no crashes.

Are you trying to launch using the .bat file or the .jar? The .bat might be outdated, so the .jar might work.

Was trying to use the .exe in the root folder. Assumed it was the correct launch method. Will have to try the .jar in the bin folder later.

The exe is just a launcher for the .jar, but it is too simple to just fail. It’s more likely that the .jar itself is failing - Java tends to do that, just fails to work without telling you anything.

Turns out that i was able to successfully launch the .jar file manually with a right click. Not sure why the .exe fails but it does not appear to do anything for me on win7 64bit. Even launching the exe via command prompt yields no further information at all. Just gives me a new/empty command prompt line.

It should run just fine on java 64, however the launcher does not attempt to ‘find’ javaw.exe, so if it isn’t on your path then the program will not be able to launch it. This is most likely the problem. If you add your java 64 bin directory to your path, the exe should work fine.

In other news, I am stopping work on this, since Sean Mirrsen wants to work on it, and Robik also released a tileset editor, the field seems a bit crowded. There is only about 40 or so people this program is of interest too, so I don’t see a need to maintain a 3rd editor.

(However if these people disappear, e-mail me and I will update this again.)

My offer still stands if anyone needs this updated. It seems work on other editors has petered out.

Cool, it is good to have an option for Linux folk too :slight_smile:

Im testing this but when i choose a tileset to edit it does nothing.

I open the file in the lets say Mshock folder and nothing happens I see no tiles or any thing just the blank editor windows etc :frowning:

It’s expected to have the right path. It’s not updated for the nightlies altered tile configuration file (NOT the .json, the other one).

Has any one else done an updated version of this please :slight_smile: