how to use Relationship function

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
s0963123
Posts: 7
Joined: Mon Jun 29, 2020 1:10 am

how to use Relationship function

Post by s0963123 »

Sorry in advance if the question seems dumb, but I do dig through the forum and find no answer to that.

I want to use the GetRelationship( Actor1, Actor2, "relationship type" ) function for Player1 and Player2 in the dialogue text part of my conversation.
I tried:
[lua(GetRelationship(Player1, Player2,"relationship type")]
but it have error. Why and what is relationship type?
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: how to use Relationship function

Post by Tony Li »

Hi,

Assuming "Player1" and "Player2" are the Names of actors in the dialogue database, try this:

[lua(GetRelationship(Actor["Player1"], Actor["Player2"], "relationship type")]
s0963123
Posts: 7
Joined: Mon Jun 29, 2020 1:10 am

Re: how to use Relationship function

Post by s0963123 »

Tony, thank you for your quick reply.
I tired, but it didn't work.

I am using the "Start Conversation" in playmaker, and it return this error message:

Dialogue System: Lua code 'reutrn GetRelationship(Actor["Player1"], Actor["Player2"], "relationship type"' threw exception 'Code has syntax errors

Here are some screen-cap for reference.
WhatsApp Image 2020-06-30 at 8.50.55 AM (1).jpeg
WhatsApp Image 2020-06-30 at 8.50.55 AM (1).jpeg (117.03 KiB) Viewed 202 times
WhatsApp Image 2020-06-30 at 8.50.55 AM.jpeg
WhatsApp Image 2020-06-30 at 8.50.55 AM.jpeg (153.29 KiB) Viewed 202 times
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: how to use Relationship function

Post by Tony Li »

Hi,

You're missing a right parenthesis. Try this:

[lua(GetRelationship(Actor["Player1"], Actor["Player2"], "relationship type"))]

(Notice the second parenthesis near the end.)


p.s. - You can specify a relationship type that makes sense in your game, such as "Love" or "Obligation". Example:

[lua(GetRelationship(Actor["Player1"], Actor["Player2"], "Respect"))]


p.p.s. - To take a screenshot, you can press the PrtSc key on Windows. On Mac, use Shift+Command+3.
s0963123
Posts: 7
Joined: Mon Jun 29, 2020 1:10 am

Re: how to use Relationship function

Post by s0963123 »

Thank you again. Tony.
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: how to use Relationship function

Post by Tony Li »

Glad to help!
Post Reply