[plugin] rex_tmx_importer_v2

  • rexrainbow Let me explain it more clearly. I'm trying to create three indefinite levels of ground for endless runner game. I'm creating this ground from segments. Each segment has the same width and I create each segment in Tiled. So my segments is something like this:

    _ _ _ _ _ _ _ _ _ _ _

    _ _ _ _ _ _ _ _ _ _ _

    _ _ _ _ _ _ _ _ _ _ _

    And your importer works great spawning one segment like this. Now what I want to do is to spawn another segment while previous one is already on the board so they will connect together without any gaps (empty spaces) between them. But because of low FPS my implementations for this are framerate dependent and when I don't have any gaps on my PC, I have them on debug mode or on iPad. Maybe some of you would have some solution for this. Right now I'm thinking to somehow glue them manually by picking last tile of previous segment and translating tiles of the new segment so they will stick together...

  • samur

    I have no idea. Maybe check the position of origin point. Or....

  • rexrainbow - it appears that the json file that tiled is creating doesn't work with the v2 json importer anymore.

    I notice that compared to your example file, all attributes in your json example data have 2 "" around them, where as tiled only puts 1 around each one. eg: "height" etc

    If i manually replace all " with "" and try and load that, it accepts it, but when you run the example it gives a javascript error in chrome saying "cannot find "tile layer 1"

    Tiled map Editor 0.10.1

    Construct r183

    Json TMX parser

    TMX importer v2

    Rexrainbow's sample capx for the importer

    steps to reproduce -

    1) In tiled map editor goto file save as "type json"

    2) try to copy json file into example capx -> multiple errors complaining about only 1 " around attributes in json

    3) tried replacing all " with "" and pasted into example capx. C2 accepts it, but gives javascript errors when running a preview.

    perhaps the plugin just needs to be updated to work with the latest version of tiled?

  • justifun

    If user want to put " into expression, it need to replace " to "".

    Another solution is load string from external text by official AJAX plugin, so that the source string does not need to be changed.

  • rexrainbow

    Ok i tried loading the json file as an imported project file using the ajax "request tiles.json" command

    then Ajax on "tiles" completed - importing the ajax.lastdata into tmximporter v2

    but i get the following javascript error during preview.

    TMX Importer: Can Not Find "Tiles" Layer

    which is the name of my layer in tiled.

    Do i need to specify that name somewhere in my event code? or rename my file or something?

    Here is my modified sample capx.

    https://db.tt/RYnwCGsU

    thanks for the help.

  • justifun

    Right, this plugin will try to create tiles/chess at c2 layer with the same as in tiled editor layer.

    I change layer "Ground" to "Tiles", it works. It seems that you put them in "Tiles" layer in tiled editor.

  • rexrainbow - Thank you so much for all of your help!

  • Has anyone tried combining this importer with a bitwise method for dynamically changing the tiles after creation?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hey, I got these odd errors. Did I do something wrong here? I simply coped/pasted over the folders into my C2's behaviors folder. [attachment=0:101kkbyw][/attachment:101kkbyw]

  • DatapawWolf

    These are plugins, put them in export/html/plugins/ folder. Not in behaviors folder.

  • rexrainbow whoops, well that was pretty foolish of me. Thanks!

  • This plugin has become very useful to me, great work as usual!

    rexrainbow I noticed that in the tmx file there is also image information for the tilesets available. Like the relative path and width and height. If I'm not mistaken, these aren't retrievable through the plugin. May I be so blunt to humbly request expressions for these?

  • This plugin has become very useful to me, great work as usual!

    rexrainbow I noticed that in the tmx file there is also image information for the tilesets available. Like the relative path and width and height. If I'm not mistaken, these aren't retrievable through the plugin. May I be so blunt to humbly request expressions for these?

    I could add path expression next week. Width and height of tiles might be got by expression TileWidth and TileHeight.

  • > This plugin has become very useful to me, great work as usual!

    >

    > rexrainbow I noticed that in the tmx file there is also image information for the tilesets available. Like the relative path and width and height. If I'm not mistaken, these aren't retrievable through the plugin. May I be so blunt to humbly request expressions for these?

    >

    I could add path expression next week. Width and height of tiles might be got by expression TileWidth and TileHeight.

    Thank you! I checked TileWidth and TileHeight again and they return the dimensions of a tile, the grid size so to speak. They do not return the dimensions of the tileset image. Sorry if that wasn't clear in what I initially wrote.

  • PixelRebirth

    Thanks, I will check it next week.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)