#How can I load a resource into another resource? Also how can I track an approval setting?

1 messages · Page 1 of 1 (latest)

idle coral
#

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?

frigid rock
#

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.

idle coral
frigid rock
idle coral
# frigid rock 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

frigid rock
idle coral