Page 1 of 1

Twine import bug

Posted: Mon Aug 02, 2021 7:06 pm
by Nevrak
Hey there,
I'm getting some weird behavior when trying to import a dialogue from twine. For whatever reason my links are becoming extra dialogue?
Image

Is the result from the output of the twine JSON which is
https://drive.google.com/file/d/1wppWn5 ... sp=sharing

I'd really appreciate any and all advise on how to format my twine correctly or my import so that I can have the proper conversation importing!

Re: Twine import bug

Posted: Mon Aug 02, 2021 10:18 pm
by Tony Li
Hi,

You don't need the player nodes. Try formatting your Twine story like this:

twine1.png
twine1.png (8.4 KiB) Viewed 552 times

It will generate Twison JSON like this:
Spoiler

Code: Select all

{
  "passages": [
    {
      "text": "NPC: Hello This is a Dialogue\n[[Okay]]\n[[Exit]]",
      "links": [
        {
          "name": "Okay",
          "link": "Okay",
          "pid": "2"
        },
        {
          "name": "Exit",
          "link": "Exit",
          "pid": "3"
        }
      ],
      "name": "Start",
      "pid": "1",
      "position": {
        "x": "860",
        "y": "383.5"
      }
    },
    {
      "text": "After player clicks Okay",
      "name": "Okay",
      "pid": "2",
      "position": {
        "x": "785",
        "y": "533.5"
      }
    },
    {
      "text": "After player clicks Exit",
      "name": "Exit",
      "pid": "3",
      "position": {
        "x": "935",
        "y": "533.5"
      }
    }
  ],
  "name": "Responses",
  "startnode": "1",
  "creator": "Twine",
  "creator-version": "2.3.14",
  "ifid": "04B7E898-C24B-4E9C-93A6-D2C1CE2167E3"
}
And a Dialogue System conversation like this:

twine2.png
twine2.png (13.21 KiB) Viewed 552 times

Re: Twine import bug

Posted: Tue Aug 03, 2021 1:05 pm
by Nevrak
Hey Tony,
is there at all a way for the Okay and Exit on yours to have scripted values? Because right now I'm not seeing a way to add that to the player responses such that the response will have a script on it rather than the node that the response leads to?

Re: Twine import bug

Posted: Tue Aug 03, 2021 1:36 pm
by Tony Li
If you put the scripted values on the destination node (e.g., "After player clicks Okay"), they'll play as soon as the player clicks Okay.

The exception is if you've ticked the Dialogue Manager's Subtitle Settings > Show PC Subtitle During Line and UNticked Skip PC Subtitle After Response Menu. In this case, you can link to a player node that runs the script and immediately continues. Add a Script: block with the Lua code you want to run, and add a Sequence: block containing just "Continue()" (without quotes).

Re: Twine import bug

Posted: Tue Aug 03, 2021 1:42 pm
by Nevrak
Hey Tony,
I really need the script to be ON the "Okay" response such as:

Image

this is because the response in my conversations such that it could say for example:

Image

Where the script would embed that bottom "Action" "Each player must discard" onto the button for the game's functionality to work properly.

Re: Twine import bug

Posted: Tue Aug 03, 2021 2:02 pm
by Tony Li
Got it. I'll make that addition and try to post a patch here by the end of tomorrow (or sooner if possible).

Re: Twine import bug

Posted: Tue Aug 03, 2021 2:36 pm
by Nevrak
Hey Tony,
Thank you so much, that sounds wonderful!

Re: Twine import bug

Posted: Wed Aug 04, 2021 9:48 pm
by Tony Li
Hi,

Please try this patch:

DS_TwineImportPatch_2021-08-04.unitypackage

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.

Re: Twine import bug

Posted: Thu Aug 05, 2021 3:35 pm
by Nevrak
Hey Tony,
This worked perfectly, thank you so much!

Re: Twine import bug

Posted: Thu Aug 05, 2021 3:57 pm
by Tony Li
Glad to help! Thanks for the suggestion.