Giter Club home page Giter Club logo

yarnspinner-console's Introduction

Yarn Spinner Console

ysc is the command-line tool for working with Yarn Spinner programs.

Installing ysc

You can install ysc by downloading the most recent release, or by building it locally.

Building it locally

  • Download and install the .NET SDK.

  • In your terminal, build and run the project with the following command:

    dotnet-run -- [your commands]

    For example, to compile a Yarn script, run the following command:

    dotnet-run -- compile path/to/MyScript.yarn

Compiling Scripts

$ ysc compile [--merge] [--output-directory <output>] <input1.yarn> <input2.yarn> ...

ysc will compile all of the .yarn files you provide, and generate two files for each: a .yarnc file containing the compiled file, and a .csv containing the extracted string table.

If you specify the --merge option, a single output.yarnc and output.csv file will be created.

Running Scripts

$ ysc run [--auto-advance] [--start-node <Start>] <input1.yarn> <input2.yarn> ...

ysc will compile all of the .yarn files provided and then begin running them from the Start node. By specifiying the --start-node option you can configure which node is used as the entry point for the story, defaulting to Start if not set.

If you specify the --auto-advance flag, the normal lines of dialogue will be presented automatically, only holding the program up when an option or shortcut is reached. This flag is not set by default meaning each line of dialogue will halt the story until manually advanced with the return/enter key.

NOTE: Custom functions are not supported and encountering one will cause the story to be aborted.

Upgrading Scripts

$ ysc upgrade [--upgrade-type <1>] <input1.yarn> <input2.yarn> ...

ysc will upgrade the yarn files from one version of Yarn to another. By specifying the --upgrade-type option you can configure from what version, to which version, of Yarn to convert. Defaults to 1, or upgrading a yarn v1 file to a yarn v2 file.

Printing the Syntax Tree

$ ysc print-tree [--output-directory <output>] [--json] <input1.yarn> <input2.yarn> ...

Prints a human readable form of the dialogue syntax tree of the input Yarn files. This is useful when debugging the language itself or for some more unusual shenanigans. Defaults to returning the syntax tree as a text file, by specifiying the --json flag will instead return them as a JSON file.

Printing the Parser Tokens

$ ysc print-tokens [--output-directory <output>] [--json] <input1.yarn> <input2.yarn> ...

Prints a list of all parser tokens from the included Yarn files. Tokens are shown with their line number and starting index. This is useful when debugging the language itself or for some more unusual shenanigans. Defaults to returning the syntax tree as a text file, by specifiying the --json flag will instead return them as a JSON file.

Tagging lines for localisation

$ ysc tag [--output-directory <output>] <input1.yarn> <input2.yarn> ...

Tags the input Yarn files with line ID hashtag for localisation. Uses the line tagging code from YarnSpinner core, this means by default lines will be tagged following the rules of tagging lines from the core. If --output-directory is not set will default to overriding the files in place.

License

ysc is available under the MIT License.

Contributing

See the Contributing guide for developer documentation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.