0 votes
by (2k points)
If so, do you mind sharing or selling? I'm really really new to this, but I also really want to learn and I've been trying all night.

1 Answer

0 votes
by (154k points)

The offical Twine Cookbook includes a (Harlowe) Typewriter Effect recipe that shows one way to implement such an effect.

by (2k points)
Thanks, I saw it but it's too complicated for me atm, so I was wondering if anybody would take some of their time to explain me. I would pay this person for their service if needed since I understand that time is a valuable thing.
by (154k points)

The recipe is written in Twee Notation and is basically stating:

1. Add a new Passage to your project, name it Typewriter and place the following code within this passage.

    <!-- Create a variable to track the position within the $typewriterText string -->
    (set: $typewriterPos to 1)

    <!-- Create a hook to hold the typed text -->

    <!-- Set a delay of 20ms seconds per loop -->
    (live: 20ms)[

        <!-- Add the next character to the hook -->
        (append: ?typewriterOutput)[(print: $typewriterText's $typewriterPos)]

        <!-- Update the position -->
        (set: $typewriterPos to it + 1)

        <!-- If it's gone past the end, stop -->
        (if: $typewriterPos is $typewriterText's length + 1)[

2. Within the Passage of your project that you want to see the typewritter effect in use the (set:) macro to create a $typewriterText story cariable, then assign this variable the Text you want to the typewritter effect to display. Once you have done that used the (display:) macro to execute the code contained within the passage created in point 1.

(set: $typewriterText to "Hello, world!")
(display: "Typewriter")

When you view this passage of your project using either the Test or Play option the text contained within the $typewriterText should appear using the typewritter effect.

Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.