Hello!
I'm making a game (hopefully a full one) on Twine and started in Harlowe. However, as the game is getting longer and longer, I see Sugarcube may be better now, as I can change the CSS for each passage and have a save for my game. However, I'm lost with the differences between them, and I can't find help with these things anywhere. Hopefully someone can help me!
1 - Harlowe's set
In Harlowe I can make "(set: $sentme to (text-colour: "#138808") )" and then use the $sentme [] to make the text green. This is a huge help. Does sugarcube have something similar?
2 - Timing macro and hook
I use a combination of hook and timing macros to give conversations some dynamism in the game. I can't find anything similar to it in Sugarcube. Here's a full example of a whatsapp conversation, where a "carolin is typing..." take place before the actual answer and the "So you" is another passage:
|answers1>[[• "So you can't call me sleepyhead, can you?"]<answer1|
[• "Oh, alright then."]<answer2|
[• "Why were you so tired?"]<answer3|
[• "Did you dreamt about me?"]<answer4|
[• "Don't answer"]<answer5| ]
{
(click: ?answer1) [
(replace: ?answers1) [ $sentme ["So you can't call me sleepyhead, can you?"] ]
[$typingtext [Carolin is typing...] ]<ctm|
(live: 4000ms) [
(set: $elapsedtime to (round: time / 100) )
(set: $typingtime to $typingtime - $elapsedtime)
(if: $typingtime = 0) [
(replace: ?ctm)
[ (display: "So you") ]
(stop:)
] ] ]
}
3 - Installing macros
...really, I can't find a single tutorial about installing macros for sugarcube on twine 2. Please guys?
I REALLY hope I'm not being a burden, it's just a lot of things to wrap my head around in this change of formats. A giant thank you in advance!
Comments
If you really didn't want to write out that <span>, you can also put it in the widget passage as something like:
<<widget "greentext">><span class="greenish"><</widget>>
Then you'd write in game <<greentext>>This text is green.</span>
You should be able to do the second using the <<timedcontinue>> macro as part of the replace macro set available on the SugarCube website.
To insall macros you just paste them into the story javascript area.
Also, to be fair, I should point out that a save mechanism has come/is coming to Harlowe.
SugarCube uses standard CSS. So you'd define something like the following in your Story Stylesheet: Usage (custom styles markup and HTML markup):
The following SugarCube 2 example should be roughly similar to what you were doing in Harlowe (see the footnotes for additional details).
Macros go in your Story JavaScript. That said, what macros are you trying to install and where did you get them?
You cannot, actually. The raw HTML formatter does not allow invalid markup, which is what you've created by splitting the opening and closing tags of the <span> between constructs like you have.
The best thing to do here would be to use the custom styles markup as in my example above.
I'm trying to make the second part happen but I can't seem to make any macro combinations. Currently, to simply substitute 4 alternatives to a print of the next passage, I'm trying this:
• <<choice "Good morning to you, too.">>
• <<choice "(Say nothing)">>
• <<choice "Of course, babe.">>
• ( <<click "Yes, I will">> <<print formal answer 1<<choice "Yes, I will.">> <<endclick>> )
... where "formal answer 1" is the next passage and "Yes, I will" is the frase on the click button. What am I doing wrong here?
The custom styles markup is really useful, I think it's better than Harlowe's set, as I can use the same style for the whole game. I'm going to try you solution for the timed replace now! And I'm trying to install the Combined Replace Macro Set. I copied it into the project's script but isn't working (even Leon's standard example, with the house, is not working on my Twine, even with the imported HMTL.
I'm using the 2.0! I didn't thought it would be a problem.
And I just saw the thread about the save game on Harlowe. That's amazing news, really. (especially for those with long games)
If not, then you can find it on SugarCube 2's website (under Downloads > Add-ons > <<replacelink>> macro set).