Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Scripting API logging objects crashes the editor #2763
Here a simple example script for making custom tilemap export:
This is the log from the windows event log:
The problem with a console.log or JSON.stringify is the circular reference:
and the workaround is using this small package:
Then you can use it like:
That way the console in the Editor shows a text representation of the whole object.
In my tests this does not crash the editor. I'm consistently getting:
Though, I don't think I've tested this with the Tiled release yet, so it maybe it does crash when using Qt 5.12.6. In that case it would be fixed when we build against Qt 5.12.7.
For me, this outputs:
This may be surprising, but indeed this object does not have a file name. In this case, the map object is a temporary script wrapper around the map's data and
Yes, though you don't need the
That's a nice way to serialize! Just curious, but so far I didn't manage to get includes / requires to work. Did you find a way or did you just copy source code to your script file?
I've pasted the source code in a utils.js and used it from there after Tiled autoloaded the utils.js
That's what I found about the topic:
So maybe we can close this issue.
Ah yes, that works of course!
Hmm, I'm already using
Anyway, yeah, let's close this issue.