Howdy, Stranger!

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

JS Typewriter-Effect Speed Control via Player Input

I've got a question on implementing 'speed control' onto a JavaScript-based Typewriter effect.

The effect is L's Typewriter Transition from Glorious Trainwrecks:

The effect creates a typewriter transition within the body of the passage via a tag on the passage with this format: "t8n-typewriter-n', where 'n' is a number that represents the speed at which the typewriter transition operates (lower numbers are faster)

What I'd like to do is create a standard transition speed (t8n-typewriter-5), that can be changed within the passage itself as a form of 'fast-forward' or 'skip' of the typewriter effect (t8n-typewriter-1). (Just in case the player gets tired of a slow typewriter effect)


My method in approaching the problem:

Firstly, I tried adding macros that modified that tag of a passage, in an attempt to leave the original typewriter JavaScript untouched: No success.

Second, I tried to modify the JavaScript in an attempt to replace the 'speed of effect based on tag' system with a 'speed of effect based on an interior Twine $variable' which could be controlled via a <<click>> macro: Still, No Success

My final attempt is changing the JavaScript entirely.
Though I have no idea how to approach this, any suggestions?


Note: JavaScript Programming Skill Level: Novice
Operating on: Twine 1.4 Sugarcube.
Twine Skill Level: Reasonable. (Kinda Poo.)


tl;dr: I want to add a typewriter text effect that can be 'skipped' or 'fast-forwarded' within the passage itself via a button or clickable item. Not sure if possible, if so, how do I do it?
Sign In or Register to comment.