First Scriptable Development Snapshot


This development snapshot brings the first bit of scripting to Tiled! While the API is still very limited and you can only execute scripts by writing or pasting them into the Console view, it is still a big step forward since many decisions have been made about the exact approach to take.

The API is still entirely undocumented, which will be one of the first things I plan to fix as we extend it further to allow changing all properties and also painting on the map. To see what is currently implemented, check out the ScriptModule (available as "tiled"), EditableMap and EditableLayer classes.

Changelog

Justin Zheng

  • Fixed label color to update when object layer color is changed (#2019, #1976)
  • Fixed stamp and fill tools to adjust when tile probability is changed (#2025, #1996)

Allan Nordhøy

  • Fixed capitalization of JSON and Wang in some places (#1845)

Thorbjørn Lindeijer

  • Added support for executing JavaScript in the Console (#949)
  • Python plugin: Made the Tileset API more complete (#2037)
  • Fixed misbehavior when trying to open non-existing files

Files

Tiled for Windows (32-bit), snapshot 20 MB
Version 2018.11.29 Nov 29, 2018
Tiled for Windows (64-bit), snapshot 18 MB
Version 2018.11.29 Nov 29, 2018
Tiled for Windows XP, snapshot 18 MB
Version 2018.11.29 Nov 29, 2018
Tiled for macOS, snapshot 14 MB
Version 2018.11.29 Nov 29, 2018
Tiled for Linux (64-bit), snapshot 31 MB
Version 2018.11.29 Nov 29, 2018

Get Tiled Map Editor

Download NowName your own price

Comments

Log in with itch.io to leave a comment.

Is it planned for the scripting to include UI functionality? Specifically, I'm interested in creating a UI to edit custom (JSON formatted) data that I use in my project. Right now I'm editing it by hand and pasting it into the desired custom property fields, but building a custom editor for it would make it much less error prone.

I definitely plan to look into the possibility. To do what you're asking, it would not be enough to define a new piece of UI in a script, but also to integrate it into the Tiled UI somehow, specifically the Properties view. Support for such things is not going to be automatic, but it's something that could be worked on. About the custom properties in general, there are plans to add support for data structures, arrays, enums and options like min/max value, in which case you may not need to code a custom UI. But all that is going to take time as well.

Without a proper design spec it's hard for me to argue this, but in my head I was thinking of a button which creates its own UI window and injects a string property into the currently selected object without needing to hook into the formal UI itself. Your version is definitely more intuitive, though. And support for data structures would indeed render my proposed script unnecessary (assuming it supports dictionaries which can contain arrays of dictionaries... I think that's as far down as I've gone so far, I guess, but a dictionary of [data type] and array of [data type] would handle it. The UI on that could get interesting, though).

Hi bro, I just tried your latest version of Tiled. I opened the Tiled editor and it opened then closed again. No error message. I googled around and I saw one of your post about deleting the python plugin. When I did that it worked again. I'm a developer so I have quite a few python versions installed. Could that be the problem?

I thought I should let you know. 

I guess some versions of Python could definitely cause that problem. It would be worth to look into automatically disabling the plugin when this affects many users. Do you remember where you read about deleting the Python plugin?

I read your post on here. 

https://discourse.mapeditor.org/t/tiled-wont-open/3473/6

Ha, that's funny. Well, good to know another person is having this problem. I'll really have to see if I can reproduce it and to find some workaround, because we can't have Tiled crashing on startup of course.

(1 edit)

I can try and uninstall python and see what happens. Then reinstall it using the default recommended installation paths. I currently have python installed like this and it may be the problem. I can check and let you know. 


Okay, so I uninstalled python as well as Tiled 1.2.1. Reinstalled Tiled and Python all at there default paths (C:\Users\user1\AppData\Local\Programs\Python\Python36 ; C:\Users\user1\AppData\Local\Programs\Python\Python37)
and everything worked fine. 

Okay, this is weird. So I may have reproduced the error. It has to do with the environment variables. 

Tiled 1.2.1 does not open once you have python 3.6.6 as the main Python System Path Variable. 

Tiled 1.2.1 does this weird thing 

However, if you change the System Path Variable of Python to any other version, Tiled 1.2.1 works perfectly. 



I hope this helps you. Also worth noting that I reinstalled python to C:\Python\Python366 and C:\Python\Python371 respectively. However, I doubt this causes the problem with the System Variable Paths.