Page 1 of 1

Bark condition with NPC status

Posted: Mon Oct 14, 2024 1:24 pm
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

Re: Bark condition with NPC status

Posted: Mon Oct 14, 2024 1:29 pm
by ssshammi
Hi i also want NPC 2 to react when the bark is positive negative or natural.

Re: Bark condition with NPC status

Posted: Mon Oct 14, 2024 1:46 pm
by ssshammi
Hi i have a problem, the bark cant be added to multiple instances

Re: Bark condition with NPC status

Posted: Mon Oct 14, 2024 2:50 pm
by Tony Li
Hi,

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

barks.png
barks.png (14.05 KiB) Viewed 63 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