===== Introduction ===== When modding OMORI, you'll encounter different file types. This page aims to explain the [[modding:Getting_Started#Decrypting_the_game|decrypted]] files, and the file types you can use to modify the game, which are not the same. ===== Common file types ===== These file types are commonly used by OMORI and you'll encounter these when [[modding:Getting_Started#Decrypting_the_game|decrypting]] the game. ==== .js - JavaScript ==== //Encrypted: yes, as .OMORI files//\\ //Patching: not directly (read on)//\\ OMORI uses [[https://developer.mozilla.org/en-US/docs/Learn/JavaScript/First_steps/What_is_JavaScript|JavaScript]] files for its game logic((The game runs in an environment that combines a conventional browser with a [[https://www.educative.io/blog/what-is-nodejs|Node.js]] instance. Because OMORI uses [[wp>RPG_Maker#RPG_Maker_MV|RPG Maker MV]], which in turn uses [[https://pixijs.com|PIXI.js]], you mostly don't need any HTML or CSS knowledge. We might go into the details of PIXI.js in relation OMORI in a different wiki entry.)).\\ These files can't be [[modding:patching|patched]], but the functions they define can usually be just overwritten. This means that in mods you can, for the most part, just create the same file structure the game has and modify functions as you need. Just remember that your code doesn't //replace// the original files, your function definitions will simply overwrite the previous ones, normally through object prototype manipulation, which is what the normal game files do as well:SomeObject.prototype.function = function() {...} To summarize, mods may look like they are patching JavaScript files, because for the most part, you can overwrite the functions as if the files where able to be patched, but it's an important difference to the other files, where the mod's file will be loaded //instead// of the normal game file((excluding delta files)) and not //in addition to//, as is with JS files. [[#JavaScript_Addendum|More Info on JS in OMORI]]. ==== .json - JavaScript Object Notation ==== //Encrypted: yes, as .KEL//\\ //Patching: normal patching, and can also be [[#.jsond_-_JSON_patch_files|delta-patched]]//\\ [[https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Objects/JSON|JSON]] files only hold data, no JavaScript logic. They are used by the game to store enemy descriptions, or events. They might contain data that gets interpreted by the game as if it was game logic. These files can be normally [[modding:patching|patched]], and [[delta-patching|delta-patched]]. JSON files are very easy to work with in JavaScript, because all data types supported by JSON can be mapped 1-to-1 into a JavaScript object or array. It's worth mentioning that JSON doesn't support all types that a JS object does, like functions. ==== .png - Transparent image files ==== //Encrypted: yes, as .rpgmvp//\\ //Patching: normal replacement or delta patching using [[modding:replacing_images#Image_deltas|image deltas]]//\\ PNG files are image files that support transparency. This is how the game stores all common images. ==== .yaml - YAML Ain't Markup Language ==== //Encrypted: yes, as .HERO//\\ //Patching: normal replacement or delta patching using [[#.yamld_-_YAML patch files|.yamld]]//\\ [[https://www.tutorialspoint.com/yaml/yaml_introduction.htm|YAML]] files are similar to //.json// files, in that they hold the same data types, like strings, numbers, objects etc. The two big differences regarding OMORI is that YAML files have a different, more human-friendly syntax, and they support comments, which JSON files don't. YAML files are primarily used for dialogue files found in //\/languages\///, and are therefore more comfortable to edit than JSON. === .yml - The legacy file extension === //.yml// is a [[https://yaml.org/faq.html|legacy file extension]], which means it used to be used for YAML files, but the official file extension today is //.yaml//. Most programs will still recognise //.yml// as a YAML file. **We recommend using only //.yaml// for constistency**. You'll encounter //.yml// with projects that used files decrypted using the [[https://github.com/toshirodesu/omori_decrypt|decryptor mod for Gomori]], which outputs files with the //.yml// extension. The built-in [[modding:Getting_Started#Decrypting_the_game|decryptor]] of OneLoader will output the same files with a //.yaml// extension. ==== .ogg - Vorbis audio ==== //Encrypted: yes, as .rpgmvo//\\ //Patching: normal replacement//\\ //.ogg// files contain compressed audio using the [[wp>Vorbis]] codec. They can be [[modding:patching|patched]] normally. ===== Delta files ===== Deltas are explained [[modding:delta-patching|here]]. They are special file types to modify a game file. They are not used by the base game, only by OMORI mods through the help of OneLoader. The file types that can be used for delta patching are: ==== .jsond - JSON patch files ==== Patch only parts of the object contained within a game's JSON file by loading a `.jsond` file. The syntax to modify JSON objects can be found [[https://jsonpatch.com|here]]. Here's a [[https://extendsclass.com/json-patch.html|JSON patch generator]] which you can use to generate patches by supplying the original file, and the state after your modifications. We recommend this, because manually writing JSON patches is hard. ==== .yamld - YAML patch files ==== You can use //.yamld// files to patch YAML files similar to //.jsond//. You might think that the content needs to be the json-patch format, but instead with YAML syntax, but this is not the case. Unlike YAML files, which naturally contain YAML syntax, //.yamld// files **must contain JSON** syntax that matches the json-patch schema, just like `.jsond` files. //(Todo: add example to illustrate)// ==== .olid - OneLoaderImageDelta ==== OneLoaderImageDelta files contain patching instructions for PNG files. You can find out more on the wiki page about [[modding:replacing_images#Image_Deltas|replacing images]]. ===== Less common file types ===== ==== .webm - Video files ==== //Encrypted: no//\\ //Patching: normal replacement//\\ [[wp>WebM]] files are lossy video files encoded using [[wp>VP9]]. ==== .ttf - Font files ==== // Encrypted: no//\\ //Patching: normal replacement//\\ //todo// ==== donottouch.xlxs - language file index table ==== //Encrypted: yes, same encryption as .KEL, but encrypted file also has .xlxs extension.//\\ //Patching: don't((As far as we can tell, there's no need to modify this file, and it might actually just mess up stuff. [Sources required lol]))//\\ {{:modding:donottouch-xlxs-explanation.png?linkonly|Explanation}}. ===== Other known file types ===== //.so, .lib, .dll// === JavaScript Addendum === You should know that you don't have to keep the same file structure, or names, or even contents. You can name your files whatever you want, as long as you load them properly through the [[modding:mod.json|mod.json]] file. You can also have all functions in a single or just a few files, if you want.