picalines / godot-ldtk-import-mono Goto Github PK
View Code? Open in Web Editor NEWLDtk importer for Godot (mono)
License: MIT License
LDtk importer for Godot (mono)
License: MIT License
I just started using Godot and LDtk today, and your plugin looks like the most well thought out solution to using them together.
But alas, there seems to be a Plugin Bug. I tried troubleshooting what was going on, but I couldn't get anywhere.
modules/mono/glue/gd_glue.cpp:249 - [PLUGIN BUG] Object reference not set to an instance of an object
at Picalines.Godot.LDtkImport.Importers.BaseSceneImporter.FindOrCreateBaseNode[TNode] (Godot.Node parent) [0x00021] in <07644612e0eb45c4ba1deac2ec736434>:0
at Picalines.Godot.LDtkImport.Importers.TileMapImporter.Import (Picalines.Godot.LDtkImport.Importers.LevelImportContext context, Picalines.Godot.LDtkImport.Json.LevelJson+LayerInstance layerJson, Godot.Node layerNode) [0x000ae] in <07644612e0eb45c4ba1deac2ec736434>:0
at Picalines.Godot.LDtkImport.Importers.LevelImporter.AddLayers (Picalines.Godot.LDtkImport.Importers.LevelImportContext context, Godot.Node levelNode) [0x00153] in <07644612e0eb45c4ba1deac2ec736434>:0
at Picalines.Godot.LDtkImport.Importers.LevelImporter.Import (Picalines.Godot.LDtkImport.Importers.LevelImportContext context) [0x00073] in <07644612e0eb45c4ba1deac2ec736434>:0
at Picalines.Godot.LDtkImport.Importers.LDtkImporter.ImportLevels (System.String ldtkFilePath, Picalines.Godot.LDtkImport.Json.LDtkImportSettings importSettings, Picalines.Godot.LDtkImport.Json.WorldJson worldJson) [0x00073] in <07644612e0eb45c4ba1deac2ec736434>:0
at Picalines.Godot.LDtkImport.Importers.LDtkImporter.Import (System.String ldtkFilePath, System.String settingsFilePath) [0x000b9] in <07644612e0eb45c4ba1deac2ec736434>:0
at Picalines.Godot.LDtkImport.LDtkEditorPlugin.ImportProject (System.String ldtkFile) [0x0008c] in <07644612e0eb45c4ba1deac2ec736434>:0
I have an example project demonstrating the bug, using a LDtk template edited to add a ladder tile entity.
The problem, to be specific, is that the importer isn't finding the Sprite and setting its texture.
testproject.zip
(I was debugging the error myself, because apparently that's possible with Godot addons, which is why there's an extra print statement in your code.)
UPDATE: It seems to work only if I make the Sprite the scene root.
I discovered today that LDtkField cannot be used on a property that executes custom logic.
I don't know how trivial that would be to change, so here is my request:
I would like to be able to run a method of my choice when the LDtkField bound property is set by reimport, much like I can with Exported properties in Tool scripts.
Basically, I have an entity that I would like to overlap the entire world, but only the parts that exist in LDtk.
Is there a way to access each level's bounds programmatically upon import?
This way I wouldn't have to put a Rect on top of my entire level.
(Alternatively, this could be part of some sort of support for post-import logic, linked to in the json?)
See comment
I completely forgot that collision layer & mask are set in TileMap
node, not TileSet
resource. Maybe plugin should look for a TileMap
node inside base layer and duplicate it for all tile layers?
EDIT: (now there are base nodes)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.