- Create a 'JsonError' mod in WB
- Create a file <moddir>\JsonError\scripts\Game\GameCore\Modded\SDRC_BaseGameMode.c
- Copy the code in Additional Information
- In WB, Create a world with GameMode_Plain:
- Compile and start the game.
- A simple file JsonError.json is created under profile\JsonError\
- File content will be: "{"value":1,"name":"dummy","vecval":[1.0,2.0,3.0]}"
- Rerun the code and the file values are loaded properly
- Change the file content to: "{"value":1,"name":"dummy","vecval":[2.0,3.0,4.0]}"
- Rerun the code and the file values are loaded properly
- Change the file content to: "{"value":1,"name":"dummy","vecval":[2.0,3,4.0]}". NOTE: 3.0 is changed to 3
- The file is proper json in case it's tested with a validator.
- Return the code and the file fails to load. The default values are used.
IMO, the vector value should be loaded even if it would be just [1,2,3]. With other float variables this works properly.