Menu

How to export/use the maps?

herrerik
2008-01-22
2013-04-30
  • herrerik

    herrerik - 2008-01-22

    Hi
    I like the editor but wanna use it in a project as well:)

    I use c++ and a graphics engine. For example i could use load the map from a binary file storing a two-dimentional array of chars. Each value hold by the chars would represent one of the tiles. Then i could load tiles into my game and draw them correctly.

    Or is this already done for me? Im a bit lost on how to actually use the maps i create...

    Thanks a lot
    Erik

     
    • Bence Dobos

      Bence Dobos - 2008-02-28

      The only way to export binary data i found:
      Choose the map you want to export, turn off all the layer expect the one you want to export Map->export.
      Choose a destination and a format (8 bit 0 based or 16 bit 0 based). You must export the tiles as weel, so choose File->export tiles.

      You can't do these with the code generation. You can't generate binary data from maps :( And de generated tileset is not the same as the exported tileset.
      Exported tileset contains the tiles the same order as in the editor. But generated tileset not contains the tiles directly but the tile combinations as it appearing in the map (all the 3 layer with all the mirroring merged into one tile).

      Anyway, you can use the example in this URL: http://tilestudio.sourceforge.net/ . There is a c++ (gcc) example under SDL and a DirectX under MS Visual c++. Worth to see.

       
    • Bence Dobos

      Bence Dobos - 2008-02-28

      "TS normally only includes the tiles and tile combinations you actually use in your maps to generate that bitmap, unless you're using #tstilebitmap instead of #tilebitmap"

       
    • Bence Dobos

      Bence Dobos - 2008-02-28

      I found this:
      use #binfile instead of #file

       
    • Bence Dobos

      Bence Dobos - 2008-02-28

      It seems to me working!
      It's an undocumented feature :( but I could figure it out.

      #binfile filename.ext bit
      where bit: 8 16 24 or 32

      here is my code:
      #tileset
      #map
      #binfile <TileSetIdentifier><MapIdentifier>MapData.map 8
      #mapdata
      <TileNumberLoByte>
      #end mapdata
      #end binfile

      #binfile <TileSetIdentifier><MapIdentifier>BoundMapData.bnd 8
      #mapdata
      <BoundMapValue>
      #end mapdata
      #end binfile
      #end map
      #end tileset

       

Log in to post a comment.