XS-CHECK¶
Support for XS has been greatly improved by the library: XS-Check made by Alian.
When calling scenario.write_to_file(...)
all XS that is present in the scenario is combined and sent to the XS-Check
library. After XS-Check has completed its validation steps the output is analyzed and shown back in the console.
By default, the writing process of AoE2ScenarioParser is not interrupted, even if an error is found in the XS code.
Only XS from Effects and Conditions is combined
Due to the import logic of XS scripts from many different locations depending on the installation
location of AoE2:DE, the XS script file that is referenced by filename in the XsManager
is NOT
added to the XS-Check library! Scripts added through xs_manager.add_script(...)
and all other
xs from effects and conditions is combined.
Configurations¶
There are some configuration options for XS Check in AoE2ScenarioParser. Below you can find the most useful ones. For more configuration options and more info, see the XS-Check API docs.
Enabling / Disabling¶
Disabling XS Check is very simple, you can do so using:
1 |
|
Raise on error¶
If you want an exception to be raised when errors are found in your XS file, you can change the following setting:
1 |
|
Timeout¶
The default timeout for XS Check is 60 seconds. This should be WAY more than most will ever need, but just in case your XS Check call takes longer than that. You can adjust it using:
1 |
|
Using an alternative binary¶
If you want to use different binaries than the ones that are shipped with AoE2ScenarioParser, you can set the path to a different binary on your system. You can do so by using:
1 |
|
If the binary is of a version that is not technically supported by AoE2ScenarioParser it'll show an error. If you want to try the unsupported binary anyway, you can also add the following:
1 |
|
Example¶
Below is an example of a trigger with a Script Call Effect with some invalid XS with the output that will be printed.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|