Welcome to the forums @chris3spice!
I am trying to figure out how to get the questions and answers. I was thinking json files for each area because the inventory tutorial i followed so far uses json. That way each "section" of my game can have a linked file with the questions and answers it can ask. Is json good or is there something else I could use?
Using JSON should work fine, I do not foresee any issues. You could also use exported variables and then set the answers in the Godot editor, but that wouldn't be as flexible as a JSON and could be harder to structure if you want to have multiple questions per node/NPC.
I want it to where the user clicks on an enemy and it pops up the question screen with an answer and four options to pick from for the answer. I think I know how to get the enemy to be clickable... I'll just set another Area2D that looks for a click... My problem is how do i detect if the enemy is in range... Should I make another Area2D on the player that is set to the range? should the enemy have an Area2D?
I'd make the Area2D on the player if you want to use an Area2D for detection. Using an Area2D on the enemies for player detection would work too, but then you need to have another Area2D for each enemy. From a performance perspective, using a single Area2D on the player for detecting distance would be better.
Though, you'd likely need dozens to hundreds of Area2D nodes to see much of a difference, so either way would work. Ultimately I'd recommend going with whatever solution you feel is best.
I'd use an Area2D for this, if it was me, as other solutions are likely to be more involved, require code that isn't quite as generic, and could be harder to maintain and debug.
I'm stuck with how to go next... Should I make it so whenever the Question screen opens it goes through the json file? If so how do make it refresh the question every time it makes the question screen visible?
I'd say its up to you! You could load the JSON file every time the question screen opens, every the time the question itself becomes visible, when the scene is loaded (have enemies load their JSON) or any other solution. It really depends on what works best for your project and experience.
I wouldn't necessarily recommend loading the JSON every time the question becomes visible, I would probably load it ahead of time or only when the UI opens, but since the JSON files are likely not to be thousands of lines long, I think it wouldn't make too much of a difference either way. If I was making a game like this, I'd probably have the enemy nodes load their JSON in _ready
and then just pass it to the UI.
I feel overwhelmed. I'm already getting lost in my code and feel like I'm doing it all wrong. Any tips or pointers to push me in the right direction are appreciated.
Don't worry, you're likely not doing it wrong! Even if it is "wrong", it is a learning experience and every little bit helps build a base of knowledge that helps with future projects :smile:
It can be overwhelming though, so I would suggest tackling one thing at a time, breaking complex/large things down into small, manageable steps. Then you can focus on each small step which shouldn't be as complex to tackle, and as a bonus you can see progress by looking at all the steps completed!