SC3 Config File
Config file is divded into three sections: Config, SearchPaths and Defines. First one defines all the basic properties, 2nd paths in which to search all the unit/include files and 3rd pre-defines come preprocessor defines.
Contents
Config
Key | Description | Type | Required | Default value |
---|---|---|---|---|
Name | The name of the script. Appears everywhere in console output that is related to that script (compile messages, exceptions). Must be at most 25 characters long. | String | Yes | none |
MainFile | The name of entry file for the script. | String | No | main.pas |
Debug | Whenever script should run in debug mode or not. In debug mode, debug symbols are also compiled and used during runtime. This allows displaying line and unit name in case of exception. | Boolean (1 or 0) | No | 0 |
Sandboxed | Sandbox level for the script. possible values:
This value can be constrained by server.ini file. |
Integer | No | 2 |
AllowDlls | Whenever the script is allowed to load external dlls. This value can be constrained by server.ini file. | Boolean (1 or 0) | No | 0 |
AllowIniEdit | Used only if Sandboxed is set to 1. Determinates whenever script is allowed to read/write soldat.ini and server.ini. This value can be constrained by server.ini file. | Boolean (1 or 0) | No | 0 |
Gamemod | Whenever the script is a gamemod. Gamemod script mark server as gamemod server and thus make it displayed as such in the lobby | Boolean (1 or 0) | No | 0 |
Legacy | Whenever the script should run in legacy mode or not. Legacy mode adds all interface and events known from ScriptCore 2. Usfeul for migrating the scripts. | Boolean (1 or 0) | No | 0 |
Example:
[Config] Name=My awesome script MainFile=events.pas Sandboxed=1 Legacy=1
SearchPaths
[SearchPaths] section defines all the folders that should be scanned for unit files. Paths should be delimited by enter, each path in new line. Paths can contain "../" which allows to make script use some "shared" units folder. Paths are relative to script's root folder (soldatserver/scripts/<script name>). They also inherit paths defined in server.ini file, which are also relative to root folder of script they're applied to. Script's root folder is scanned by default, there's no need to add "." search path.
Example:
[SearchPaths] /players /players/tasks /game/ ../shared
Defines
[Defines] section defines preprocessor constants that should be exported to the script. Besides those defined here, script will also recieve WINDOWS/UNIX constant depending on operating system it runs on. Defines should be enter delimited, each define in new line. Script also inherits all defines defined in server.ini file. Example
[Defines] TEST DEBUG FANCY lowercasedarealsook
Example
Complete file made from this article's example would look like this:
[Config] Name=My awesome script MainFile=events.pas Sandboxed=1 Legacy=1 [SearchPaths] /players /players/tasks /game/ ../shared [Defines] TEST DEBUG FANCY lowercasedarealsook