Trouble importing (if:) macros from Twine to Dialogue System

Announcements, support questions, and discussion for the Dialogue System.
miko
Posts: 5
Joined: Wed Feb 19, 2025 7:49 pm

Trouble importing (if:) macros from Twine to Dialogue System

Post by miko »

Hello! Apologies if this has already been answered, I tried to search the forums first but couldn't seem to find a fix.

I've been trying to import twison files into Unity and I keep getting an error that says "This Twine macro is not supported yet: (if: $pillow >= 3)" when using (if:) macros. (Set:) macros are working just fine, and I tried to update my Dialogue System to make sure my Twine Importer script was up to date, but I didn't have much luck.

Happy to share the twison file if that would help figure out where I'm going wrong.

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

Re: Trouble importing (if:) macros from Twine to Dialogue System

Post by Tony Li »

Hi,

Yes, would you please share the twison file or at least an excerpt that shows the (if:) statement is context? I've finished work for the night, but I'll check back in the morning.
miko
Posts: 5
Joined: Wed Feb 19, 2025 7:49 pm

Re: Trouble importing (if:) macros from Twine to Dialogue System

Post by miko »

Totally, thanks so much!

Here's the twison file: https://drive.google.com/file/d/1ULWZr4 ... sp=sharing
User avatar
Tony Li
Posts: 23256
Joined: Thu Jul 18, 2013 1:27 pm

Re: Trouble importing (if:) macros from Twine to Dialogue System

Post by Tony Li »

Hi,

Thanks! I'll take a look at this and get back to you with an answer today.
User avatar
Tony Li
Posts: 23256
Joined: Thu Jul 18, 2013 1:27 pm

Re: Trouble importing (if:) macros from Twine to Dialogue System

Post by Tony Li »

Hi,

I'm working on an update. I'll try to post it tomorrow. Your Twine file is fine. The importer just needs to handle two issues. First, it assumes that the link immediately follows the (if:) statement, not separated by a line break. Second, it's not handling multiple (if:) statements in the same node in certain cases. I'll post a patch tomorrow that handles both of these.
miko
Posts: 5
Joined: Wed Feb 19, 2025 7:49 pm

Re: Trouble importing (if:) macros from Twine to Dialogue System

Post by miko »

Hi,

That's great to know, thanks so much! Really appreciate the help.
User avatar
Tony Li
Posts: 23256
Joined: Thu Jul 18, 2013 1:27 pm

Re: Trouble importing (if:) macros from Twine to Dialogue System

Post by Tony Li »

Still fixing one small issue. Should have a patch for you tomorrow.
User avatar
Tony Li
Posts: 23256
Joined: Thu Jul 18, 2013 1:27 pm

Re: Trouble importing (if:) macros from Twine to Dialogue System

Post by Tony Li »

Hi,

This patch should fix the issue:

DS_TwinePatch_2025-02-22.unitypackage

If you notice anything not working the way you expect, please let me know.

Also, this conditional link is missing a colon:

Code: Select all

(if $mindPowers < 3)
[[Turn it off with your mind powers -> mind powers]]
It should be:

Code: Select all

(if: $mindPowers < 3)
[[Turn it off with your mind powers -> mind powers]]
miko
Posts: 5
Joined: Wed Feb 19, 2025 7:49 pm

Re: Trouble importing (if:) macros from Twine to Dialogue System

Post by miko »

Hey, thank you so so so much, this worked great! (if:) macros are doing great, now, I appreciate the help! :D

I'm running into one more problem, and I'm not sure if it's related to the patch or if I've mixed up some settings since the last time I worked, but I'm also having trouble now getting the response menu links to work as expected?

When I write a response menu option like [[this]], it sets the text in brackets to be the name of response menu node, but not the text. So when I write an exchange like this:
Screenshot 2025-02-23 122714.png
Screenshot 2025-02-23 122714.png (18 KiB) Viewed 4585 times
It shows up in the dialogue editor like this:
Screenshot 2025-02-23 122909.png
Screenshot 2025-02-23 122909.png (211.61 KiB) Viewed 4585 times
So my response menu items all show up as the text of the next node, rather than what I put in brackets.

(here's the twison, also, in case it helps)
Spoiler
{
"passages": [
{
"text": "NPC: hello\n\n[[hi!]]",
"links": [
{
"name": "hi!",
"link": "hi!",
"pid": "2"
}
],
"name": "Untitled Passage",
"pid": "1",
"position": {
"x": "700",
"y": "350"
}
},
{
"text": "NPC: how are you doing?",
"name": "hi!",
"pid": "2",
"position": {
"x": "700",
"y": "475"
}
}
],
"name": "test",
"startnode": "1",
"creator": "Twine",
"creator-version": "2.6.1",
"ifid": "3E4D7265-8EF4-47BA-B52F-EE0417814B4E"
}
Thanks again!
User avatar
Tony Li
Posts: 23256
Joined: Thu Jul 18, 2013 1:27 pm

Re: Trouble importing (if:) macros from Twine to Dialogue System

Post by Tony Li »

That may be an issue introduced in the patch. I'll take a look and get back to you.
Post Reply