Automatically generate Actors, Variables, items from Twine.Json? (Harlowe 3.2.3 | Twison 0.0.1)

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
NPixey
Posts: 13
Joined: Mon Jan 17, 2022 1:21 pm

Automatically generate Actors, Variables, items from Twine.Json? (Harlowe 3.2.3 | Twison 0.0.1)

Post by NPixey »

Hello all
Just figuring how to code in Twine and working with the Dialogue system
Are any more Twine snippets around? I'm new to it, it's quite confusing with so many variations, which is why I would prefer to ask here since I know they are examples that will work with the editor...

A few questions
Question 1: Is it possible to auto-generate Actors, Variables, items from Twine.Json to the Database ? (In the Database>Dialogue editor)



Are int vars if statements possible? I get a Debug error "This Twine macro is not supported yet: (if: $bravery <= 1)" True also is my fist day of Twine/Dialogue- so it all looks like greek to me :P

I was hoping to be able to initialise player vars/stats and have the twine Json update the Variables field, adding the variables dynamically in the fields. rather than doing it all in the inspector.
(set: $bravery to 1)
(set: $lawful to 1)
(set: $neutral to 1)
(set: $altruism to 1)
(set: $chaos to 1)

Here I was hoping to present options based on character bravery intVar.
//later in game showing only text if player has reached certain level ...im a bit iffy on this...and wonder too if there is a way to have an int with range from 0 to 10, from 11 to 20, from 21 to 25 etc

increment bravery on reaching new passage
(set: $bravery to it + 1)


{
(if: $bravery is 1)[
[[game text here!|Passage C]]
]

(else-if: $bravery is 2)[
[[game text here!|Passage A]]
]
(else-if: $bravery <= 3)[
[[game text here!|Passage B]]
]
(else:)[
[[game text here!|Passage M]]
]
}

Any hints, corrections, links to example code that works with dialogue editor would be most appreciated.
;) it's also true I may be trying to do something with twine/dialogue editor that its not designed to do ... so if there are other ways to do the same - then I will learn that! point me there instead :)

With thanks
PS this plugin is amazing <3

N
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Automatically generate Actors, Variables, items from Twine.Json? (Harlowe 3.2.3 | Twison 0.0.1)

Post by Tony Li »

Hi,

The Dialogue System's Twine import is a bit of a work in progress. Not all Twine syntax is supported yet.

The Dialogue System Extras page has an update for the Twine import window. It adds support for these two expressions:
  • (if: condition)[text]
  • (if: condition)[[link]]
It doesn't yet support the combined format:
  • (if: condition)[text![link]]
NPixey wrote: Tue Jan 18, 2022 3:03 pmQuestion 1: Is it possible to auto-generate Actors, Variables, items from Twine.Json to the Database ?
No. Add actors and items/quests using the Dialogue Editor window first. Then you can assign actors to each Twine file in the Dialogue System's Twine Import window:

Image

You can also add variables in the Dialogue Editor window, or don't bother adding them and let the Twine files implicitly add them when you use them in (set: variable...) expressions or in Conditions & Script sections.
NPixey wrote: Tue Jan 18, 2022 3:03 pmAre int vars if statements possible? I get a Debug error "This Twine macro is not supported yet: (if: $bravery <= 1)"
Please try the update on the Dialogue System Extras page. It should get rid of that message.
NPixey wrote: Tue Jan 18, 2022 3:03 pmI was hoping to be able to initialise player vars/stats and have the twine Json update the Variables field, adding the variables dynamically in the fields. rather than doing it all in the inspector.
Yes, that should work.
NPixey wrote: Tue Jan 18, 2022 3:03 pm(set: $bravery to it + 1)
The Dialogue System's Twine importer doesn't yet handle the "it" keyword. I'll need to read up on it.
NPixey wrote: Tue Jan 18, 2022 3:03 pm(if: $bravery is 1)[[[game text here!|Passage C]]
I'll add support for this format in the next update. Right now you can hook to [game text here] or [Passage C] but not both at the same time.
NPixey
Posts: 13
Joined: Mon Jan 17, 2022 1:21 pm

Re: Automatically generate Actors, Variables, items from Twine.Json? (Harlowe 3.2.3 | Twison 0.0.1)

Post by NPixey »

That's a super useful. Thanks for the examples and clear explanations!
:D you're a gem!

Best
N
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Automatically generate Actors, Variables, items from Twine.Json? (Harlowe 3.2.3 | Twison 0.0.1)

Post by Tony Li »

Glad to help! If you continue with Twine and find other features that you'd like the Dialogue System's Twine importer to support, please let me know and I'll add them to the roadmap.
Post Reply