This might be too specific I guess, but I am using Emilio's Dialogic system. So far, I like it myself but I dont know how to set it up for npc interactions. I want to use Area2D collisions to create the interaction for a specific dialogue for each area, make the player stop moving while the dialogue is being played and once it closes give the player their control back. Since I am new I am not sure how to do this via code. Sorry if it sounds too complex, but if anyone can guide me in how I could possibly do this, I will be already thankful.
How to set Up npcs?
With the area 2D. You might check for the activate key button press. Then use the area 2D attached to the player node and see if it overlaps the 2D area of the NPC.
What i did for my projects, was build a dynamic list for the area. The area enters and the list adds the node. Exits, deletes the node. This way I would always have a list of nodes that are in the area.
- Edited
So I did a test where the player have their own Area 2D that when it collides to another Area2D prints (that check if that body's player is, it prints something). This code I attached to the area 2d that is supposed to be the NPC. When it was just checking my body name it worked. But when I added to the code Input.is_action_pressed('ui_interact') it doesnt work, unless I approach the target with the key pressed which is not the point (I want to collide first and then being able to trigger the text by pressing the button). I also tried Input.is_action_just_pressed as well but this one got a worse result. Putting a second "if" also didnt work as well.