Twine Import and Conditions

Announcements, support questions, and discussion for the Dialogue System.
Kelias
Posts: 6
Joined: Tue Dec 28, 2021 4:43 pm

Twine Import and Conditions

Post by Kelias »

Hello,

First of all, a huge thank you for the work done on this awesome package that is DM.

My concern is the import of .json files with Twine. On the whole it works fine but I have two specific problems, the first one being the most important for me:

1/ Let's take a Twine passage like this:
(if:$variable1 is true)[Text A]
(if:$variable2 is true)[Text B]
Text C
When I import to the Dialogue System, I only have Text C and no box is created to conditionally display Text A and Text B. These last two texts are not found and everything points only to Text C. (Set: macros works fine though)
I guess, given the way the Dialogue System editor works, it should have created a box with condition 1 showing TextA+TextC, one with condition 2 showing TextB+TextC and finally a 3rd one with Text C in case neither condition is met?

2/ I have several (8) passages on Twine that link to the same place, [[Wake up]]. But contrary to what is said in the Dialogue System manual ("If a link connects to a node whose text is exactly the same as the link in Twine, then in the Dialogue System they'll be treated as the same node instead of duplicating"), I end up with 8 "Wake up" boxes after the import. These boxes have a title that looks like this: "Wake up Link 18" or "Wake up Link 8", etc.

Thank you in advance for any help you can give me, especially for point #1, which would save me and my writer a lot of time.
User avatar
Tony Li
Posts: 22152
Joined: Thu Jul 18, 2013 1:27 pm

Re: Twine Import and Conditions

Post by Tony Li »

Hi,
Kelias wrote: Tue Dec 28, 2021 5:00 pm1/ Let's take a Twine passage like this:
(if:$variable1 is true)[Text A]
(if:$variable2 is true)[Text B]
Text C
When I import to the Dialogue System, I only have Text C and no box is created to conditionally display Text A and Text B. These last two texts are not found and everything points only to Text C. (Set: macros works fine though)
I guess, given the way the Dialogue System editor works, it should have created a box with condition 1 showing TextA+TextC, one with condition 2 showing TextB+TextC and finally a 3rd one with Text C in case neither condition is met?
I can confirm this is a bug. I'll try to have a fix ready by the end of tomorrow.
Kelias wrote: Tue Dec 28, 2021 5:00 pm2/ I have several (8) passages on Twine that link to the same place, [[Wake up]]. But contrary to what is said in the Dialogue System manual ("If a link connects to a node whose text is exactly the same as the link in Twine, then in the Dialogue System they'll be treated as the same node instead of duplicating"), I end up with 8 "Wake up" boxes after the import. These boxes have a title that looks like this: "Wake up Link 18" or "Wake up Link 8", etc.
The multiple links (the blue nodes) are intentional because they might have different conditions on them. But they should end up pointing to the same passage node.
Kelias
Posts: 6
Joined: Tue Dec 28, 2021 4:43 pm

Re: Twine Import and Conditions

Post by Kelias »

Tony Li wrote: Tue Dec 28, 2021 9:04 pm Hi,
I can confirm this is a bug. I'll try to have a fix ready by the end of tomorrow.
Great! Thanks a lot for this reactivity, I'm waiting for the fix. :)
Tony Li wrote: Tue Dec 28, 2021 9:04 pm The multiple links (the blue nodes) are intentional because they might have different conditions on them. But they should end up pointing to the same passage node.
Allright, so that's normal. And yes, the boxes do point to the right node.

Thanks again !
User avatar
Tony Li
Posts: 22152
Joined: Thu Jul 18, 2013 1:27 pm

Re: Twine Import and Conditions

Post by Tony Li »

This patch should fix the issue:

DS_TwineImportPatch_2021-12-30.unitypackage
(Edit: Updated package)

The fix will also be in version 2.2.24.
Kelias
Posts: 6
Joined: Tue Dec 28, 2021 4:43 pm

Re: Twine Import and Conditions

Post by Kelias »

Tony Li wrote: Wed Dec 29, 2021 9:27 am This patch should fix the issue:

DS_TwineImportPatch_2021-12-29.unitypackage
Hello again, and thanks for this patch.

Unfortunately it does not work for me. Problem is still the same, I have no errors when importing (if: macro is "recognized") but TextA and TextB not seen anywhere, much less the condition field that should be in their boxes : everything points only to a box containing only TextC. I have checked and rechecked my syntax several times but I don't see any problems.

I thought that a condition different from booleans seemed to work, but same issue (i tried if:$variable1 is "yes"). Also, I found a little problem when using "greater than" and "less than" operators (sorry I didn't come to add another bug to the list !). I tried this : (if:$number <= 5)[[Passage]] and on import the field becomes this : Variable["number"] == 4. But it shows that the import seems to work for the conditions that condition the display/insertion of a [[]] passage, but not for the text [].

Thank you again for any help you can provide.
User avatar
Tony Li
Posts: 22152
Joined: Thu Jul 18, 2013 1:27 pm

Re: Twine Import and Conditions

Post by Tony Li »

Hi,

Please use this update:

DS_TwineImportPatch_2021-12-30.unitypackage

I added more robust handling for links that use [this-format] as well as links that use [[this-format]].
Kelias
Posts: 6
Joined: Tue Dec 28, 2021 4:43 pm

Re: Twine Import and Conditions

Post by Kelias »

Thanks again for your help. In tried this new patch but unfortunately, same issue here, I don't understand what is causing it. Conditions for links works, but not when it comes to displaying text to the NPC according to the conditions (here when a boolean variable is true). Did I forget something? I've checked my syntax many times and made tests, but don't hesitate to tell me if I should send you the .json file.
Last edited by Kelias on Sun Jan 02, 2022 5:07 pm, edited 1 time in total.
User avatar
Tony Li
Posts: 22152
Joined: Thu Jul 18, 2013 1:27 pm

Re: Twine Import and Conditions

Post by Tony Li »

Hi,

Would you please send me the .json file? You can post it here, PM it to me, or email it to tony (at) pixelcrushers.com. Thanks!
Kelias
Posts: 6
Joined: Tue Dec 28, 2021 4:43 pm

Re: Twine Import and Conditions

Post by Kelias »

Sent! Thanks again for your time, it's very appreciated.
User avatar
Tony Li
Posts: 22152
Joined: Thu Jul 18, 2013 1:27 pm

Re: Twine Import and Conditions

Post by Tony Li »

Hi,

I'm following up on this. I replied to your PM to request some additional info. Please let me know how I can help.
Post Reply