This is an old revision of the document!
this.updateMapFiles(GNSFile, files = {})
Reads the byte data of a GNS file and replaces the sectors/files in the ModImg of that file to match the ones specified in files
with a format of { "OldMapPathA": "NewMapPathA", "OldMapPathB": "NewMapPathB" }
this.game.bindMapID(mapID, GNSFile)
Sets the link in BATTLE.BIN of a given map ID to point toward a map GNS of your choice. This allows you to use multiple versions of the same base map.
this.game.includeMod(modName, callFunction = null, args = [])
Includes another mod of the same game. modName
must match the directory name of the mod. You may call a specific function with arguments immediately, or you can interest with the object class as you desire through this.game.mods[modName]
once it executes.
For example, the following 3 blocks of code are equivalent:
this.game.includeMod('test', 'patch');
this.game.includeMod('test'); this.game.mods['test'].patch();
let testMod = this.game.includeMod('test'); testMod.patch();
this.game.openVanillaImg()
Opens the Vanilla Image specified by the Vanilla_Image_Path
option for reading.
this.game.closeVanillaImg()
Closes the Vanilla Image opened by openVanillaImg
.
this.game.openModImg(flags = 'r+')
Opens the Modification Image specified by the Mod_Image_Path
option (default: for writing).
this.game.closeModImg()
Closes the Modification Image opened by openModImg
this.game.copyVanillaImgFile(vanillaFilePath, modFilePath, startSector = null)
Reads the content of vanillaFilePath
on the Vanilla ISO (this.game.vanillaImg
), creates a new file under modFilePath
in the Modification ISO, and then imports the Vanilla file's data at the given sector. If startSector
isn't specified, the function will automatically search for free space.
* vanillaFilePath/modFilePath format: CD/Path/To/File.ext
this.game.wipeModImg()
Deletes the current Modification ISO and copies over the Vanilla ISO.