Page 1 of 1

Creating Conditions for Adventure Creator Variables

Posted: Sun May 08, 2022 5:55 am
by SuperSparkplug
In my game, which uses Dialogue System and Adventure Creator, I want to have different things happen in one level depending on the results of a previous decisions in a past scene. Because of the nature of the variables and for easier debugging, I determined it might be better to have it be tracked as an Adventure Creator Pop-Up Global Variable rather than a Dialogue System Variable, however, I need to track the player's decision in the dialogue system.

I'm looking for a way to tell the Dialogue System to set the Adventure Creator Pop-Up Variable to a certain setting when the player makes a decision in one conversation and then, in another conversion, set the Condition Syntax to check which form the AC Pop-Up Variable has taken to determine how to start the conversation in one of 2 ways. I could split this into separate conversations, but I wanted to challenge myself to put them in a single convo for efficiency.

How might I do this?

Re: Creating Conditions for Adventure Creator Variables

Posted: Sun May 08, 2022 9:26 am
by Tony Li
Hi,

Internally, pop-up variable values are integers. For example:

acPopUpVar.png
acPopUpVar.png (3.8 KiB) Viewed 881 times

If the variable's value were Bananas, then its integer value would be 1.

You can check and set this value using the Dialogue System's AC Lua Functions. Use acGetInteger("Fruit") to get the current value and acSetInteger("Fruit", 2) to set it to Oranges.

Re: Creating Conditions for Adventure Creator Variables

Posted: Sat Jul 30, 2022 2:06 am
by SuperSparkplug
Reactivating this thread because now I have a similar problem but on the opposite end this time and this is somewhat related.

In this instance, I have a minor variance in a conversation based on a Variable I created in Dialogue System's database. It's It's a Number Variable in my dialogue database that, depending on the circumstances, gets set to 0, 1, or 2 depending on the player's actions. That influences the route one of the conversation goes through (Since all of its outcomes are in a single conversation tree. However, now I instead need to have Adventure Creator sense what number that DS variable is and do something else accordingly. This is somewhat minor, so it's not worth making a AC Global Variable for it.

I need it to have 3 nodes checking if the value is 0, 1, or 2 and then do something if that condition is met. I did try using

Code: Select all

Variable["VariableName"] == 0
Lua Code in the Action List using AC's third party Action List node Dialogue System Check but it didn't work as a condition and the interaction didn't happen. How should I do this?

Re: Creating Conditions for Adventure Creator Variables

Posted: Sat Jul 30, 2022 8:29 am
by Tony Li
Hi,

What isn't working about Dialogue System Check?

Re: Creating Conditions for Adventure Creator Variables

Posted: Sat Jul 30, 2022 10:59 pm
by SuperSparkplug
It just isn't triggering the check properly so nothing happens when I click the object because it can't run the check. What should I do?
Screen Shot 2022-07-30 at 5.28.58 PM.png
Screen Shot 2022-07-30 at 5.28.58 PM.png (66.27 KiB) Viewed 639 times
Screen Shot 2022-07-30 at 11.00.12 PM.png
Screen Shot 2022-07-30 at 11.00.12 PM.png (96.13 KiB) Viewed 639 times

Re: Creating Conditions for Adventure Creator Variables

Posted: Sat Jul 30, 2022 11:07 pm
by Tony Li
Use double equals signs:

Code: Select all

Variable["L5.HospHeadline"] == 0
A single equals sign assigns a value to the variable. Your current Lua code assigns the value 0 to Variable["L5.HospHeadline"]. Instead you want to use "==" so it checks if Variable["L5.HospHeadline"] is equal to zero.

Re: Creating Conditions for Adventure Creator Variables

Posted: Sun Jul 31, 2022 12:43 am
by SuperSparkplug
THERE we go. Thanks, Tony! You're a lifesaver, as always!

Re: Creating Conditions for Adventure Creator Variables

Posted: Sun Jul 31, 2022 8:45 am
by Tony Li
Happy to help!