Creating Conditions for Adventure Creator Variables

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
SuperSparkplug
Posts: 65
Joined: Fri Feb 06, 2015 3:51 pm

Creating Conditions for Adventure Creator Variables

Post 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?
User avatar
Tony Li
Posts: 22145
Joined: Thu Jul 18, 2013 1:27 pm

Re: Creating Conditions for Adventure Creator Variables

Post by Tony Li »

Hi,

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

acPopUpVar.png
acPopUpVar.png (3.8 KiB) Viewed 993 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.
SuperSparkplug
Posts: 65
Joined: Fri Feb 06, 2015 3:51 pm

Re: Creating Conditions for Adventure Creator Variables

Post 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?
User avatar
Tony Li
Posts: 22145
Joined: Thu Jul 18, 2013 1:27 pm

Re: Creating Conditions for Adventure Creator Variables

Post by Tony Li »

Hi,

What isn't working about Dialogue System Check?
SuperSparkplug
Posts: 65
Joined: Fri Feb 06, 2015 3:51 pm

Re: Creating Conditions for Adventure Creator Variables

Post 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 751 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 751 times
User avatar
Tony Li
Posts: 22145
Joined: Thu Jul 18, 2013 1:27 pm

Re: Creating Conditions for Adventure Creator Variables

Post 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.
SuperSparkplug
Posts: 65
Joined: Fri Feb 06, 2015 3:51 pm

Re: Creating Conditions for Adventure Creator Variables

Post by SuperSparkplug »

THERE we go. Thanks, Tony! You're a lifesaver, as always!
User avatar
Tony Li
Posts: 22145
Joined: Thu Jul 18, 2013 1:27 pm

Re: Creating Conditions for Adventure Creator Variables

Post by Tony Li »

Happy to help!
Post Reply