First of all, I think the "bridge" between Articy and Unity is a great thing, thanks so much for this plugin!
I started fiddling around with the Articy Unity Importer and I think I need some clarification and/or guidance.
Now, I watched all the videos related to the Unity Importer, I looked at the documentation/guides and of course I downloaded and looked at (and still looking while writing this down) the Maniac Manfred Demo.
You written guide/documentation is great and I get the way I can handle the data I get from Articy. All information is listed there, nice, I already could successfully handle the articy objects.
My problem comes down to this: the ArticyFlowPlayer.
Currently I don't know if I want to use the ArticyFlowPlayer since I find it a difficult to wrap my head around the way it needs to be setup/the way it works. The Maniac Manfred demo is not a big help if I have to be honest, well it is of course, I can look at it, study the code and how that project is setup. Saying that it would be great if there would be more tutorials or more examples like that Maniac Manfred, but in smaller scope.
I imagine a simple scene which does basically nothing more than registering user input to traverse a dialogue. Like show what needs to be setup for a bare minimum flow traversal, like a simple non-branching dialogue and then what needs to be done for a branching dialogue.
As of now the Maniac Manfred Demo is a bit confusing, which leads to these questions:
- Can a single Unity scene have more than one ArticyFlowPlayer-Component? Would I want that, Is that a valid use-case?
- Is is valid to attach the ArticyFlowPlayer at runtime via AddComponent only when I need it and remove it when not needed?
- The ArticyFlowPlayer has methods like .Play(), which kind of implies that there are other functions like Pause()/Resume() or Stop(), but there aren't. Can I actually stop the flow?
- The SceneHandler.cs is responsible for all of the game logic at least how things traverse. In order to actually traverse there needs to be a very specific funtion that does so, in this case it's the ContinueFlow-Method, right? This Method is
custom though, it's not an implemented method of the IArticyFlowPlayerCallbacks interface. Do I understand it right that what this function essentially does in that example is this:
flowPlayer.StartOn = aObject;
And I guess this is the gist of it: Setting the .StartOn property in order to dictate at which point the Flow will start/from where it will traverse until it reaches an end, and at some specific points you got to control the flow with the methods of the FlowPlayer (like Play()) ?
Edit: Oh and while am at it: how does the Debugging actually work, what does the "Attach to articy:draft"-Button exactly do?
Edit 2: Is it possible there is a bug with the "Ignore invalid Branches"-Flag or is my code/setup just wrong.
0) The "Ignore invalid Branches"-Flag is set to true
1) In my articy project there is an empty FlowFragment transitioning to a Dialogue with an InputPin and a condition where it checks if a specific variable is == true. This variable was set to true by default.
2) I made a simple script which looks like this:
- Code: Select all
public class DialogueTest : MonoBehaviour,
IArticyFlowPlayerCallbacks
{
public TextMeshProUGUI textMesh;
public ArticyFlowPlayer flowPlayer;
public void OnFlowPlayerPaused(IFlowObject aObject)
{
if (aObject is IDialogue)
{
flowPlayer.Play();
return;
}
var dlgFragment = aObject as DialogueFragment;
if (dlgFragment != null)
{
textMesh.text = dlgFragment.Text;
}
}
public void OnBranchesUpdated(IList<Branch> aBranches)
{
}
[Button]
void ContinueFlow()
{
flowPlayer.Play();
}
}
3) I set that very first FlowFragment as the StartOn Property in the Inspector.
4) When I hit the ContinueFlow-Button in my inspector it traverses to the next FlowObject, hitting again it reaches the dialogue and shows up the correct text until there are no FlowObjects to traverse to.
5) Now, when I set the global variable to false in the DataBase I expect the FlowPlayer to still go through all the FlowObjects when I hit my ContinueFlow-Button since it should "ignore invalid Branches" which means my condition, which was set to false is invalid, but we're ignoring it, right? => It does not.
When hitting the ContinueFlow-Button the Player it stops right before that dialogue.
Is this behaviour with that flag intended or did I misunderstand that functionality, if so: what's the purpose? And is there a way to "brute force" through the Flow?