Script reference

Scripting in Soil enables you to add extra functionality to your maps or entire gamemodes in your dataset. To add script to your map, simply create file called "<mapname>.script" inside map folder. You can also create general purpose script for scenario or multiplayer that will be used if map doesn't have its own script. To do this, create "scenario.script" or "multiplayer.script" in "scripts" folder in your dataset. You can start by copying "template.script" from "common" dataset's "scripts" folder.

Soil uses AngelScript as its scripting language. You can find most relevant AngelScript's part of documentation here. If you are familiar with C/C++ syntax, you should have no problem getting started. Otherwise, you can inspect scripts and try to figure it out, with help of above mentioned documentation, or post any questions on forums. You can also use functions and types from AngelScript add-ons string, arrays and math functions. You can use include directive with quotes to include other script files to your script. Use #include "relative.script" to include script in same directory as main script, #include "../../scripts/dataset.script" to include script in your dataset scripts folder, #include "../../../common/scripts/dataset.script" to include script in common scripts folder.

Below is documentation of interfaces exposed to scripts. As a final quick note on scripting language, keep in mind that all arrays and indices start from zero! Therefore a correct way to check for boundary condition is index < numberOfElements

You can check your script's syntax using "script_validator.exe". Simply drag and drop your script file on the "script_validator.exe" to open it. This will also create logs next to your script. Those can be deleted.