Page 1 of 1

[PROTOCOL #081] - experimental tool for interactive storytelling

Posted: Sun Oct 22, 2017 8:20 am
by 0x25a0
[PROTOCOL #081] is an arguably odd tool to tell an interactive story through a Matrix Green Rain terminal.

Image

Telling a story through [PROTOCOL #081] is as simple as writing an imperative function:

Code: Select all

return function()
  set_cursor(2, 2)
  add_text("ONE (1) NEW FILE ADDED BY [USER #341A9E | STALENHAG, SIMON]\n")
  add_text("WOULD YOU LIKE TO OPEN IT? (Y/N)")

  local key = wait_for_key({"y", "n"})
  if key == "y" then
    config.background_color = {14, 7, 8}
    config.font_color = {254, 77, 79}
    config.font_color_highlight = {252, 171, 171}
    config.speed = 16

    clear_text()
    wait(3)
    set_text("INFECTION DETECTED", 2, 2)
    new_line()
    add_text("SYSTEM LOCK-DOWN INITIALIZED")
  end
  wait(15)
  quit()
end
You can print text, wait for key presses, wait a fixed amount of time, and change things like the color scheme and the speed of the code trails on the fly. Check out the documentation in story.lua for a full overview over the available functions and variables.

The concept has some flaws, but I thought I'd to share it anyway. Maybe it's suitable for some dystopian cyberpunk choose-your-own-adventure kind of game :)

*Edit: Fixed a bug where love.resize was not called on start-up, causing a black screen. Thanks @bartbes for reporting!

Re: [PROTOCOL #081] - experimental tool for interactive storytelling

Posted: Sun Oct 22, 2017 11:57 am
by Bunnybacon
That was great! well done!

Re: [PROTOCOL #081] - experimental tool for interactive storytelling

Posted: Sun Oct 22, 2017 3:29 pm
by bartbes
I should probably note that the resize event wasn't triggered on startup for me, so I got a 0x0 display. A black screen, in other words. Manually calling love.resize in love.load fixed it for me.

Re: [PROTOCOL #081] - experimental tool for interactive storytelling

Posted: Sun Oct 22, 2017 3:55 pm
by 0x25a0
@Bunnybacon Thanks! I'm glad you like it :)

@bartbes Oh dear! Thanks for reporting, that should hopefully be fixed now :)