Howdy, Stranger!

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

[Harlowe] Adding text using changer macros?

This probably isn't a feature available in Harlowe right now, but I figure I may as well ask to be sure.

Right now, the story I'm working on displays dialogue in a script style format, like this:


With the corresponding Twine code being:


As you can see, I style the text using a variable in front of it. But in front of each line of dialogue, I have to write out the character's name in full, which gets to be pretty annoying after a while. Ideally, I could add their name in front of the line using the changer macros as well.

So, instead of writing
$KEEP[SHOPKEEP: Some text here.]
I could just write
$KEEP[Some text here.]
and the macro would add "SHOPKEEP: " in front of it at runtime.

As far as I can tell, there's no way to do this without figuring out how to make some kind of custom macro, which is beyond the scope of my ability. Does anyone have any advice, or will I just have to make do with writing out the name manually each time?


  • @.class;Text to display@@ markup based styling with (text-xxxx:) macro based styling, or your passage text could of looked something like the following:;some piece of dialog@@.rf;a reply of;more dialog@@
    ... which you could of styled using CSS like the following:
    .dialog {font-family: "Blogger Sans";}
    .rf {color: red;}
    .rf:before {
    	content: 'RIFLE: ';
    .sk {color: tan;}
    .sk:before {
    	content: 'SHOPKEEPER: ';
    .keep .sk {color: #d2bc79;}
    a. I added the .keep class to the .dialog div element to distinguish it from dialog at other locations.
    b. I assumed that shopkeeper was a generic class of npc, the one in the keep just being one of many in the story.
  • What I'd ideally like to do here is introduce a new macro specifically for creating a custom changer, using the "lambda" syntax I spitballed in here.
    (set: $keep to (hook-change: _hook to _hook + (datamap:"source", "SHOPKEEP: " + _hook's source))
    $keep[Text here.]
    The idea here is that _hook would be a datamap describing the attached hook, with "source" and possibly "style" datanames.

    The datamap updating syntax seems more than a little clunky, so I think I'd have to implement the following variant:
    (set: $keep to (hook-changer: _hook's source to "SHOPKEEP: " + _hook's source))

    Of course, these are just rough ideas.
Sign In or Register to comment.