68 lines
2.3 KiB
Text
68 lines
2.3 KiB
Text
// This new syntax should be easier to parse although parsing wasn't really the issue with the last syntax
|
||
// I really want the syntax to feel a lot more like the actual script for a play or something of the sort
|
||
|
||
// THINK ABOUT THIS Newlines are the end of a statement in this syntax, I think this mirrors text formatting pretty well
|
||
|
||
// I find that the "BEGIN" things in some older languages are actually quite fitting
|
||
BEGIN Scene1
|
||
|
||
Command "test"
|
||
Do 5 [2, 3, 6]
|
||
|
||
Set var 2
|
||
|
||
// Make the actual commands like Lisp, not the entire language
|
||
// strip the outermost brackets since this syntax will be parsed line by line
|
||
Set var2 (=? var 1)
|
||
Set var3 (+ var var2)
|
||
|
||
// Enter and exit dialogue mode with <<- and ->>
|
||
<<-
|
||
// Comments are only legal at the beginning like this in Dialogue mode
|
||
// IDEA: once NVL is parsed, set up indices for each line
|
||
// Make another program to match audio
|
||
[Alex]
|
||
Hello. Welcome to dialogue mode.
|
||
Every new line is a new "click". I discarded the "pause" idea.
|
||
|
||
[Bailey]
|
||
Je ne suis plus Alex.
|
||
Ça ne m'arrête pas de vous démontrer notre support multilingue noblement distingué.
|
||
|
||
[Catherine]
|
||
CJKテスト!
|
||
夏はマシンガン。
|
||
|
||
[Dick]
|
||
I present my idea for markup syntax here.
|
||
It is something like [b,i]{this}.
|
||
It's kind of like KP's TyperTags, only that you can specify more than one effect in the square brackets in front.
|
||
If the effect is parametrized in some way invoke it like [wiggle_y(5)]{this}.
|
||
Then naturally we would have ruby like [rb("that")]{this} (important feature, trust me).
|
||
|
||
[Elliot]
|
||
To grab a value from the environment, do it like this: ${var}.
|
||
This is also the syntax to evaluate a command from dialogue mode.
|
||
If the return is void it will say "undefined" or something like that.
|
||
|
||
// Dialogue mode commands have to be one liners an cannot have trailing comments (arbitrary)
|
||
*! This "is a command in dialogue mode."
|
||
*! Set var (+ var 1)
|
||
|
||
[NARRATION]
|
||
Thanks!
|
||
|
||
*! ClearDialog
|
||
|
||
->>
|
||
|
||
// something like Choice can load the index of the choice the user selects into a variable
|
||
Choice var4 ["Apple", "Orange"]
|
||
|
||
// After thinking about this for a while I think it would be a good idea
|
||
// to have ways to terminate a scene other than END, for instance JUMP can be an alternative like this:
|
||
// JUMP Scene2
|
||
// we can equally do something like this
|
||
// JUMP (switch var4 [[0, RouteA], [1, RouteB], [default, RouteC]])
|
||
|
||
END
|