So when traversing a conversation with dialogue fragments we do the normal thing where the OnFlowPlayerPaused() is called to let us know where we are and OnBranchesUpdated() is called with the valid Branches/Targets to let us know where we can go. We then select a valid Branch based on user input and tell the flow player like FlowPlayer.Play(ourSelectedBranch).
All has worked fine, but now we have a new case where we need to pause/interrupt the flow. This occurs when a new kind of FlowFragment is inserted into the conversation to tell the user to walk to a specific location. The conversation continues but there's a point where the conversation has to be paused until the player reaches their destination. For example, the Captain of the ship has to get to a certain spot before he can start barking orders. The way I achieve this is creating a new FlowFragement called CharacterMovement which holds the last DialogueFragment that can be played before the game has to wait for the character to reach their spot, and the next DialogueFragement in the conversation. Basically we removed the connector pin from DialogueFragment <pausePoint> to <resumePoint> and we manage continuing the flow manually. The way I do that is when I get to the <pausePoint> DialogueFragment that has no Branches, I run a CoRoutine to check their location, and when they're at their location and <pausePoint> DialogueFragement has played, I do this:
FlowPlayer.StartOn = CurCMFrag.StartingDialogueFragment;
FlowPlayer is a reference to our Articy Flow Player, and CurCMFrag.StartingDialogueFragment is the DialogueFragment that we wish to continue on.
The problem is that the first time after setting the StartOn to that fragment, when you get to OnBranchesUpdated() the only valid branch is pointing back to itself, ie the StartingDialogueFragment, so when you click the button on the UI you go back to the same DialogueFragment. I've gone into the debugger in nFlowerPlayerPaused() and double checked and the path ends on the correct Target, but for some reason when I get to OnBranchesUpdated() it's pointing to itself the first time. The 2nd time, after I button through this case and the same DialogueFragement is played, THIS time the Branch is the correct Branch which is the next node in the conversation. What's really odd is that the DialogueFragment that's set via StartOn will never have a connection to it from anywhere else so the fact that it shows up as a Branch at all is extra weird.
It's very odd that the DialogueFragment would only have one connector from it's output pin yet OnBranchesUpdate() thinks its pointing back to itself. You'd figure you'd end up in an infinite look but the 2nd time through all is correct.
Is this a known issue or a bug? The only thing I can think of is that there's something fundamentally different using FlowPlayer.Play(Branch) rather than StartOn, but I can't think of any reason why that would have the DialogueFragment point to itself the first time being used after setting StartOn.
Any help is appreciated.
Thanks!
-Mo