inkle / ink

inkle's open source scripting language for writing interactive narrative.
http://www.inklestudios.com/ink
MIT License
4.14k stars 492 forks source link

Cheat sheet ? #489

Open Zakwil opened 6 years ago

Zakwil commented 6 years ago

Hi, Its more like an enhancement but, is it possible to have a cheat sheet?

tentoumushi-dev commented 5 years ago

Well let me start with the basic stuff. (I will enhance this eventually (hopefully) to the extend that the full guide should be covered, but I think this example covers enough to write a working story, without actually knowing anything about ink or coding in general)

// this is a comment
/* this is also a comment */

VAR my_variable = 1

===i_am_a_knot===
~ my_variable = 2 //this is how you 

this is story text #this is a tag #you can have multiple ones

* this is the choice #my tag will only be read after the choice is taken
    -> the_other_knot // divert only on this choice

+ this is a sticky choice. You can take this path multiple times.

* {my_variable == 1} this is another choice // it is only displayed if the expression is true
- -> the_common_knot // both choices above are put together to this divert

=the_common_knot
story ends here
-> END

===the_other_knot===
story continues here
-> i_am_a_knot.the_common_knot // this accesses a subknot / stitch
Selsynn commented 5 years ago

I would add the modifying of a variable ~ my_variable = 5 and some new line to make it clearer.

Else it is great for a first one.

Note to self: create one for programmer that begins on Ink

frankbraker commented 4 years ago

add the continuation operator:

<>

which suppresses the line terminator that would normally appear for that line.

sawradip commented 1 year ago

I have created one. Mainly to look for a specific symbol, so that we can scroll quickly. You can give suggestion to improve more.

https://github.com/sawradip/ink-cheat-sheet/blob/main/README.md