Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
SpontanCombust committed Sep 14, 2023
1 parent b90ac49 commit a7a3b3d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Framework for modding Witcher 3 that simplifies the pipeline of using mod settin
## Overview
Witcher 3 allows for creating custom mod menus which provide an interface between the mod developer and the end user to further customize their experience. The way settings are accessed in game's scripts is not complicated, but can often result in very boilerplaty code and situations when settings can be fetched improperly simply due to some typo. This framework is trying to midigate that.

Framework provides xml parser program. It generates WitcherScript code which mirrors the structure of customisable variables in the xml and assures on compile time that the developer uses their variables properly - no way for typos or bad type cast.
Framework provides xml parser program. It generates WitcherScript code which mirrors the structure of customisable variables in the xml and assures on compile time that the developer uses their variables properly - no way for typos, bad type cast or other headaches.


## Instructions for mod users
Expand Down Expand Up @@ -105,7 +105,9 @@ The most common usage of this would be overriding `ReadSettings()` method to run
- 0.1.0 - 0.2.0 for game version 1.32 (requires [Community Patch - Base](https://www.nexusmods.com/witcher3/mods/3652))

### Migrating from version v0.5 to v0.6 and beyond (for developers)
Most of the data that previously had to be passed into the CLI now can be put directly in the XML. Check [details](doc/details.md) and [xml specification](doc/xml_specification.md). Script files generated by earlier version parsers are not compatible.
Script files generated by pre-v0.6 version parsers and therefore mods using them are not compatible with the current version of `modSettingsFramework` and can't be mixed.
If you're a mod creator, please reparse you XMLs for this version.
Also, most of the data that previously had to be passed into the CLI now has to be put directly in the XML. Therefore the process of parsing said file has been changed to some degree. Check [details](doc/details.md) and [xml specification](doc/xml_specification.md) for more information about that.

## Documentation
[Further reading](doc/details.md)
Expand Down
16 changes: 7 additions & 9 deletions doc/details.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ Var's displayType and some other factors determine what type does the correspond
## Custom XML data
The game reads XML config files and takes only the data that it needs without applying strict schema rules onto them. What this means is that alongside the well known data that the game expects we can put extra data that only the framework's parser needs without risking the game to throw any errors.

Most of the custom XML data is completely optional. The full specification describing it can be found in [xml specification](./xml_specification.md).
Most of the data that has previously been passed into the parser through CLI now is done by using custom XML attributes.
The full specification describing it together with which attributes are necessary can be found in [xml specification](./xml_specification.md).

The approach of passing data directly in the XML makes the parsing process a lot more flexible compared to pre v0.6 versions of the framework, where a lot had to be deduced solely from command line argument hints. One major example being the settings master class name that now instead of being entred through CLI with `--master` option is now set with `msfClass` attribute in the `UserConfig` node in the xml.


## Default on first use
## Default values on first use
When initialising the settings for your mod for the very first time in game the framework applies a default preset for each settings Group. Therefore if you want a specific set of values to be set you should create PresetsArrays for your Groups. By default the preset with index 0 is picked. If you want other one to be the default, use `msfDefault` attribute in PresetsArray node.

## Var validation
After reading from and before writing to user configuration during the game values of the parsed class are corrected to adhere to their XML constraints, for example a variable corresponding to the slider var in XML will have its value clamped between minimal and maximal possible values.
It is possible to disable this validation for the entire class or singular groups and vars. To do it use the `msfValidate` attribute.


## Enums

Expand Down Expand Up @@ -51,11 +54,6 @@ If a variable of a unified enum type in WitcherScript gets assigned a value it i
If a unified enum type exists for the settings class, an extra set of functions are generated, which names start with `EnumValueMapping`. They essentially make all of this just work and allow the conversion from user config integer value to enum value in WitcherScript and vice versa.


## Var validation
After reading from and before writing to user configuration during the game values of the parsed class are corrected to adhere to their XML constraints, for example a variable corresponding to the slider var in XML will have its value clamped between minimal and maximal possible values.
It is possible to disable this validation for the entire class or singular groups and vars. To do it use the `msfValidate` attribute.


## Breaking changes

### v0.6
Expand Down

0 comments on commit a7a3b3d

Please sign in to comment.