Articy Forum


https://www.articy.com:443/forum/

ArticyFlowPlayer: Getting Fragments in Dialogue

https://www.articy.com:443/forum/viewtopic.php?f=46&t=23208

Page 1 of 1

ArticyFlowPlayer: Getting Fragments in Dialogue

Posted: Wed 22. Apr 2020, 20:28
by btsslawa
Hey there,

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?

Re: ArticyFlowPlayer: Getting Fragments in Dialogue

Posted: Tue 28. Apr 2020, 15:34
by [Articy] Christian Schildt
Hi btsslawa,

I would recommend you to take a look into our Maniac Manfred demo project. It covers the use case to start on Dialogues and gives you an example of what we would recommend as a good practice.
I tested Conditions as the first thing in a Dialogue before the first Dialogfragment and had no issues with it. I used the ArticyDebugFlowPlayer for testing, which is located in Assets/ArticyImporter/Helper. You find there a prefab and the source.
Can you check if your problem also occurs when using the ArticyDebugFlowPlayer?


Best regards,

Chris

Re: ArticyFlowPlayer: Getting Fragments in Dialogue

Posted: Wed 29. Apr 2020, 09:31
by btsslawa
Apparently the Maniac Manfred Demo does the same thing, so that should be ok for now :D
As for the conditions as the first thing in a Dialogue:

Uh. It seems to work now again. And I don't know why...in the last days it appears the whole communication between Articy and Unity with my project is somehow off. I don't know where the fault is. Is it the combination of me importing quite often new changes from the Articy project and after the reimport is complete starting the game without the Playmode Options (Reloading Domain and Scene is disabled) which might lead to specific problems? Quite annoying :/

Re: ArticyFlowPlayer: Getting Fragments in Dialogue

Posted: Tue 5. May 2020, 16:53
by [Articy] Christian Schildt
Hi btsslawa,

Good, that it works now.

If Domain Reloading is disabled, the plugin calls EditorUtility.RequestScriptReload after an import, which should make sure that at least missing Domain Reloading is no issue.
I tested your issue also with the same Playmode Options, but had no luck with reproducing it. If you observe how such a behavior can be reproduced, please let us know.


Best regards,

Chris

All times are UTC
Page 1 of 1