Detect new conversations in a conversation?
Posted: Sat May 01, 2021 3:02 pm
Is there a simple way for me to detect whether a conversation has a new, previously inaccessible node? I'd like to use this to in order to tell my UI whether or not it needs to show the 'speak to' prompt.
A quick example to illustrate what I'm trying to do:
1) Player speaks to NPC 1, who tells them to speak to NPC 2.
2) Player speaks to NPC 2, who tells them to go back and speak to NPC 1 (setting a variable to unlock a new node in NPC 1's conversation).
3) Player returns to NPC 1 and accesses the new node, as the new conditions have been met.
All of this works fine. My problem: each NPC has a 'speak to' icon that appears above their heads which uses an OnTriggerEnter, and I would like this to not appear if all conversation nodes with that NPC are currently exhausted. In my mind, what I'm looking for is a simple if (conversationNotExhausted) bool which I can wrap my code in, inside the OnTriggerEnter, but perhaps there's a better way of doing it.
I feel like there's a simple solution to this I'm just not seeing. Pointers very welcome! Thanks.
A quick example to illustrate what I'm trying to do:
1) Player speaks to NPC 1, who tells them to speak to NPC 2.
2) Player speaks to NPC 2, who tells them to go back and speak to NPC 1 (setting a variable to unlock a new node in NPC 1's conversation).
3) Player returns to NPC 1 and accesses the new node, as the new conditions have been met.
All of this works fine. My problem: each NPC has a 'speak to' icon that appears above their heads which uses an OnTriggerEnter, and I would like this to not appear if all conversation nodes with that NPC are currently exhausted. In my mind, what I'm looking for is a simple if (conversationNotExhausted) bool which I can wrap my code in, inside the OnTriggerEnter, but perhaps there's a better way of doing it.
I feel like there's a simple solution to this I'm just not seeing. Pointers very welcome! Thanks.