I'm trying to implement a dialogue system where blocks of dialogue are triggered when the player runs into certain flags. Each flag has a script attached, the crucial bit being [SerializeField] private string chapter; Each "chapter" is indicated by the lines that say START, after which the dialogue is supposed to print until END_DIAG. The triggers work, and the first block of dialogue is parsed, but the second flag just parses the first block again (including the 0!_START header). I've attached relevant screenshots showing the .txt file the script reads from, the manager of the array the flags are stored in, and the OnTriggerEnter that checks if the player is inside the trigger.
Findings:
SetFlagisn't actually being called1!_STARTis parsed just fine if I set the starting flag's chapter to that string, but the second flag will still start from0!_STARTregardless- No issues with booleans
What I think could be going wrong:
END_DIAGis doing too much. Only the line between the chapter header andEND_DIAGis meant to print, but the first instance ofEND_DIAGcould somehow be overriding the next chapter- Each flag is just the same prefab with just the chapter changed. Honestly I see no reason why this shouldn't work, but computers can be fickle so this could be it
Any advice would be appreciated