Hi,
I'm using Dialogue Manager 3 by Nathan Hoad and have set up some dialogues with NPCs, which are all working great.
My next step was to add dialogue events to the doors of a house.
To do this, I used a TileMap layer, marked a tile with a door, and placed that door on each of my four houses. At the same position, I spawn a Node2D called ActionableDoor, which includes a StaticBody2D for collision so that my player can’t walk through it. Also at the same position, I spawn a DialogueComponent (which has an Area2D) to detect interaction when I press ui_accept. This DialogueComponent has a script for handling the dialogue logic.
I have four doors in the world and identified them using tilemap coordinates. In my World or GameManager code, I assign a different DialogueResource to each door, so that each one has a unique conversation.
My problem:
Spawning the ActionableDoor works fine — it shows up with both its Area2D and StaticBody2D. But for some reason, after spawning a DialogueComponent onto the doors, the dialogue resources won’t load, even though I’m using the correct path.
Additional info: I use @export to set a dialogue_resource for the NPCs but the Node itself has an <empty> resource which I thought would cause the issue. After setting a default resource the problem still persists.
Here's my debug output when starting the scene:
Test dialogue_res_1:<DialogueResource titles="Start,Start2">
Dialog set for door at:(35, 30) → <null>
Children of door:[StaticBody2D:<StaticBody2D#...>, DialogueComponent:<Area2D#...>]
Dialogue resource for this door:<null>
Setting dialogue for door at:(35, 30)
... (same for other doors) ...
Starting dialogue attempt
Starting dialogue with resource: <null>
I'll attach my scripts in the next messages since they're too long for one post.