Howdy, Stranger!

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

Setting text style after certain amount of time

Hello! I'm trying to apply a text style to a passage after the player has been in the passage for a few seconds.
Here's what I have so far:
(live: 100ms)[(set: $up to (text-style:"shudder"))]
$up[cats]
when I test this, the passage appears as "0cats" and the text style remains the same. Anyone know what I'm doing wrong? 
Oh, and I'm working in Harlowe.

Thanks in advance!

Comments

  • You can't retroactively apply variables. That is - $up hasn't been set by the time you print out "cats". So you end up printing out a a blank variable next to "cats" rendering 0cats. By the time you set the shudder, it's too late.

    What you are actually trying to do is replace text with newer (shakier) text. But the replace macro seems to want you to write out cats all over again in order to swap it.

    So I thought - this would be a lot easier if I could just assign a variable with the contents of a hook. And it turns out you can:
    [cats]<h|

    (set: $v to ?h)(set: $up to (text-style:"shudder"))
    (live: 1000ms)[(replace: ?h)[$up[$v]]]
    I've set up a hook "h" and then fed that into a variable called $v. Then after a second I replace the hook with my variable and wrap it in the shudder modifier.

    I tried $up?h and $up$v but those didn't work. $v isn't a hook, it's just the contents. But you can save yourself from rewriting a hook's contents by dumping it into a variable. And if you stick that inside a freshly made hook, you can add modifications.
  • That makes sense. Thank you so much!
Sign In or Register to comment.