Coder Social home page Coder Social logo

twine-monogatari's Introduction

Welcome to twine-monogatari ๐Ÿ‘‹

Documentation Maintenance License: MIT Twitter: Haroldo0k

This Twine 2 story format allows one to use Twine to create Visual Novels for the Monogatari engine.

Based on Twison.

Demo

There's a demo available at: https://haroldo-ok-2.github.io/twine-monogatari/v0.2.0/demo.html

Youtube video for version 0.1.0: https://www.youtube.com/watch?v=cNW5hKvAsTo

Install

  1. Open the Twine 2 online editor: http://twinery.org/2/;
  2. On the left hand side, click on "Formats";
  3. Click on "Add new format";
  4. Inform the URL: https://haroldo-ok-2.github.io/twine-monogatari/v0.2.0/format.js
  5. Click on "Add";
  6. Select "twine-monogatari 0.2.0".

Alternately, you could import the demo (https://haroldo-ok-2.github.io/twine-monogatari/v0.2.0/demo.html) on the editor.

Basic usage

  • It is recommended to read the Monogatari documentation, specially the "Script" section, in order to have a better idea of the available commands;
  • The initial passage must be called Start;
  • Passage names must contain no spaces;
  • In order to define various Monogatari declarations, you can use special passages like [Scenes], [Characters], [Images], [Sound], [Music], and so on; those declarations can be made in either JSON or YAML formats; example:
e:
  Name: "{{evelyn_name}}"
  Color: "#00bfff"
  Directory: Evelyn
  Images:
    Normal: normal.png
    Mad: hmph!.png
    Doubt: uhh.png
    Disapointed: ngggg....png
    Happy: hehehehe.png
  • Also, in order to set various Monogatari settings, you can use a special passage named [Settings], also in either JSON or YAML formats;
    • The most important setting you must define is AssetsPath.root, that points to the base URL from the site the assets will be pulled from, like for example:
AssetsPath:
  root: http://www.haroldo-ok.com/twine-monogatari/v0.1.0/Monogatari/assets
  • Twine links are turned into Monogatari choices, and can contain conditions:
[[One choice->SomeTarget]]
[[Another choice->AnotherTarget]]
[[Optional choice |? storage.testCount > 2 ->SomewhereElse]]
  • Arbitrary JavaScript code can be included as Markdown code blocks, like so:
	```js

	storage.player.name = 'Bob';
	storage.testCount++;

	```

	Hello, again, {{player.name}}.

	You've come here {{testCount}} times.

	jump SomewhereElse
  • Here's a more complete example:
	```js

		storage.player.name = 'Bob';
		storage.howManyTimes++;

	```
	
	You've been here {{howManyTimes}} times.

	play music Theme
	show scene Classroom fadeIn
	e Hello, {{player.name}}!

	```js

		storage.evelyn_name = 'Evelyn';

	```

	show character e Normal center fadeIn
	e I'm {{evelyn_name}}.

	[[Test menu ->TestMenu]]
	[[Continue ->Continue]]
	[[Secret |? storage.secretsFound > 4 ->Secret]]

Development

Installing

git submodule init
git submodule update
npm install

Running

node build.js

If you want to hack on this tool itself:

  1. Clone this repo and run npm install to install dependencies.
  2. Make your changes to the unminified code in the src folder
  3. Run node build.js to compile your source into a format.js file that Twine 2 can understand. Alternatively, you can run node watch.js to watch the src directory for changes and auto-recompile every time you save.

Run locally

Installing

git submodule init
git submodule update
npm install

Running

npm start

Running npm start will start the watch.js auto-compile behavior, and also start a local web server that serves the compiled format.js file. By default, this will be available at http://localhost:3000/format.js. Add that URL as a story format to your copy of Twine 2; every time you save a source file and then re-generate the "Play" view of your story in Twine, it should use the latest version of your code.

This is easier to do with the browser-based version of Twine 2 than with the downloadable copy, as you can just refresh your output page and it'll use the latest version of Twison.

Run tests

npm run test

Author

๐Ÿ‘ค Haroldo O. Pinheiro

๐Ÿค Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a โญ๏ธ if this project helped you!

๐Ÿ“ License

Copyright ยฉ 2019 Haroldo O. Pinheiro.
This project is MIT licensed.

twine-monogatari's People

Contributors

haroldo-ok avatar lazerwalker avatar pec017 avatar

Watchers

 avatar

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.