How to recognize what NPC is Barking and use this in barks condition

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Saper
Posts: 52
Joined: Tue Jan 12, 2021 11:25 am

How to recognize what NPC is Barking and use this in barks condition

Post by Saper »

Hi

I would like to create one big Conversation for my NPC's Barks but with use of conditions I want to group them like:
- Those lines can say all Police members
- Those lines only medic
- and the last group without condition for all npcs to used them.
User avatar
Tony Li
Posts: 22148
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to recognize what NPC is Barking and use this in barks condition

Post by Tony Li »

Hi,

You can check Variable["Actor"]. This will be the display name of the barker. Variable["ActorIndex"] will be the actor's Name field, which you can use to check any other fields in the actor, such as:

- Conditions: Actor[Variable["ActorIndex"]].Profession == "Police"

I recommend using groups for your conditions:

How To: Use Group Nodes To Reduce Condition Checking Time
Saper
Posts: 52
Joined: Tue Jan 12, 2021 11:25 am

Re: How to recognize what NPC is Barking and use this in barks condition

Post by Saper »

I tested the group idea but this don't work with "bark on Idle", and about the variable i don't know how to relate object on scene to a line from conversation.

Example:
I have on scene NPC with Bark UI attached to him and it is a policeman, how will conversation condition know that this object on scene is a policeman
Saper
Posts: 52
Joined: Tue Jan 12, 2021 11:25 am

Re: How to recognize what NPC is Barking and use this in barks condition

Post by Saper »

Thank you, works like a charm :)
User avatar
Tony Li
Posts: 22148
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to recognize what NPC is Barking and use this in barks condition

Post by Tony Li »

Glad to help!
Post Reply