Revision of Tiled Map Editor tmx to scnx|nntx|shcx Glue integration toolkit from Fri, 05/25/2012 - 13:43

Tagged:

This is a tool that is designed to integrate directly into the Glue tool which will let you specify Tiled Map Editor files (.tmx) with the "Add Externally Built File" option.

- Build your map with Tiled Map Editor: http://www.mapeditor.org/
Save the map inside your project's directory somewhere (Glue will enforce this)

Simply unzip the contents somewhere useful to you, and in Glue do the following:

Update your glue to the daily build. Following the instructions outlined here:
http://www.flatredball.com/frb/docs/index.php?title=Glue:Reference:Menu:...

1. Click the settings menu, and choose File Build Tools
2. Click "Add new build tool"
3. In the primary arguments:
a. Build Tool: Path to the exe
b. SourceFileType: tmx
c. DestinationFileType: scnx
In the list on the left, you should see: *.tmx -> TmxToScnx.exe -> *.scnx
4. Click ok.
5. Repeat the process for nntx and shcx files, using TmxToNntx.exe and TmxToShcx.exe.

The tool is now integrated into Glue. In order to use it, follow these steps:
1. In any scene, right click on "files"
2. Select Add Externally Built File
3. Select the .tmx file

Glue will automatically run the tmx file through the build tool, and generate a .scnx, .nntx, or .shcx file in your Glue project based on your dialog selection. All changes to the .tmx file will now automatically trigger updates to the file as long as Glue is open.

Node Networks:

  • One NodeNetwork is generated for the entire tmx file
  • One node per tile is generated
  • Nodes are interlinked within each layer. i.e. One tile layer's nodes do not connect to other tile layer's
  • Add an object layer with the same name as a tile layer, with " nonodes" (no quotes) at the end of the name to specify where NOT to draw nodes for that layer
  • Add an object layer with the same name as a tile layer, with " nodesup" (no quotes) at the end of the name to specify which nodes to move up slightly to a new Z plane to fix rendering order in corners
  • Add an object layer with the same name as a tile layer, with " nodesdown" (no quotes) at the end of the name to specify which nodes to move up slightly to a new Z plane to fix rendering order in corners

For fun, try having GlueView open to the scene while you update the tmx file using Tiled Map Editor. GlueView should automatically render the new changes.

You can grab the source code for this tool here:
https://github.com/kainazzzo/TiledMap-FlatRedBall-Conversion
In either repository or zip form.

IMPORTANT NOTES:
You may find it necessary to add this line to your Game's Initialization to avoid black lines:
FlatRedBallServices.GraphicsOptions.TextureFilter = TextureFilter.Point;

You must use zlib or gzip compression (tiled map editor defaults to zlib) to use this tool. Base64 encoding (no compression) also works, but straight XML will not. This is a setting in Tiled Map Editor preferences, and if you haven't changed it, chances are that it will work just fine for you.

Product File: 
Syndicate content