Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Can I use Twine 2.0 syntax with Twine 1 look? Custom JS from 1.4 in 2.0?

I'm having a go at using the Twine 2.0 framework and syntax to see how it compares to 1.4 (which I've used before).

I spent a lot of time trying to get Twine 2.0 syntax to work with the SugarCube story format, only to find by experimentation that SugarCube only uses Twine1 syntax. This REALLY needs to be made clear! At the moment it's not!

Anyway, I liked the way that Twine looked with 1.4 releases using the default white/blue on black text etc. I'm not so keen on the Harlowe look.

Is there anyway that I can use SugarCube (retaining Twine1 look) with Twine 2.0 syntax? Any way around this?

Also, can we use custom javascript snippets that work in 1.4 in 2.0? There are some nice visual effects JS that used in 1.4 game that I'd like to reuse.

Comments

  • Short answer: no.

    Harlowe does some weird things executing its script - the massive advantage of which is having very detailed control over the text in your project. You get hooks executing sequentially in mid-sentence, without messing up your formatting. Hence I imagine it strips out any Javascript you put in - the better to stop you from interfering with the magic. (You can interfere with a hack but it's not very reliable and sometimes executes out of turn depending on where you place the code.)

    Unfortunately - Harlowe isn't customisable as yet and I've already asked (handy search box there at the top of your page, wink, wink) about this and had no answer.

    My guess is that Harlowe's inventor either didn't think this would be a serious issue, or has it planned for later, or is having a bit of a think about how the hell to allow customisation into Harlowe's framework.

    -

    That said - you can use CSS to customise Harlowe to a degree. If you ask a specific question on how to get a certain look then people can chip in. There's already some threads that cover changing the background and font.
  • "Twine" has always consisted of two parts. (both 1.x & 2.x)

    1. The Twine application, which is used to edit the passages, CSS , and Javascript contained within your story. It is also used to generate/build your HTML file.

    2. The Story Formats: Each one defines the basic visual look of your story, the macros syntax used, what base macros/features are available to you, and the basic structure of the HTML file. They are also responsible for supplying the built-in Javascript engine that makes your story work.

    This is why you cant use the Harlowe story format's macro syntax if you choose SugarCube to build your story.

    In Twine 2 the Creator of each of the story formats are also responsible for defining and implementing what debugging features are available to the story Author when using the Twine application's Test option, which is why only Harlowe has the Debug View feature.
  • Thanks for the replies people.

    It's a shame, but it looks like maybe I need to stick to using Twine 1.4 for now. The Harlowe logic is great and clearer, but the visual output is so boring.

    It's not just the colours - it's the transitions. I think the way the text subtly fades in and out when you click/replace words or move to the next passage in Twine 1.4 default really enhances the reading/playing experience. I also like the title and author displayed in the sidebar. Don't really need the rewind or bookmarking facility.

    So, being specific (and I've used the search facility before...!), how would I get sugarcane transitions, colours and the sidebar to work in Harlowe?

  • I am really confused.  I've been using Harlowe with 2.0. 

    I just read this and decided to switch my game to Sugarcube to see how it would look.  It told me that the macros were wrong.  So I rewrote everything using the old syntax <<set $net = 1>> or <<if $net is 1>> and it still gave me a message: "Twine 2 macros use a different syntax to Twine 1 macros."  So can SugarCube in 2.0 be written the same way as Twine 1?
  • cressidahubris wrote:

    So can SugarCube in 2.0 be written the same way as Twine 1?

    Yes, it can.

    The "Twine 2 macros use a different syntax to Twine 1 macros." is a Harlowe error message, check that your Twine 2 story is actually using the SugarCube story format.

    To do this open your story project and select the Change Story Format option from the menu opened using the up arrow symbol found in the lower left corner next to your story name. On the Story Format screen check that the box to the left of  SugarCube is checked and if it is not then make it so.

    Once this is done then using any of the following three options (Test, Play, or Publish to File) should recreate your story HTML using the SugarCube story format.

    You can tell a SugarCube story by looking for the word SugarCube in the story's left sidebar, unless you have hidded / modified the side-bar.
  • Ha, okay, I feel like an idiot.  I checked the box when I started the story, but I must have unchecked it and gone back to Harlowe at some point because that was checked.  Now I realize that the story at one point was on a black background and then was on a white one.  And now, back to the black SugarCube background.  Sorry about that!
Sign In or Register to comment.