Open dcsan opened 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
JS port of runtime https://github.com/y-lohse/inkjs
I like their syntax! The features you quoted would be good for RiveScript too and not too difficult to implement...
&&
and ||
support for *Condition
would be very beneficial for RiveScript, even with the ugly ^Continue
command to make it ""readable""
conditions = left_side.split(/(&&|\|\|)/)
conditions = [ "<input1> != undefined", "&&", "<input1> == <input2>" ]
&&
(if true) or ||
(if false).{topic=}
and then <@>
redirect to somewhere, and maybe from there set the {topic=random}
back where you came from. But I think I ran into issues doing weird stuff like this in the past)
@Redirect
it essentially re-starts the reply() process while keeping exactly the same initial conditions of the reply: your input history and such are exactly the same during a redirect for example, so some uses of %Previous
can get you into infinite loops currently (not too common in practice tho)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. :)
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.)
inline conditionals
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.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