![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Noodle13 |
I’ve been hitting my head against a wall for the past three weeks trying to get around this problem. I don’t know coding but I’m learning as I go.
What I’m trying to achieve:
The player is a 2dKinimaticBody and has the ability to “inspect” items they run across. Like a point-and-click game but with keyboard clicks instead of a mouse. When the player goes up to a bookshelf and clicks the “inspect” key (the E key), a dialog box will appear and say something like, “yep, it’s a bookshelf, kinda boring.” Then when the player clicks on it again it says something different like, “Still a bookshelf”. And if the player continues to click on it, the second response will just recycle itself.
The problem:
I’ve tried most tutorials on how to build dialog boxes and they all work just fine… except they only work for 1 response since the input BBC text is in the actual dialog player node. Then usually the tutorial wraps up and I’m stuck with a working dialog box that only works for one thing. On the first scene of my game there are like 30-40 clickable objects to look at… am I supposed to build a dialog box for each and every item? each one formatting the dimensions, font, anchors for each one? I mean, if thats the answer then so be it…
However, what I would like to achieve is adding the dialog text directly to the bookshelf. Then, when a player clicks on the bookshelf, it sends the text to a single dialog box that then displays the text. That way I have 1 dialogbox group of nodes that I can save as a scene, instance into different scenes, and just save the text to each of the objects.
Is that even a thing? Can someone point me in the right direction at least? Someone who tried to help me said to bounce the dialog text from the area2d object to a singleton, then set up the dialog box to read the text off the singleton. I’ve tried and it doesn’t seem to work.
Pictures attached for clarity of my Node Tree, the script for my Dialog box, the script for the Area2d Bookshelf thing, and a script of my player just incase. I have a singleton set up but the only thing in there is - var Current_Dialog =
I’ve looked at a ton of YouTube tutorials (yes, even the GDQuest, Emilio, Kidscancode, and TheHappyCat)… I liked the happycat one but I couldn’t figure out how to do what I want as described above… and I even sat down to learn how to make a json file… but can’t find anywhere that tells me how to integrate it into godot. Or if they do I have the same problem I’ve always had where I need to build multiple text diolog systems. Even downloaded the “Godot Dialog System” from DaveTheDev and ran across the same problem of not being able to get it to play multiple instances of dialog.
mini-rant: I just don’t understand how you can have a game building engine that it’s so overly complicated to get a simple text dialog going. Man, I’m not even getting into branching dialog yet and this is already kicking my butt.