Page 1 of 1
how to use Relationship function
Posted: Mon Jun 29, 2020 1:29 am
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?
Re: how to use Relationship function
Posted: Mon Jun 29, 2020 7:56 am
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")]
Re: how to use Relationship function
Posted: Mon Jun 29, 2020 8:59 pm
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 (117.03 KiB) Viewed 206 times
- WhatsApp Image 2020-06-30 at 8.50.55 AM.jpeg (153.29 KiB) Viewed 206 times
Re: how to use Relationship function
Posted: Mon Jun 29, 2020 10:11 pm
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.
Re: how to use Relationship function
Posted: Mon Jun 29, 2020 10:58 pm
by s0963123
Thank you again. Tony.
Re: how to use Relationship function
Posted: Tue Jun 30, 2020 8:19 am
by Tony Li
Glad to help!