Skip to content

Editor Config files ([titleId].json)

WerWolv edited this page Aug 18, 2018 · 23 revisions

Editor-Config files

Naming

Editor-Config files are used to specify what Widgets EdiZon should display, which Editor-Script file should get used and what parameters should get passed to the script. To use the builtin editor with a specific game, a Editor-Config file named with the titleID of that game will be required to be put inside the sdmc:/EdiZon/editor/ folder. For example, if the desired game is Zelda: Breath of the Wild, a file with this name will be required: sdmc:/EdiZon/editor/0100509005AF2000.json. Note that all alphabetical character need to be UPPERCASE!

Content

The content of the file is written in the JSON standard. A typical example looks as follows:

{
   "1.0.0" : {
	"saveFilePaths" : [ "path", "\\d+", "[a-zA-Z0-9]+_\\d+" ],
	"files" : "filename\\.sav",
        "encoding": "ascii",
	"filetype": "bin",
	"items": [
	{
	  "name" : "Integer Value",
          "category" : "Category 1",
	  "intArgs" : [ 2, 2 ], 
	  "strArgs" : [ "DEAD", "BEEF" ],
	  "widget" : {
		"type" : "int",
		"minValue" : 0,
		"maxValue" : 9999,
                "stepSize" : 100,
                "preEquation" : "(5 * value) + 1",
                "postEquation" : "10 * value",
                "postEquationInverse" : "value / 10"
	  }
	},
	{
	  "name" : "Boolean Value",
          "category" : "Category 1",
	  "intArgs" : [ 2, 2 ], 
	  "strArgs" : [ "CAFE", "BABE" ],
	  "widget" : {
		"type" : "bool",
		"onValue" : 0,
		"offValue" : 1
	  }
	},
	{
	  "name" : "List Value",
          "category" : "Category 1",
	  "intArgs" : [ 2, 2 ], 
	  "strArgs" : [ "DEAD", "C0DE" ],
	  "widget" : {
		"type" : "list",
		"listItemNames" : [ "List Entry 1", "List Entry 2", "List Entry 3" ],
		"listItemValues" : [ 123, 456, 789 ]
	  }
	}
	]
    },
    "1.1.0 1.2.0 1.3.0" : {
        
    }
}

Tag List

The first key which encloses all other keys specifies the version of the game needed to use this config. If the version doesn't match, an error will be displayed in the editor and editing will be disabled. The name of the key simply has to be the version of the game for which the values works. Multiple versions can be specified by entering all of them in the same key and separating them by a space. If the values work for all versions, the word all can be used as key.

  • saveFilePaths: The folder paths in which the save files are located. For this, a RegEx will be used. For example if there are saves inside save:/1/ and inside save:/2/, use [ "\\d" ]. Use "" to target the root directory. Make sure to separate the file path into its different sub-folders. Like /path/to/save/ becomes ["path", "to", "save" ].
  • files: Specifies which files should get displayed in the list. This value consist of a RegEx, which targets all valid names for the save files.
  • encoding: Optional! Used to specify the encoding of the save file if it's a plain text file. Supported are ascii, utf-8, utf-16le and utf-16be
  • filetype: Specifies which Editor-Script file gets used to do the parsing. If bin.lua should get used, enter bin.
  • items: Inside this array, every new element will become a new widget inside the editor.
    • name: The name of the widget. This is the text which will be displayed next to the value on the widget.
    • category: This string specifies in which category the widget will get sorted. This can be any alphanumeric string.
    • intArgs: Integer arguments that get sent 1:1 to the Editor-Script when executed. They depend on the Editor-Script implementation. Check out the Editor-Script file Wiki page for more information.
    • strArgs: String arguments that get sent 1:1 to the Editor-Script when executed. They depend on the Editor-Script implementation. Check out the Editor-Script file Wiki page for more information.
    • widget: These are the widget settings.
      • type: Configures the type of widget that gets used. Currently there are int, bool and list which generate a numeric up-down scroller, a switch and a list selection.
      • stepSize: Optional! Specific for integer types. This sets the speed with which the value fast increments. If this value doesn't get specified, the formula floor((maxValue - minValue) / 500.0F) will be used
      • minValue: Specific for integer types. This is the minimum value the allowed to be set before it wraps around.
      • maxValue: Specific for integer types. This is the maximum value the allowed to be set before it wraps around.
      • onValue: Specific for boolean types. This is the value that will be set if the switch is set to ON. This may be an int or a string.
      • offValue: Specific for boolean types. This is the value that will be set if the switch is set to OFF. This may be an int or a string.
      • listItemNames: Specific for list types. List of names that get shown in the editor drop down list.
      • listItemValues: Specific for list types. List of values that get written to the save file when a value inside the drop down list is selected. In the above example, if List Entry 1 gets selected, 123 will be written. These values may be ints or strings. Only one data type can be used at once.
      • preEquation: Optional! A mathematical equation that will get evaluated before the value read from the config gets displayed inside the editor and modifies the displayed amount. The keyword value stands for the value before the calculation. Please see Config Equations for more information.
      • postEquation: Optional! A mathematical equation that will get evaluated when a value gets edited. It will only affect the value stored in the save file, not the one displayed in the editor. The keyword value stands for the value before the calculation. Please see Config Equations for more information.
      • postEquationInverse: Optional! If postEquation is used, this is necessary for a working config. The inverse function of postEquation has to be entered here. The keyword value stands for the value before the calculation. Please see Config Equations for more information.

Config file redirection

If a game uses different titleIDs for different regions but the save files itself are identical, it is possible to redirect a config file to another.

{
     "useInstead" : "0100509005AF2000.json"
}

EdiZon will ignore all values in this config and will instead load the values from the file specified under the useInstead tag.

Config equations

Given are following values:

  • Value stored inside save file : 500
  • preEquation : (5 * value) + 1
  • postEquation : 10 * value
  • postEquationInverse : value / 10

First the postEquationInverse gets evaluated. This will reverse the calculation done by postEquation and results in 500 / 10 = 50. Now the preEquation gets evaluated which results in (5 * 50) + 1 = 251. The editor will display 251 now instead of 50. The user now modifies the value to what the editor displays as 301. This results in the old value before preEquation was applied (50) being modified to 60 for example. Now postEquation gets evaluated which's result is 10 * 60 = 600. The value 600 will get written in the save file now.

Clone this wiki locally