Monogatari was rewritten for v2, but the script stayed close to v1: labels are still lists of statements, dialog lines are still 'y Hello', and choices and inputs are written the same way. Moving a game is mostly a matter of moving files, rewriting the declarations around the script, and changing a few statements.

Everything on this page was checked against Monogatari 2.8.1 and the v1.4.1 release, with a v1.4.1 game and its saves moved to 2.8.1. 2.9.0 changed none of the steps, and a v1.4.1 save was loaded again in 2.9.0.

Before you start

Start from a fresh copy of the 2.9.0 starter game, and bring your game into it step by step, instead of updating your old folder in place. Keep the old folder as it is: you’ll copy from it, and you can compare the two.

From your v1 game you’ll take your assets, js/script.js, js/storage.js, the values in js/options.js, your translations in js/strings.js, and any code or styles of your own. Don’t copy index.html, js/monogatari.js or the libraries in js/: 2.9.0 has its own index.html, and its engine is in engine/.

1. Move your files

Assets

Assets now live in one folder, assets/, with a folder for each kind:

Asset v1.4.1 folder 2.9.0 folder
Music audio/music/ assets/music/
Voices audio/voice/ assets/voices/
Sounds audio/sound/ assets/sounds/
Character sprites img/characters/ assets/characters/
Scenes (backgrounds) img/scenes/ assets/scenes/
Images (images in the script) img/ assets/images/
Interface images img/ui/ assets/ui/
Icons img/icons/ assets/icons/
Videos video/ assets/videos/

Keep the folders inside them: a character with "Directory": "hikaru" still finds its sprites in assets/characters/hikaru/.

The AssetsPath setting in js/options.js names these folders. Leave it as the starter game has it.

2. Storage

v2 saves games in another way than v1.4.1, so your players’ saves wouldn’t show up. The 2.9.0 starter game saves with the browser’s IndexedDB, while v1.4.1 kept everything in the browser’s local storage under plain names (Save_1, AutoSave_1, Settings). To find those saves, change the Storage setting near the end of js/options.js:

'Storage': {
  'Adapter': '',
  'Store': '',
  'Endpoint': ''
},

With an empty Adapter, 2.9.0 reads and writes the local storage the way v1.4.1 did, so its load screen lists your players’ v1 saves, and new saves go to the same place.

WARNING

Keep the starter game's 'SaveLabel': 'Save' and 'AutoSaveLabel': 'AutoSave'. v1.4.1 wrote them as "Save_" and "AutoSave_", but 2.9.0 adds the _ itself: copying the v1 values hides every v1 save.

The game must also be at the same address as before: a browser keeps each site’s saves apart.

Loading a v1.4.1 save puts the game back at the label and statement it was saved at, with its scene, its characters and its storage, and the game goes on from there. The slot shows the save’s name, the scene, and the date as v1.4.1 wrote it, in the format the player’s browser used at the time (before 2.9.0, it showed Invalid DateTime instead):

The load screen with one saved game called "By the palace", showing the Palacio de Bellas Artes in the afternoon and the date 11/28/2026, 1:09:17 PM
A save made with v1.4.1, on the load screen

Test it before you release: save in your v1 game, then open the 2.9.0 version at the same address, load that save and play on.

Copy your storage object

js/storage.js is still where you declare the variables your game keeps, with a slightly different syntax.

v1.4.1, js/storage.js:

let storage = {
  player: {
    name: '',
  },
};

2.9.0, js/storage.js:

monogatari.storage({
  player: {
    name: '',
  },
});

The object inside is the same: copy yours as it is.

Change the storage from your code

In v1.4.1 you changed a variable by assigning it: storage.player.name = "Yui";. There is no storage variable in 2.9.0. Pass the change to monogatari.storage() instead:

monogatari.storage({
  player: {
    name: 'Yui',
  },
});

It merges the change into what’s stored, so the other variables keep their values. Inside a function of your script, like an input’s Save, this is the engine: write this.storage ({ … }), as in step 6.

To read a variable, call monogatari.storage() and take it from the object it returns: monogatari.storage().player.name. In dialog, {{player.name}} works as in v1.4.1.

3. Settings

v1.4.1’s js/options.js held two objects: engine for the game’s settings and settings for the player’s preferences. In 2.9.0 they’re monogatari.settings({ … }) and monogatari.preferences({ … }), already in the starter game’s js/options.js. Keep that file, and copy your values into it one by one.

Most settings kept their names. These changed:

v1.4.1 2.9.0
"MenuMusic" 'MainScreenMusic'
"ShowMenu" 'ShowMainScreen'
"SaveLabel": "Save_" 'SaveLabel': 'Save': keep the starter game’s value.
"AutoSaveLabel": "AutoSave_" 'AutoSaveLabel': 'AutoSave': keep the starter game’s value.

2.9.0 ignores MenuMusic and ShowMenu, so a copied v1 name does nothing. Leave out the entries v1.4.1 marked as the current state (Song, Sound, Scene, Particles, Step and the …History lists): 2.9.0 keeps that state itself.

The preferences (Language, Volume, Resolution, TextSpeed, AutoPlaySpeed) have the same names. 2.9.0 adds a Video volume.

See Configuration for every setting.

4. Declarations

The objects v1.4.1 declared at the top of js/script.js became calls to the engine. The 2.9.0 starter game’s js/script.js already has each of them, empty: copy what’s inside your v1 objects into them.

v1.4.1, js/script.js:

let particles = {};
const music = {};
const voice = {};
const sound = {};
const videos = {};
const images = {};
const scenes = {};

2.9.0, js/script.js:

monogatari.action('particles').particles({});
monogatari.assets('music', {});
monogatari.assets('voices', {});
monogatari.assets('sounds', {});
monogatari.assets('videos', {});
monogatari.assets('images', {});
monogatari.assets('scenes', {});

The kinds of assets are plural in 2.9.0: voice became voices, sound became sounds.

Characters

v1.4.1’s const characters = { … } became monogatari.characters({ … }), and the character’s properties are lowercase now:

v1.4.1 2.9.0
"Name" name
"Color" color
"Directory" directory
"Images" sprites
"Side" expressions
monogatari.characters({
  'h': {
    name: 'Hikaru',
    color: '#5bcaff',
    directory: 'hikaru',
    sprites: {
      normal: 'normal.png',
    },
  },
});

2.9.0 still reads the v1 names and translates them when it first uses the character, so a character copied as it is works. Use the new names in anything new. See Characters.

Messages and notifications

let messages = { … } became monogatari.action('message').messages({ … }), and let notifications = { … } became monogatari.action('notification').notifications({ … }).

A v1.4.1 message used "Title", "Subtitle" and "Message". In 2.9.0 they’re title, subtitle and body:

monogatari.action('message').messages({
  'Help': {
    title: 'Help',
    subtitle: 'Some useful Links',
    body: '<p>Everything you need to know.</p>',
  },
});

2.9.0 still reads the v1 keys, but only when a message has all three of them. Notifications kept their keys (title, body, icon).

Particles

2.9.0 draws particles with a different library than v1.4.1 (tsParticles instead of particles.js). A v1 configuration still shows its particles, but options the new library renamed are ignored under their old names: line_linked draws nothing, and the same option as links draws the lines again. Check each option of your configurations against Particles.

5. Statements

Some statements changed. 2.9.0 doesn’t understand the v1.4.1 forms: most of them show up as a line of narration with the statement’s words, and stop particles stops the game.

What it does v1.4.1 2.9.0
Show a character show <character_id> <sprite_id> show character <character_id> <sprite_id>
Hide a character hide <character_id> hide character <character_id>
Show an image show <image_id> show image <image_id>
Hide an image hide <image_id> hide image <image_id>
Show a message display message <message_id> show message <message_id>
Show a scene scene <scene_id> show scene <scene_id>
Show a notification notify <notification_id> show notification <notification_id>
Show particles particles <particles_id> show particles <particles_id>
Hide particles stop particles hide particles

The words after the name, like at left with fadeIn, are written the same way. play, stop and pause for music and sounds, jump, wait, end, vibrate and centered lines didn’t change. Look through your script for each v1 form: your editor’s search finds them, like "scene or "notify .

6. The script and its labels

let script = { … } became monogatari.script({ … }). The labels inside it don’t change, apart from the statements in step 5 and the code that changes the storage (step 2).

v1.4.1, js/script.js:

let script = {
  'Start': [
    'notify Welcome',
    {
      'Input': {
        'Text': 'What is your name?',
        'Validation': (input) => {
          return input.trim().length > 0;
        },
        'Save': (input) => {
          storage.player.name = input;
          return true;
        },
        'Warning': 'You must enter a name!',
      },
    },
    'h Hi {{player.name}} Welcome to Monogatari!',
    'end',
  ],
};

2.9.0, js/script.js:

monogatari.script({
  'Start': [
    'show notification Welcome',
    {
      'Input': {
        'Text': 'What is your name?',
        'Validation': (input) => {
          return input.trim().length > 0;
        },
        'Save': function(input) {
          this.storage({
            player: {
              name: input,
            },
          });
          return true;
        },
        'Revert': function() {
          this.storage({
            player: {
              name: '',
            },
          });
        },
        'Warning': 'You must enter a name!',
      },
    },
    'h Hi {{player.name}} Welcome to Monogatari!',
    'end',
  ],
});

The Revert function is new: it undoes what Save did when the player goes back past the input. See Input.

A game with several languages ('MultiLanguage': true) groups its labels under each language’s name, as in v1.4.1.

Labels in other files

To declare a label on its own, for example in a file of its own, v1.4.1 added it to the script object. 2.9.0 has monogatari.label().

v1.4.1 2.9.0
One language script["myLabel"] = [ … ]; monogatari.label('myLabel', [ … ]);
Several languages script["English"]["myLabel"] = [ … ]; monogatari.label('myLabel', 'English', [ … ]);
monogatari.label('myLabel', [
  'h Here we are.',
  'end',
]);

A file like that needs its own <script> line in index.html, after the engine’s, next to the lines for the other files in js/. See Script and labels.

7. Interface texts

v1.4.1 kept the texts of the interface, in every language, in js/strings.js. 2.9.0 has them inside the engine, with more languages. To change a text or add your own, call monogatari.translation() with the language’s name, in js/script.js or js/main.js.

v1.4.1, js/strings.js:

const strings = {
  "Español": {
    "AdvanceHelp": "Para avanzar en el juego, presiona espacio o haz click.",
    "Audio": "Audio"
  }
};

strings["Español"]["Audio"] = "Sonido";

2.9.0:

monogatari.translation('Español', {
  'AdvanceHelp': 'Para avanzar en el juego, presiona espacio o haz click.',
  'Audio': 'Sonido',
});

monogatari.translation() merges your texts into the ones the engine has for that language, so you only list what you change. See Translating your game.

8. Your own code and styles

  • Code in js/main.js. 2.9.0’s js/main.js starts the game. Keep it, and move your code into it: comments in the file say where code goes before and after the page and the game are ready. 2.9.0 doesn’t include jQuery. Code that uses $(…) needs a copy of jQuery in your game’s folder and a <script> line for it in index.html (the page only loads scripts from the game’s own folder), or a rewrite with the $_ helper that js/main.js already takes from Monogatari.
  • Styles in style/main.css. The interface was rebuilt for v2, so v1 selectors like #game or [data-menu="main"] don’t match anything. Start from the 2.9.0 style/main.css and redo your changes; see Style and Design.

Once everything is moved, play the game from the start to its endings, and load a save from your v1 game. When something goes wrong, Diagnosing Errors explains each error dialog.