Making variables exclusive to the conversant

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
chrislow19
Posts: 34
Joined: Mon Dec 30, 2019 4:26 pm

Making variables exclusive to the conversant

Post by chrislow19 »

Hi Tony,
My variables list is getting pretty long. I discovered while adding booleans to conversations that a simple "Met NPC" variable won't work because it sets the boolean to true on every other NPC, even if my player hasn't met them yet! So I started creating variables for each individual NPC, "met Rick", "met Daisy", etc. I can see this turning into a huge mess down the road, I'm wondering if there's a way to make the same boolean work across multiple NPC's without them activating each other?
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Making variables exclusive to the conversant

Post by Tony Li »

Hi,

There are two common approaches:

1. Continue using variables, and name them in a way that makes them easy to filter, such as "Rick.met", "Daisy.met", "Daisy.gaveFlowers", "Daisy.insulted", etc. Then you can filter for "Daisy." and see only Daisy's variables. And you can also sort the Variables list alphabetically to group all of Daisy's variables together.

2. Or use actor fields. For example, define an actor field named "Met". Then you can use Actor["Rick"].Met instead of Variable["metRick"] and Actor["Daisy"].Met instead of Variable["metDaisy"]. To add the field to all actors, use the Templates tab.
chrislow19
Posts: 34
Joined: Mon Dec 30, 2019 4:26 pm

Re: Making variables exclusive to the conversant

Post by chrislow19 »

Easy enough, thanks again Tony!
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Making variables exclusive to the conversant

Post by Tony Li »

Glad to help!
Post Reply