so the last couple of days I'm trying to utilize different aspects of Articy Draft in Unity and so far I'm very happy with lots of the possibilities I get with Articy in combination with the Unity Importer. Like, creating locations based on my templates, reading the IDs of the location from the Database into my Scenemanagement system is a godsend. Thanks so much for this.
Now I'm looking further into the ArticyFlowPlayer and thanks to Nico Probst and the documentation I think I have a general understand of how to get stuff to work the the FlowPlayer. I do have a question though:
So I want to trigger a dialogue, and I do that by sending an Event with an ArticyRef as argument. This ArticyRef is selected in the inspector and is a Dialogue (Not a DialogueFragment!) since these FlowObjects are better readable in the SearchField.
Now the event sets the .StartOn property of my FlowPlayer.
When I use DialogueFragments as ArticyRef start points my system works generally fine, but with Dialogues it seems to be a bit tricky.
So, what's the best way to structure OnFlowPlayerPaused and OnBranchesUpdated to start at a Dialogue but go directly to the first DialogueFragment in the FlowPlayer?
I tried something like this in OnFlowPlayerPaused:
- Code: Select all
if (aObject is Dialogue)
{
flowPlayer.Play();
return;
}
if (aObject is DialogueFragment)
{
DialogueFragment fragment = (DialogueFragment) aObject;
if (fragment != null)
{
textTweenFinished = false;
textMesh.text = String.Empty;
if (textTween != null)
{
textTween.Kill();
}
textTween = textMesh.DOText(fragment.Text, 1.0f).SetUpdate(UpdateType.Normal, true).SetEase(Ease.Linear);
textTween.onComplete += () => { textTweenFinished = true; };
}
}
This kinda works. This way I also can have Dialogues in dialogues and they work. Would that be a legit way of doing it?
If so, I do have an additional problem with this way: Conditions. If I have conditions where I check for some variables being true/false between some of the DialogueFragments, this works. But when I have a condition right before the first DialogueFragment, I get some faulty behaviour.
For example I have a condition like this: Inventory.hasSword == true;
True leads to the Fragment: "I can cut this with the Sword"
False leads to the Fragment: "I need a sword..."
Now per default the .hasSword value is set to false. Once I enter the Dialogue I get the "I can cut this with the Sword"-Fragment, which is the True-Outcome, although the variable is set to false. Changing the Variable in the Global Inspector doesn't change the behaviour, I always get the same result. I tried to edit my FlowPlayer and also stop at Conditions but that also gave me some weird behaviour.
So in recap:
1) Generally, should I adjust my setup in order to better traverse to the first DialogueFragment?
2) How to deal with Conditions as first thing in a Dialogue before the first Dialogfragment?