Bark condition with NPC status

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
ssshammi
Posts: 6
Joined: Wed Feb 28, 2024 9:20 am

Bark condition with NPC status

Post by ssshammi »

Hi
I want the bark to work like a conversation

default bark- if the condition is neutral (bark neutral) positive (bark positive ) else negative (barks negative)

and i want to trigger animation if the bark is negative positive or neutral
ssshammi
Posts: 6
Joined: Wed Feb 28, 2024 9:20 am

Re: Bark condition with NPC status

Post by ssshammi »

Hi i also want NPC 2 to react when the bark is positive negative or natural.
ssshammi
Posts: 6
Joined: Wed Feb 28, 2024 9:20 am

Re: Bark condition with NPC status

Post by ssshammi »

Hi i have a problem, the bark cant be added to multiple instances
User avatar
Tony Li
Posts: 22093
Joined: Thu Jul 18, 2013 1:27 pm

Re: Bark condition with NPC status

Post by Tony Li »

Hi,

You'll want to set up the conversation similarly to this:

barks.png
barks.png (14.05 KiB) Viewed 60 times

Let's say you're using the Relationship Lua Functions to keep track of how NPCs feel about the player.

For example, if the NPC hates the player, you use this Lua (e.g., in a Script field):

Code: Select all

SetRelationship(Actor["NPC1"], Actor["Player"], "like", -50)
Then you can set the first dialogue entry's Conditions to:

Code: Select all

GetRelationship(Actor["NPC1"], Actor["Player"], "like") <= -50
You'd set the second entry's Conditions to:

Code: Select all

GetRelationship(Actor["NPC1"], Actor["Player"], "like") >= 50
and the third entry's Conditions to:

Code: Select all

50 < GetRelationship(Actor["NPC1"], Actor["Player"], "like") and GetRelationship(Actor["NPC1"], Actor["Player"], "like") < 50
This will work, but it will only work for NPC1. To make it work for any NPC, you will need to change the Conditions. When the Dialogue System starts a bark or conversation, it sets Variable["ActorIndex"] to the NPC's name. (Technically it sets it to the actor index.)

So instead of Actor["NPC1"] you can use Actor[Variable["ActorIndex"]]:

Code: Select all

GetRelationship(Actor[Variable["ActorIndex"]], Actor["Player"], "like") <= -50
Post Reply