Page 1 of 1

Dynamic Actor and NPC's?

Posted: Tue May 03, 2022 5:57 pm
by vectorfrog
Hi Tony,

I just purchased the Dialog System and getting started with it. I'm following the guide and ran into a problem. In my project I have a character that is instantiated in the previous scene, not the game scene. How can I assign the Conversation Actor in the Start Conversation Action on the Dialog System Trigger component dynamically? I won't know which character the player has chosen until after the scene loads, is there a way to assign this on an event or some other way besides in the inspector?

edit: if I had read the tool tip, I'd have my answer. Thanks!

Re: Dynamic Actor and NPC's?

Posted: Tue May 03, 2022 6:52 pm
by vectorfrog
I was able to get things working with one exception so far. If I have my player already in the scene, the Selector works just fine and displays like it is supposed to. If I instantiate the player like I normally do, in the previous scene and then load the game scene. The Selector UI doesn't show up. I can still interact with the NPC and start the conversation, but it's not showing the Selector UI. How can I have the Selector UI show up when I dynamically instantiate a character from the previous scene?

Re: Dynamic Actor and NPC's?

Posted: Tue May 03, 2022 7:45 pm
by vectorfrog
I was able to determine that if I have the Dialog Manager prefab instantiated in the scene that I'm instantiating characters, then some things are working. I noticed that Dialog Manager is a singleton, so I decided to see if this works and it does. Is this the correct way of doing it? I'm assuming Dialog Manager needs to be instantiated before any NPC's or player characters, is this right? I'm still learning and going through the documentation, but hope I'm on the right track with this.

Re: Dynamic Actor and NPC's?

Posted: Tue May 03, 2022 7:50 pm
by Tony Li
Hi,

Yes, make sure the Dialogue Manager exists first. That way PC & NPC Dialogue Actor components will be able to register themselves with it, etc.

Re: Dynamic Actor and NPC's?

Posted: Tue May 03, 2022 8:23 pm
by vectorfrog
Thanks once again!

Re: Dynamic Actor and NPC's?

Posted: Tue May 03, 2022 8:31 pm
by Tony Li
My pleasure!