aichaos / rivescript-js

A RiveScript interpreter for JavaScript. RiveScript is a scripting language for chatterbots.
https://www.rivescript.com/
MIT License
377 stars 145 forks source link

[discussion] intfic language "ink" #298

Open dcsan opened 5 years ago

dcsan commented 5 years ago

came across this and thought it might be interesting to you, it has some nice ideas. more oriented toward point and click interactive fiction but has some nice flow-control ideas

http://docs.unfold.studio/user_guide/ink.html#part-one-the-basics

Once-only (marked with a !):

Once-only alternatives are like sequences, but when they run out of new content to display, they display nothing. (You can think of a once-only alternative as a sequence with a blank last entry.)

He told me a joke. {!I laughed politely.|I smiled.|I grimaced.|I promised myself to not react again.}

this is a big difference between rive and superscript, in that SS made an effort to track and not repeat replies to make conversations more natural.

inline conditionals

{ mood > 0:I was feeling positive enough | It was more than I could bear}.

conditionals

http://docs.unfold.studio/user_guide/ink.html#example-context-relevant-content

i much prefer this syntax to rive's stuff with * - which makes it really hard to test for multiple conditions.

=== dream ===
    {
        - visited_snakes && not dream_about_snakes:
            ~ fear++
            -> dream_about_snakes

        - visited_poland && not dream_about_polish_beer:
            ~ fear--
            -> dream_about_polish_beer

        - else:
            // breakfast-based dreams have no effect
            -> dream_about_marmalade
    }

tunnels

http://docs.unfold.studio/user_guide/ink.html#tunnels allow you to have a piece of content that is called and returned from. more powerful than just a topic change which is like a goto. SuperScript had something like that i think with no-stay topic type https://github.com/superscriptjs/superscript/wiki/Topics#topic-flags

dcsan commented 5 years ago

the runtime is in C#, i guess to make it easy to use with Unity

https://github.com/inkle/ink https://github.com/cproctor/unfold_studio

dcsan commented 5 years ago

JS port of runtime https://github.com/y-lohse/inkjs

kirsle commented 5 years ago

I like their syntax! The features you quoted would be good for RiveScript too and not too difficult to implement...

I think if I ever decide to overhaul RiveScript and add tons of new features (possibly new/changed syntax) I'll start to consolidate down to the Go version so I only have one codebase to maintain -- and Go can compile to JavaScript via GopherJS or to WebAssembly now, while also providing bindings to any other C-compatible language. Only "small features" for the 5 implementations of RiveScript for now. :)