Page 1 of 1

Relationships and Dialogue System

Posted: Thu Oct 22, 2020 11:28 am
by Pendergast
Hello again,

I was wondering : is there any way Dialogue System allows to manage relationships and love or hate "points" depending on what the answers is choosen by the player ?

I was looking at Love/Hate asset you have, but it's much more than I need for my game. I just need to tell unity "okay, if the player say that line, it cause -5 love for that NPC", and "if that NPC is at -50 love, he will say that, and not that instead".
As i am new to unity, i depend a lot on assets, and i wanna know if i have to buy Love/Hate or if i can do this love/hate points system with Dialogue System only :)

I saw somewhere on the forum that it was mentioned that Dialogue System can handle a little bit of this sort of thing.

Thank you very much in advance !

Re: Relationships and Dialogue System

Posted: Thu Oct 22, 2020 1:47 pm
by Tony Li
Hi Caroline,

Yes, the Dialogue System can handle that with Lua functions. (See Relationship Lua Functions) The Conversation Conditions tutorial introduces Lua.

Examples:
  • Dialogue Text: "I disagree with what you just did, player."
  • Script: DecRelationship(Actor["Some_NPC"], Actor["Player"], "love", 5)
  • Conditions: GetRelationship(Actor["Some_NPC"], Actor["Player"], "love") < -50
  • Dialogue Text: "No. I don't like you enough to help you with that."

Re: Relationships and Dialogue System

Posted: Fri Oct 23, 2020 6:48 am
by Pendergast
Thank you so much !!

Re: Relationships and Dialogue System

Posted: Fri Oct 23, 2020 9:41 am
by Tony Li
Happy to help!

Re: Relationships and Dialogue System

Posted: Mon Oct 26, 2020 12:43 pm
by Pendergast
Hi again, Tony !

Trying out the relationship scripts, i got a small problem that says:

Dialogue System: Syntax error in relationship function
UnityEngine.Debug:LogWarning(Object)

Here's what i wrote in the script section of the node : IncRelationship(Player, Merevin, "love", 5);

Thanks !

Re: Relationships and Dialogue System

Posted: Mon Oct 26, 2020 1:18 pm
by Tony Li
Hi,

Please use this:

Code: Select all

IncRelationship(Actor["Player"], Actor["Merevin"], "love", 5);

Re: Relationships and Dialogue System

Posted: Mon Oct 26, 2020 5:32 pm
by Pendergast
Hi,

I used this and there's the same error:

Dialogue System: Syntax error in relationship function
UnityEngine.Debug:LogWarning(Object)

Tho, the game works fine (i did two nodes with conditions who depends on the love variable, and it works still) !

EDIT: Okay, it was my fault, i didn't used the names of the actors i created in the 'Actor' tab of the Dialogue ! Sorry, haha !

Re: Relationships and Dialogue System

Posted: Mon Oct 26, 2020 7:49 pm
by Tony Li
No problem -- I'm glad you got it working!