Editor Config files ([titleId].json) - WerWolv/EdiZon GitHub Wiki

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:

{
   "author" : "WerWolv",
   "scriptLanguage" : "lua",
   "beta" : true,
   "startupMessage" : "This message will be displayed \n when opening the editor!",
   "1.0.0" : [
        {
	  "saveFilePaths" : [ "path", "\\d+", "[a-zA-Z0-9]+_\\d+" ],
	  "files" : "filename\\.sav",
          "encoding": "ascii",
	  "filetype": "bin",
	  "items": [
	  {
	    "name" : "Comment",
            "category" : "Category 1",
	    "intArgs" : [ ], 
	    "strArgs" : [ ],
            "tooltip" : "This is a tooltip and it will pop up when hovering over a widget for some time",
	    "widget" : {
		  "type" : "comment",
	  	  "comment": "This is a very long comment text. \n It explains a lot"
	    }
	  },
	  {
	    "name" : "Integer Value",
            "category" : "Category 1",
	    "intArgs" : [ 2, 2 ], 
	    "strArgs" : [ "DEAD", "BEEF" ],
	    "widget" : {
		  "type" : "int",
	  	  "minValue" : 0,
	 	  "maxValue" : 9999,
                  "stepSize" : 100,
                  "readEquation" : "10 * value",
                  "writeEquation" : "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 ]
	    }
	  }
	]
    },
    {
          "saveFilePaths" : [ "path2", "\\d+", "[a-zA-Z0-9]+_\\d+" ],
	  "files" : "different_filename\\.sav",
          "encoding": "ascii",
	  "filetype": "bin",
	  "items": [
          {
                "name" : "Dummy String Value",
                "category" : "Category 1",
                "dummy": true,
	        "intArgs" : [ 123, 456 ], 
	        "strArgs" : [ "ABC", "DEF" ],
	        "widget" : {
		     "type" : "string",
		     "minLength" : 1,
		     "maxLength" : 20
	        }
            }
       ]
    }
    ],
    "1.1.0 1.2.0 1.3.0" : [
        {
        
        }
    ]
}

Key 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. On the same level there's also the beta key which can be set to either true or false. Script developers must set this to true so it shows up as Beta config in EdiZon. This will be set to false once the config has been available for some time without any issues. The author key is required but purely aesthetic. It's used to credit the author of the config in the editor. The last key on the top level is the scriptLanguage key. It can be set to either lua or py/python and tells EdiZon which script interpreter should be used.

The value of the version keys is an array containing a json-object with the following key-value pairs. This array can contain multiple of these objects to allow for different configs that get applied to a different file inside the file system of the same game.

  • 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.
  • startupMessage : Optional! A message box containing the text specified here will appear for the user when starting the editor. New lines have to be enforced using \n
  • 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.
    • tooltip : Optional! If present, a tooltip containing the message specified here will be displayed in the editor screen when the user hovers of this widget for a moment.
    • dummy: If this value is set to true, the widget becomes a dummy widget. This can be used to talk to the lua script to make adjustments and change it's settings while edizon is running. The save file won't be modified by changing these options by default. Read more about this in the dummy section of the script files.
    • 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, list, string and comment which generate a numeric up-down scroller, a switch, a list selection, a text input field or a comment text.
      • stepSize: Optional! Specific for integer types. This defines how big the steps are when changing a value. Multipliers will be applied to this as well. If unset, 1 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.
      • readEquation: Optional! A mathematical equation that will get evaluated directly after a value gets read from the save file. The keyword value stands for the value before the calculation.
      • writeEquation: Optional! If readEquation is used, this is necessary for a working config. It gets applied directly before a value is written to the save file. The keyword value stands for the value before the calculation.
      • 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.
      • minLength: Specific for string types. This is the minimum length of the string that has to be input to be accepted.
      • maxLength: Specific for string types. This is the maximum length of the string that has to be input to be accepted.
      • comment: Specific for comment types. This text will get displayed in light gray on the comment widget. If the user selects it with A, a popup will appear that displays the entire text. You need to manually add \n for a new line.

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 key. Redirection will stop after 5 redirections and EdiZon will display an error to the user.