More Scriptable Development Snapshot
This month Tiled development had a slow start as I was spending the first two weeks on renovation work. I cought up in the third week and ended up making a few big steps towards a scriptable Tiled. I also managed to squeeze in some fixes and improvements for the recent Tiled 1.2.2 release.
Objects List in Tile Collision Editor
Actually the first thing I worked on this month wasn't scripting-related. It was a priority request from a patron to add the list of objects to the Tile Collision Editor. They sometimes had a lot of objects on a tile, in which case having the list helps a lot.
The list can be hidden (default) or shown on the right or at the bottom.
Script Custom Map Export Formats
Initial support was added for defining export formats in JavaScript. Currently this works only for maps, and only to text-based formats, but that can already be quite useful. The easiest format to export to is of course JSON, but you can always put together the string manually. You can find an example in the documentation.
Access and Modify Custom Properties
Being able to associate custom properties to all data types is part of what makes Tiled so versatile. So I think it's noteworthy that they can now also be inspected and changed from scripts!
Create Stuff from Scripts
In the last snapshot, scripts were limited to changing around existing objects. Now they can create objects, layers and even maps and tilesets (though you can't do anything useful yet with the latter two).
Modify Tile Layers
Support was added for accessing the tiles in a tileset and the tiles on a tile layer. Last but not least, those tiles can now be used to modify tile layers! For performance reasons, tile layers edits are done through an "edit object". This is illustrated by the following example:
function fillFirstLayerWithFirstTile() { var tileLayer = tiled.activeAsset.layerAt(0) var tile = tileLayer.tileAt(0, 0) var e = tileLayer.edit() for (var y = 0; y < tileLayer.height; y++) for (var x = 0; x < tileLayer.width; x++) e.setTile(x, y, tile) e.apply() }
Check out the documentation for more information. Of course the class will be expanded with more functionality in the future.
Changelog
Here is the full list of noteworthy changes since the last development snapshot.
- Tile Collision Editor: Added objects list
- Added 'json1' plugin that exports to the old JSON format (#2058)
- Scripting: Added support for map export formats
- Scripting: Added access to the custom properties
- Scripting: Allow creating new stuff from scripts
- Scripting: Added preliminary access to tiles in a tileset
- Scripting: Added mechanism for modifying tile layers
- Fixed Templates view missing from the Views menu (#2054)
- Fixed updating of modified indicator on open file tabs
- Fixed remembering of last used export filter
- Fixed Copy Path / Open Folder actions for embedded tilesets (#2059)
- Fixed truncated text in case of '<' characters in Console window
- CSV plugin: Fixed exporting of nested tile layers
- Linux: Updated to Qt 5.9.7 and Python 3.5
- macOS: Updated to Qt 5.9.7 (now requires at least macOS 10.10!)
A big thanks to everybody who's making it possible for me to spend time on a big feature like the support for scripting! Thanks to your purchases and support on Patreon and Liberapay I'm able to keep spending two full days/week on Tiled development!
Files
Get Tiled Map Editor
Tiled Map Editor
Free, easy to use and flexible level editor.
Status | In development |
Category | Tool |
Author | Thorbjørn Lindeijer |
Tags | 2D, Level Editor, Tilemap |
Languages | Bulgarian, German, English, Spanish; Castilian, Finnish, French, Hungarian, Japanese, Korean, Norwegian Bokmål, Dutch, Russian, Turkish, Ukrainian, Chinese |
More posts
- Tiled 1.11 ReleasedJun 27, 2024
- Tiled 1.10.2 ReleasedAug 05, 2023
- Tiled 1.10.1 ReleasedApr 04, 2023
- Tiled 1.10 ReleasedMar 10, 2023
- Tiled 1.9.2 ReleasedSep 16, 2022
- Tiled 1.9.1 ReleasedAug 11, 2022
- Tiled 1.9 ReleasedJun 25, 2022
- Tiled 1.8.6 ReleasedJun 15, 2022
- Tiled 1.8.5 ReleasedMay 17, 2022
- Tiled 1.9 Alpha ReleasedApr 08, 2022
Leave a comment
Log in with itch.io to leave a comment.