Enhances LDTK Importer functionality with better entity processing.
- Scene Auto-Instantiation: Creates scenes based on LDTK entity identifiers
- Runtime Configuration: Applies LDTK field values to entity properties
- Multi-Type Support: Handles various data types
- Debug Tools: Troubleshooting mode included
⚠ Important: Script variable names must match LDTK field names (case-insensitive)
Map your LDTK entities to Godot scenes in EntityDict.tscn using the format:
LDTKEntityName : YourPackedSceneReference
Automatic Mode (Simplest Workflow)
- Pros: Scenes are instantly imported and placed within your levels.
- Cons: Limited ability to adjust them in the editor due to scene inheritance.
Manual Mode (Maximum Control)
- Pros: Grants full control over placement, properties, and fine-tuning.
- Cons: Requires manual placement of each
EntityImporternode instance.
- Create Entity Dictionary: Create an
EntityDictionaryresource (.tresfile) to map your LDTK entity identifiers to Godot scenes - Configure Import Script: Add the following post-import script to your LDTK import settings
- Update Resource Reference: Replace the
EXAMPLEconstant with the path to your savedEntityDictionaryresource
@tool
# Replace with your actual EntityDictionary resource path
const ENTITY_DICT = preload("res://path/to/your/entity_dictionary.tres")
func post_import(level: LDTKLevel) -> LDTKLevel:
var entity_importer : EntityImporter = EntityImporter.new()
level.add_child(entity_importer)
entity_importer.name = "EntityImporter"
var entity_layer : LDTKEntityLayer = level.get_node_or_null("Entities")
if entity_layer:
entity_importer.entity_dict = ENTITY_DICT
entity_importer.import(entity_layer)
else:
print("Error: No Entity Layer Found in Scene Tree")
return levelManual Setup:
- Add Importer Node: Add an
EntityImporternode to your inherited LDTK level scene - Create Entity Mapping: Create and configure an
EntityDictionaryresource in the inspector to map LDTK entities to your Godot scenes - Connect Entity Layer: Assign your level's
LDTKEntityLayernode to the importer'sentity_layerproperty in the inspector
Tested & Supported:
- All native Godot types (int, float, string, bool, Vec2, etc)
- Enums and enumeration values
- Entity references and relationships
- Arrays of the above supported types
Currently Untested:
- Color type fields
- FilePath type fields
- Tile type fields
Please report any bugs or suggest new features through the plugin's GitHub repository.