Twine Sugarcube question from newbie

Adrian24

Member
May 25, 2017
290
152
Hi!
I'm, currently beginning to dabble in Twine.
Anyway, I have some theoretical questions:
1. Can you connect the buttons you create in Twine (for clicking on screen) with keyboard? For example I have 3 buttons on screen: A, B,C. Is is possible to connect them to numbers on keyboard (1,2,3), so that I can use keyboard instead of mouse?
2. The way I see basic use of Twine, you move from one story square to another (like rooms with different options) once you click appropriate link presented. Is it possible to create enemy NPC (turn-based combat) that would move you instead once he played his turn? For example enemy casts "Teleportation" on you and you end up in a completely different room on the map (different story square)?
3. Can you program an onscreen button so that, once pressed it opens sub-menu to choose from, in the same screen?
 

guest1492

Member
Apr 28, 2018
350
290
I'm on my phone right now so I can't really give examples, but yes to all of them.

You probably don't know JS, but that's basically binding a function to the keyup event. There are 3rd party SugarCube macros that will do it for you.

You're basically asking if there's a way to force a passage navigation without user input. Well, it's unlikely there's actually no user input because you will likely have a turn based combat system so it's more like under certain conditions you will be sent to a different passage than usual after your combat turn. In any case, you can use the goto macro inside an if macro inside either a link or timed macro.

Look into using SugarCube's Dialog API. If that doesn't work for you, you'll need to create something custom.
 
  • Like
Reactions: Adrian24