Page 1 of 1

Conversation related variables

Posted: Tue Apr 30, 2019 9:21 am
by Deadcow
We got dialogues with a lot of conditional branching and lots of NPC to talk to. I thought it might be useful to have variables related to specific conversation along with global variables.

Some conversations might be played several times but will have slight differs based on things we talked previously in this conversation. For instance, variable to check that NPC01 talked about A, talked about B, C, D.... And all this variables related to this conversation specifically. This way we'll quickly grow a bunch of variables hard to orient through .

Not too much of a problem, just a thought :)

Re: Conversation related variables

Posted: Tue Apr 30, 2019 10:08 am
by Tony Li
Hi,

You can do this by adding custom fields to your conversations. To do this, edit a conversation and click on blank canvas area to inspect the conversation's properties. Expand All Fields, and click the "+" button to add a new field. However, the Lua dropdowns for the Conditions and Script fields do not provide a dropdown for custom conversation fields. They do, however, provide dropdowns for custom actor fields. You may prefer to define the custom fields in the actor instead:
  • Actor["NPC01"].TalkedAboutA
  • Actor["NPC01"].TalkedAboutB
  • Actor["NPC01"].TalkedAboutC, etc.
Or you can add them all to the global variables. Devs will often include group names in variable names, such as "NPC01.TalkedAboutA":
  • Variable["NPC01.TalkedAboutA"]
  • Variable["NPC01.TalkedAboutB"], etc.
Then you can sort by group name and/or filter for a specific set of variables (e.g., "NPC01.").

Re: Conversation related variables

Posted: Tue Apr 30, 2019 10:37 am
by Deadcow
I knew there is should be the way to do this in such a nice tool :D Thanks!