I’m trying to make a game with a dialogue system, and I wanted to incorporate an approval rating with each character. I planned on making a global script and an approval rating resource, as well as loading different dialogue depending on the approval score.
How can I code my resources to load the dialogue into the scene depending on the current approval score?
Also, is there a better way to do the approval rating system?
#How can I load a resource into another resource? Also how can I track an approval setting?
1 messages · Page 1 of 1 (latest)
Resources don't have access to the scene tree so they can't really do anything without a node feeding them the information
There are plenty of dialogue plugins if you need some complex branching behavior, but most games just have a simple solution I find.
Thank you for your response! I can see the benefit of using a plug-in, but I’m asking for educational purposes more than anything. I’d really like to know how I can do something like that for a branching dialogue resource
if/else or match statements, maybe that's what you mean
Yeah I was thinking possibly a match statement, or using an if/then statement.
I have each dialogue item as a resource with a whole bunch of variables from movement on the screen, character scene loaded and emotions played on the screen as well.
I was thinking about using the approval system to match Enemy, Neutral, and Friendly states with saved resources that would be the Enemy, Neutral, or Friendly version of dialogue for each scene.
I also thought about organizing each scene and its number in the array depending on the state it needs to match and the next item that would be in order.
I thought maybe a function like
func load_order(current_scene: str,current_state: ApprovalRating, current_number:int):->void:
then filling the function with
current_scene = the main scene
current_state = string of (character_name.ApprovalRating) being one of the three
current_number = the number for the scene to be loaded with each dialogue scene being interchangeable with the emotional state of each character
It’s still not completely well rounded from what my complete idea would be, but since I’m new to coding and game dev idk if I’m even on the right track
seems legit, just so long as the arrays/dictionaries/classes of dialogue are in a separate area from the functions
Yeah that function would be in the “choices” resource that currently just lets me choose to continue dialogue, make the branching choices, and change scenes.
I’m hoping to make it change scenes with an opening “narrator” bit and then load each character dialogue appropriately