[PLUGIN] TMX importer

0 favourites
From the Asset Store
The I18N (Translation) is a Construct plugin created to translate text in game.
  • Here is the next version of tmx importer.


    TMX importer


    TMX (*.tmx) file is an output file of tile map editor. Plugin currently only supports two save modes.

    • Base64 (uncompressed)
    • CSV

    Set save mode from menu bar "Edit" -> "Preferences"

    Here is a sample capx.

    The steps of using tmx importer for normal usage are:

    1. load tmx string: "Action:Import tmx string". You can get tmx string from aJax.

    • remember to replace " to ' if copy string into event sheet directly

    2. create tile instances: "Action: Create tiles". This action will create instance, put instance into SOL, then trigger "Condition:On each tile cell" for each instance. You can do other customize.

    • plugin will ignore tmx's invisible layer.
    • plugin will create instance to THE SAME layer name. For example, layer name in tmx is "Ground", there should have "Ground" layer in capx.
    • plugin will set the sprite frame to tile id. See the animation frame in sample capx file for more detail.

    3. release memory: "Action:Release tmx object".

    For advance user, step 2 can replace to "Action: Retrieve tile array". This action will not create any instance, it only trigger "Condition:On each tile cell" for each available cell. You can get properties stored in layer/tileset/tile to create instance manually.

    See test_TMXImporter_adv.capx.

    Execution flow

    rexrainbow2013-07-22 07:20:17

  • How is the collision between player and the walls?

  • delgado

    Collision polygon is defined in c2 (sprite editor), this plugin only

    1. parsing tmx string

    2. create instances to some position. (option)

  • rexrainbow

    thank you

    you deserve to go to heaven (at least C2-heaven)

    not only for this plugin but for all the plugins you develop

  • Wow, this is Awesome! Thank you! :)

  • Update:

    Add expression: total width, total height

  • Hi,

    I thank you for this lovely plugin. This is going to make me sound dumb but I'm having trouble understanding how this plugin works.

    For now I will use your capx as a template to modify upon, but is it possible for you to show a more step-by-step tutorial?

  • Step0. edit tmx file by Tile map editor. Ensure the compression type to Base64 (uncompressed) or CSV

    <img src="http://i1081.photobucket.com/albums/j352/rexrainbow1/screen1-20.png" border="0" />

    Step1. add "Action:Import tmx string",user can put string from tmx file or AJAX

    Step2. add "Action:Set instance position of (0,0)". This action is used to tell plugin the real position of logically (0,0). (It's an offset of whole tiles)

    Step3. add "Action: Create tiles". This action will

    • a. create instances from tmx string

    : layer name will be the same as in tmx

    <img src="http://i1081.photobucket.com/albums/j352/rexrainbow1/screen4-1.png" border="0" />

    : x, y position will be calculated by logically index add offset (set in step2)

    : set frame index by tmx tile id

    <img src="http://i1081.photobucket.com/albums/j352/rexrainbow1/screen2-8.png" border="0" />

    • b. for each instance, put this instance into SOL
    • c. (for each instance) then trigger "Condition:On each tile cell". User can get other data from "expression:LayerProp, TilesetProp, or TileProp". (User can edit these properties in tile map editor.)

    Or use array object to store the "logic position to uid mapping". this array object is using to maintain the "logic world".

    Step4. add "Action:Release tmx object" to release all data. After this action, "Action: Create tiles" will no longer to create instances.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Update:

    Add version to 0.1

  • Update:

    Fix bug at "expression:IsIsometric".

    Here is a demo of using tmx importer and other (unreleased) plugins to create a board world.

  • Update: version 0.11

    "Action:Create tiles" will trigger "Condition:On each tile cell". Now it can get created instance correctly under "Condition:On each tile cell". So user can do something with these created instance.

  • Awesome plugin! i think it may help to build complex games

  • Useful plugin ! Thank you :))

  • I put some capx files on this post about creating tile map with solid property.

  • This plugin could not use in new exporter currently. I will remove jQuery call latter.

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