Page 1 of 1

Conversation available or not with NPC

Posted: Wed May 17, 2023 8:33 am
by hassaanmustafa263
Hi. I'm just new to this Dialogue System and stuck somewhere. When you approach an NPC (proximity selector) there appears a popup on the screen to interact with that NPC. When we press spacebar and If some conversation is available, the conversation starts successfully. But if there's no conversation available, nothing happens.

I want to detect whether any conversation is available or not. Is there a method or property available for detecting this?

Basically, I want to show something on-screen if we can chat (chat available) with the NPC and I want to hide that thing if we cannot chat with NPC (chat not available).

Thanks for anyone considering to reply. Any help will be much appreciated.

Re: Conversation available or not with NPC

Posted: Wed May 17, 2023 12:49 pm
by Tony Li
Hi,

Thanks for using the Dialogue System! Please see: How To: Not Select Usable If Conditions Are False

Re: Conversation available or not with NPC

Posted: Thu May 18, 2023 6:04 am
by hassaanmustafa263
Thanks for the quick reply. The solution you proposed is something different than what I wanted to achieve. Let me explain to you in detail.

I have an NPC with 5 conversations which gives me 5 quests. When I complete all 5 quests and then I approach the NPC (proximity selector) there appears a popup on the screen to interact with that NPC. But this time there is no conversation left in the dialogue system as I have completed all 5 conversations and quests but the popup still appears to interact with the NPC. (The popup says the name of the NPC and to press the space bar to interact). And when I press the space bar now, nothing happens. Which can be irritating for the users.

The issue is, when I have completed all 5 conversations, why does the popup still appear? How can I hide it if no conversation is left? (or maybe I don't have the suitable condition to have any conversation with the NPC). So how can I hide the popup?

Maybe there is a way through which I can know whether I can have a successful conversation with the NPC or not?
I hope you understand it now.

If I am unable to explain my point, please let me know.

Re: Conversation available or not with NPC

Posted: Thu May 18, 2023 7:56 am
by Tony Li
Hi,

If I understand you correctly, nothing in the Dialogue System Trigger's Conditions section will be false in this case. But the conversation you've specified in Actions > Start Converrsation may not currently have anything to show, since all of the quests have been completed. In this case, you can check DialogueManager.ConversationHasValidEntry. I updated the HOWTO above in this follow-up post.

Re: Conversation available or not with NPC

Posted: Fri May 19, 2023 2:17 am
by hassaanmustafa263
Thanks a lot. That did the job.

Re: Conversation available or not with NPC

Posted: Fri May 19, 2023 6:30 am
by Tony Li
Glad to help!