Page 1 of 2
Trouble importing (if:) macros from Twine to Dialogue System
Posted: Wed Feb 19, 2025 8:29 pm
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!
Re: Trouble importing (if:) macros from Twine to Dialogue System
Posted: Wed Feb 19, 2025 9:10 pm
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.
Re: Trouble importing (if:) macros from Twine to Dialogue System
Posted: Wed Feb 19, 2025 9:37 pm
by miko
Re: Trouble importing (if:) macros from Twine to Dialogue System
Posted: Thu Feb 20, 2025 10:23 am
by Tony Li
Hi,
Thanks! I'll take a look at this and get back to you with an answer today.
Re: Trouble importing (if:) macros from Twine to Dialogue System
Posted: Thu Feb 20, 2025 8:50 pm
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.
Re: Trouble importing (if:) macros from Twine to Dialogue System
Posted: Fri Feb 21, 2025 5:18 pm
by miko
Hi,
That's great to know, thanks so much! Really appreciate the help.
Re: Trouble importing (if:) macros from Twine to Dialogue System
Posted: Fri Feb 21, 2025 11:08 pm
by Tony Li
Still fixing one small issue. Should have a patch for you tomorrow.
Re: Trouble importing (if:) macros from Twine to Dialogue System
Posted: Sat Feb 22, 2025 9:46 am
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]]
Re: Trouble importing (if:) macros from Twine to Dialogue System
Posted: Sun Feb 23, 2025 12:39 pm
by miko
Hey, thank you so so so much, this worked great! (if:) macros are doing great, now, I appreciate the help!
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 (18 KiB) Viewed 4569 times
It shows up in the dialogue editor like this:

- Screenshot 2025-02-23 122909.png (211.61 KiB) Viewed 4569 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)
{
"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!
Re: Trouble importing (if:) macros from Twine to Dialogue System
Posted: Sun Feb 23, 2025 12:56 pm
by Tony Li
That may be an issue introduced in the patch. I'll take a look and get back to you.