Problems with Ink logic branches

Hi all,

This is a scripting question but not a C# question.

I’m looking for some help with scripting in ink.

Basically I’m trying to write some dialogue that jump to different points depending on a play state variable. Nothing to advanced, but I’m struggling with the ink syntax


{-ottoOzPlaySate == 0:->Intro}

{-ottoOzPlaySate == 1:->Intro2}

{ottoOzPlaySate}
error

->END

// the first interaction
===Intro===
~ ottoOzPlaySate = 1
->END

//Second interaction
===Intro2===
~ ottoOzPlaySate = 2
->END

(I’ve removed the dialogue for ease of reading)

The VAR itself is declared in a separate global file as zero. The first conditional branch is triggered just fine and the variable is changed to one.

But the second time I launch the scripts the second conditional branch is never hit. It moves straight to the error statement, even though the variable appears to equal one.

I’m wondering if I’m comparing an int to a string?

But that is a guess.

Or maybe I’m using the logic branch wrong.

Any help would be greatly appreciated

its a negative, sigh

Well this is a pretty niche asset… not many people have played with dialog.

What does the Ink documentation say? Did you start with a fresh blank script and prove comparisons work?

Another place to check is the discussions page linked to whatever asset you might be using to integrate ink, or the github page.

This is all just standard debugging stuff. :slight_smile:

By debugging you can find out exactly what your program is doing so you can fix it.

Use the above techniques to get the information you need in order to reason about what the problem is.

You can also use Debug.Log(...); statements to find out if any of your code is even running. Don’t assume it is.

Once you understand what the problem is, you may begin to reason about a solution to the problem.