twine-monogatari

WebJar for twine-monogatari

License

License

MIT
Categories

Categories

Github Development Tools Version Controls
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

github-com-haroldo-ok-twine-monogatari
Last Version

Last Version

0.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

twine-monogatari
WebJar for twine-monogatari
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/haroldo-ok/twine-monogatari

Download github-com-haroldo-ok-twine-monogatari

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/github-com-haroldo-ok-twine-monogatari/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>github-com-haroldo-ok-twine-monogatari</artifactId>
    <version>0.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-haroldo-ok-twine-monogatari/
implementation 'org.webjars.npm:github-com-haroldo-ok-twine-monogatari:0.2.0'
// https://jarcasting.com/artifacts/org.webjars.npm/github-com-haroldo-ok-twine-monogatari/
implementation ("org.webjars.npm:github-com-haroldo-ok-twine-monogatari:0.2.0")
'org.webjars.npm:github-com-haroldo-ok-twine-monogatari:jar:0.2.0'
<dependency org="org.webjars.npm" name="github-com-haroldo-ok-twine-monogatari" rev="0.2.0">
  <artifact name="github-com-haroldo-ok-twine-monogatari" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='github-com-haroldo-ok-twine-monogatari', version='0.2.0')
)
libraryDependencies += "org.webjars.npm" % "github-com-haroldo-ok-twine-monogatari" % "0.2.0"
[org.webjars.npm/github-com-haroldo-ok-twine-monogatari "0.2.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.npm : browserify jar [16.3.0,17)
org.webjars.npm : js-yaml jar [3.13.1,4)

Project Modules

There are no modules declared in this project.

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.

Versions

Version
0.2.0