Skip to content

Available Editor Scripts

WerWolv edited this page Feb 21, 2019 · 8 revisions

This is the documentation for all available Editor Scripts. Please note, not all of them are developed by the EdiZon developers (@WerWolv98 and &thomasnet-mc). If you want your own Editor Script do be added to the documentation, please create an issue on the main repository with a link to your documentation and your Editor Script.

Currently supported save file types

Binary

Used for parsing binary files with no specific format by using addresses.

Example usage

"filetype" : "bin",
"items" : [
{
   "intArgs" : [ 2, 2 ],
   "strArgs" : [ "DEAD", "BEEF" ],
}
]

This Editor Script file can be used by specifying filetype as bin in your Editor Conifig file. Following arguments can be passed to the Editor script by using intArgs and strArgs:

  • intArgs
    • Value 1: The size of the address used in bytes. (1 for u8, 4 for u32)
    • Value 2: The size of the value to be read and written. (1 for u8, 4 for u32)
  • strArgs
    • Value 1: The indirect address of a value. This is the address to an address where the actual value can be found. See the next chapter for more information. If unused, set to 0000.
    • Value 2: The direct address of a value. This is the address of the value you want to edit. If an indirect address is used, this will function as an offset added to the address read by the indirect address. If unused, set to 0000.

Indirect addresses

An indirect address is basically an address to an address to a value. For following example an indirectAddress value of 0008 and an address of 0010 is used. First the parser looks for the value at address 0x0008 #FF0000. In this example it's 20 00 which corresponds to 0x0020 because save files are almost exclusively saved in little endian. Now the parser seeks to the address it just has read. In this example it seeks to address 0x0020 #008BFF. If no address has been set in the Editor Config file, this will be the value that gets read and modified by EdiZon. If address has been set, that value, in this example 0x0010, will be added to the previously read offset 0x0020, so the parser ends up at address 0x0030 #009B2F and reads/modifies this value instead.

Indirect address

Json

Used for parsing json save files.

Example usage

"filetype" : "json",
"items" : [
{
   "intArgs" : [ 0 ],
   "strArgs" : [ "hello", "world" ],
}
]

This Editor Script file can be used by specifying filetype as json in your Editor Config file. Following arguments can be passed to the Editor script by using intArgs and strArgs:

  • intArgs
    • Value 1: This specifies if booleans or integers should get used by the script. If this is 1, the script will use true & false instead of 1 and 0. If it's 0, it will use normal integers.
  • strArgs
    • Values: As many values as needed can be specified here. These tags specify the path to the value which gets read/modified. See the next chapter for more information.

Json keys

A typical Json save file looks as follows:

{
   "playerData" : {
       "collectibles": { 
           "coins" : 1234,
           "specialCoins": 7
       }
   },
   "worldData" : {
      "door_open : [ true, false ]
   }
}

In this example the second door should get opened. To achieve this, the parser needs to go into worldData, then door_open and then read/modify the second value in the array. This path is used as values in strArgs. To access an array by an index, prepend the number with a backslash. Here, strArgs needs to be set to

"strArgs" : [ "worldData", "door_open ", "\\1" ].

XML

"filetype" : "xmls",
"items" : [
{
   "intArgs" : [ 0 ],
   "strArgs" : [ "hello", "world" ],
}
]

The XML script works in exactly the same way as the Json script. The first element of intArgs specifies if EdiZon should treat that value as a boolean (therefor replace 0 with false and 1 with true). strArgs contains a list of XML tags that will be used to iterate through the hierarchical structure. If the value to modify is an attribute, the name of the key has to be prefixed with a @ (at) symbol.

Example

   <player>
      <p name="WerWolv" coins=10>9999</p>
   </player>

To modify the coins value, strArgs would have to be "strArgs" : [ "player", "p", "@name" ] To modify the value of p, strArgs would have to be "strArgs" : [ "player", "p" ]