That’s all really awesome stuff to know actually, thank you! I got it working, I just wrote a small function that creates a new substring. You are in charge of freeing the memory for it though. The file is going to contain all the dialogue for the game, which is why I have it search for a specific keyword before it starts processing the block of text. This is the test file to give as an example of the formatting
Formatting Guide:
[Tag]Name(Portrait Number):text = dialogue
[Tag]@:text = unnamed or descriptive dialogue
{Tag}Label:Dialogue Tag = Dialogue choice
[Tag]~Begin~ marks the beginning of the dialogue
[Tag]~End~ marks the end of the current dialogue
File:
[Will Never Be Read]~Begin~
[Will Never Be Read0]@:Will never be read.
[Will Never Be Read1]@:How sad.
[Will Never Be Read2]@:I put so much effort into this bit.
{Will Never Be Read2}Indeed:Agree0
{Will Never Be Read2}Say Nothing:Silence0
{Will Never Be Read2}Start crying:Sadness0
{Will Never Be Read2}Get angry:Anger0
[Agree0]@:Yes. . .
[Agree1]@:. . .
[Agree3]@:. . .
[Silence0]@:. . .
[Silence1]@:. . .
[Silence2]@:. . .
[Sadness0]@:Hey come on now, it’s not that sad.
[Anger0]@:Hey! Who exactly do you think you’re yelling at huh? No one! I’m an unnamed line of text put here by someone else!
[Anger1]@:Just get out of here, you’re clearly way too fired up about this.
[Will Never Be Read]~End~
[YourMom]~Begin~
[YourMom0]Billy(2):Lol! Yo mama!!!
{YourMom0}Nuh uhh! Your mom!:Denial0
{YourMom0}Start crying:Laughing at you0
[Denial0]Billy(5):No way man!
[Denial1]@:*Billy would never recover.
[Laughing at you0]Billy(3):Hahhahahhahahha!
[Laughing at you1]@:*You would never recover.
[YourMom]~End~
It just takes everything in that block, and parses it into keys and values. There are actually two HashMaps(I could probably get away with using one TBH) one of them is for dialogue, and the other is for making choices, the output of the choice_map changes the current context, and then you just call the process function to get the dialogue the portrait and the characters name! Then you can just display it however you see fit! I’m still writing it so there are going to be functions like next, that increase the context_count, then checks the Map for an entry with a key matching the current context and count. If none exist, it checks the choice map, if it finds any keys containing the current context and count, it calls the choice function, which takes in the value of a choice_map key, and moves you onto the next branch of the dialogue based on your decision! If there aren’t any matches left in either map, the dialogue ends! Sorry it’s kind of a lengthy response, but I thought you might be interested!