Upgrading from v1.4.1
Learn all you need to know about upgrading your game!
Monogatari has been completely rewritten and many things have changed, however, the script syntax and overall functionality has stayed almost the same so porting your game from v1.4.1 to the newest version is not that complicated!
1. Moving your files
Lets start with the easiest task, the best way to port your game is starting fresh and that means downloading the newest version available and move your files there, step by step instead of trying to update your old project.
Assets
Lets start with the assets, they are now saved on a directory called assets. Here is an equivalence of where you used to store your assets before and where you should store them now:
Why did this changed you may ask. Well, by creating an universal assets directory, it is easier to both keep your assets out of version control systems (git and others) and also, it allows you to host your assets remotely in an easier way. More info on this will be made available later on.
2. Storage
Your players most likely have lots of save files and we want them to keep them even though we're updating the engine. By default, the new version handles storage in a different way which will result on the save files not showing up. To allow your players to keep their save files, we need to change this.
Go over to the
options.js
fileFind the
Storage
configuration almost at the bottom of the fileEdit the
Adapter
property and set it to an empty string (''
)Edit the
Store
property and set it to an empty string (''
)
Copy your storage object
Now its time to copy your storage object. The js/storage.js
file is still the place where you'll put all the items you want to save on your game, the syntax has changed just a bit.
Storage on v1.4.1
Storage on v2.0.0
As you can see, it really is just a matter of changing the let storage = { ...storage };
format to the new monogatari.storage ({ ...storage });
format, you can copy your storage object exactly as it is!
Update the syntax to set / get values from the storage
Previously, when you wanted to modify the storage, you would modify the variable directly like this:
Modifying the storage like that is no longer possible since it has been moved to a function. While you can look at all the new syntax on the storage documentation, the easiest way to update the syntax is by replacing all occurrences of it you have on your script for something like this:
3. Assets Declarations
Just like with the storage, assets declaration syntax has changed just a bit, here's a small comparative on how the assets declaration looks like on your script.js
file on both the old and the new version.
Assets declaration on v1.4.1
Assets declaration on v2.0.0
4. Script and Labels Declarations
Just as with the storage and assets, the way to declare the script for your game has changed its syntax, here's a comparison on the old and new way:
Script declaration on v1.4.1
Script declaration on v2.0.0
Independent Labels
Declaring independent labels for your script is possible as always, and really useful to split your game into multiple files, here's a comparison on how this was achieved on the past and how it's done now.
Individual Labels on v1.4.1
Individual Labels on v2.0.0
5. Script Actions / Statements
The syntax for some of the actions you can perform on your script has been changed. Here's a small list of the ones that changed, however, it is best if you check their individual page to see all the new features!
6. String Translations
Previously, a file called strings.js was distributed with Monogatari where you would put all your string translations, mainly used for the UI. Now, those translations are handled internally but you can still add strings to them or modify them. Here's some comparison on how it worked before and how it works now.
Strings declaration on v1.4.1
Strings addition on v1.4.1
Strings declaration and addition on v2.0.0
Last updated