Load Order Files
Load order files are Order's way of discerning what order to load each mod, as the name might imply.
The File
To discover the load order file, it must be placed anywhere inside The Sims 4's mod folder. Additionally, the load order file's name must contain 'NeonOcean-Load-Order' and the file's extension should be '.json'. The load order file's name and file extension are not case sensitive.
The File's Contents
A load order file must contain data, in the JSON format, for instructing Order on the load order of the mod. The root of the load order file should be a JSON array of JSON objects. Each JSON object in the array represents a load order level.
Example load order file
[
{
"Level": -100,
"Paths": [
{
"Root": "Current",
"Path": "Example.ts4script"
}
],
"Functions": [
{
"Module": "ExampleMod.Loader",
"Function": "Load",
"Arguments": [ "FunctionArgument" ],
"KeywordArguments": { }
}
]
},
{
"Level": 50,
"Paths": [
{
"Root": "Mods",
"Path": "Example2Folder/Example2.ts4script"
}
]
}
]
Attributes
- Level (Optional attribute): A number that controls when the corresponding script paths will be imported and the functions called. The paths and functions with the lowest level value will be dealt with first. This value supports decimal places and can even be negative infinity or positive infinity. If this attribute does not exist all paths and functions in the JSON object will default to level 0. All script paths without load order files pointing to them will also be handled at level 0.
- Paths (Partially Optional attribute): Another array of JSON objects, each of this array's object points Order to a script path meant to be imported at the containing object's level. If this doesn't exist in the containing object then the 'Functions' attribute must exist.
- Root: This value tells Order where to start looking for the script path, it can have three possible values: S4, Mods and Current. For the value 'S4', order will start looking from The Sims 4's user data path (The folder that contains the mod folder). If the root value is 'Mods', we will start looking from the mod folder. With the value 'Current', Order will begin the search from the folder it found the load order file in. The root value is required to exist in every path JSON object, otherwise Order will ignore the file. Note that root values are not case sensitive, both 'Mods' and 'mods' would be a valid value.
- Path: The path value represents the relative file path to target script path from the root.
- Functions (Partially Optional attribute): Similar to the paths attribute, this is also an array of JSON objects. A load order function is used to direct Order to call specific Python functions at the containing object's level. All function calls will always occur after all Python modules in all script paths on the same level are imported. If this doesn't exist in the containing object then the 'Paths' attribute must exist.
- Module: The Python module the targeted Python function resides in.
- Function: The name of the Python targeted Python function.
- Arguments (Optional attribute): A JSON array of arguments to be passed to the target function.
- KeywordArguments (Optional attribute): A JSON object that is passed to the target function as the keyword arguments.
Load Order Errors
Any problem load order files will generally be ignored by Order. Information on the issues within your order files will be written to a log file at '<Sims 4 user data path>\NeonOcean\Debug\Mods\NeonOcean.S4.Order\<Game start time>\Log.xml' each time the game starts.