[PLUGIN] TMX importer

  • rexrainbow

    hi. i made for you demo map with object layer. it is your demo from first post with new object layer. on this map there are objects-triggers for map transitions, object for chest and object for showing info from sign/board. I need simply make basic objects on a place where object placed. It can be, for example, simple red rectangle. Can you help me?

    link for map: https://www.dropbox.com/s/nr6vwardbzefnx5/tmx_import_objects.zip

  • SirG

    Thanks, I will take a look on it. I have saw object layer in text editor.

  • Equinox80

    Uh, I'm not sure. I always use the same tmx file at first post.

  • Equinox80

    Uh, I'm not sure. I always use the same tmx file at first post.

    I don't mean different TMX files, I just mean for instance, My TMX file has 8 different tilesets. Now right now I am only using 1 tileset of course, but my first tileset is like an old medieval military (tent-based) camp ground currently at 700+ tiles (anims). Now I have more tilesets since I had to cut them up because C2 crashes at 1000+ anims. So if I want to add different types of trees, I need to use Tileset 2 which has several trees.

    How do I import tileset 1 AND 2 in C2, as it's already made in TMX.

  • Equinox80

    Hum... do you mean that you might want to get tile image at runtime without stored in sprite in C2?

    You might use "Action: Retrieve tile array" + load image from url

    Action: Retrieve tile array:

    "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.

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

    See test_TMXImporter_adv.capx in first post.

  • rexrainbow

    any luck with objects ?

  • SirG

    Work in progress. I had read "object" into plugin.

    Now I need to add a condition and some expressions to fetch information at event sheet.

    BTW. The "object" could be a "trigger area". It might be a useful things in my board system. I would like to create an "area" plugin to handle the logical "trigger area".

  • Update:

    Add "condition:On each object", "expression:ObjGroupName", "expression:ObjGroupWidth" , "expression:ObjGroupHeight", "expression:ObjectName" , "expression:ObjectType", "expression:ObjectWidth" , "expression:ObjectHeight", "expression:ObjectX" , "expression:ObjectY", "expression:ObjectProp" to read "object layer" into event sheet.

    "condition:On each object" will be triggered when executing "action:Create tiles", or "action:Retrieve tile array" for each object. Then use these expressions to get information of (each) object.

    Capx

    SirG

    Here it is.

  • rexrainbow

    this is amazing! thank you!!!

    i need your advice - where to make hotpoint (i placed at 0.0) in tiles (in C2) to make them work properly? it seems like tiles placing correct, but other objects (when i make them on objects layers) - staying not correct above tiles. i have to add in TMXimporter objects parser "+8" to position to place objects properly.

  • SirG

    Hum... I might add some expression to get physical position from logical index.

    Edit:

    Please redownload this plugin, I had added expression:ObjectPX, expression:ObjectPY, these two values will map to the same position of logical X,Y, (the position of tile).

  • Try Construct 3

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

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

    Thanks for quick reply. I`ll try to test <img src="smileys/smiley2.gif" border="0" align="middle" />

  • Hm that is a good idea,

    Although I was just meaning how do I make a map with TMX that uses multiple tileset files, and then load that into C2, using multiple sprites, for example tileset 1 contains 700 tiles, whereas Tileset 2 contains 400 more tiles. With both tilesets being in a different file, tileset1.png and tileset2.png.

  • Update:

    Add "action:Create tiles in a duration", "action:Retrieve tile array in a duration", "condition:On retrieve finished", "condition:On retrieve duration", "expression:RetrievingPercent".

    "action:Create tiles in a duration" or "action:Retrieve tile array in a duration" could split tmx tiles array loading in many ticks. So that the screen will not be hold when loading a big map

    When loading finished, it will trigger "condition:On retrieve finished", user could release tmx tile array under this condition.

    (Now "condition:On retrieve finished" will be triggered in all cases)

    Note: this feature could not decrease loading time, it might increase loading time.

    "condition:On retrieve duration" will be trigger each tick during load duration. User could use it and "expression:RetrievingPercent" to create a loading progress bar. (The range of "expression:RetrievingPercent" is from 0 to 1.) Then destroy this bar under "condition:On retrieve finished".

    SirG

    This capx was fixed from your sample capx, now it has some response when tiles loading.

  • Update

    Fix bug when using multi-tileset. Thanks for Tokinsom

  • Update:

    Add

    • "condition:For each layer property", "expression:Current layer property name, Current layer property value"
    • "condition:For each tileset property", "expression:Current tileset property name, Current tileset property value"
    • "condition:For each tile property", "expression:Current tile property name, Current tile property value"

    to retrieve properties.

    Note: these conditions would not retrieve properties in order since properties was saved in a hash table.

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