#Dialogue not advancing (note: not using Yarn Spinner) [SOLVED]

1 messages · Page 1 of 1 (latest)

queen wagon
#

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:

  • SetFlag isn't actually being called
  • 1!_START is parsed just fine if I set the starting flag's chapter to that string, but the second flag will still start from 0!_START regardless
  • No issues with booleans

What I think could be going wrong:

  • END_DIAG is doing too much. Only the line between the chapter header and END_DIAG is meant to print, but the first instance of END_DIAG could 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

young escarp
#

There isn't enough information here to tell what could be wrong. How did you confirm that SetFlag isn't being called?

#

!code 👇 show all relevant code

teal houndBOT
queen wagon
young escarp
#

Is the flagmanager script on an active object on the scene?

queen wagon
#

Yes, this prefab. This probably isn't ideal but this is just what I have so far.

young escarp
#

But is it in the scene? Prefabs don't run their scripts unless they're in the scene (and they're not prefabs anymore when they're there)

queen wagon
#

It's in the scene yes

queen wagon
young escarp
#

Sure

#

You should add a debug.log in the SetFlag method as well just to confirm that it's not the debugger that's at fault here. And make sure there are no other errors shown in the console while playing

queen wagon
young escarp
#

The FlagManager doesn't seem to do anything? Nothing uses the FlagIndex variable

queen wagon
#

Hmm okay, will investigate then post what happens

queen wagon
#

Okay that was a long delay but I'm back at it. I've determined I don't even need the FlagManager and that it's actually kind of a detriment to the program's design so I just culled it entirely. I'm still trying to figure out why it's not progressing

queen wagon
#

Fixed, boolean was out of place