Difference between revisions of "SC3 Config File"

From Soldat Community Wiki
Jump to: navigation, search
m (Defines)
(Added example)
Line 8: Line 8:
 
|-
 
|-
 
| Name
 
| Name
| The name of the script. Appears everywhere in console output that is related to that script (compile messages, exceptions)
+
| 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.
 
| align="center" | String
 
| align="center" | String
 
| align="center" | Yes
 
| align="center" | Yes
Line 59: Line 59:
 
| align="center" | 0
 
| align="center" | 0
 
|}
 
|}
 +
 +
Example:
 +
  [Config]
 +
  Name=My awesome script
 +
  MainFile=events.pas
 +
  Sandboxed=1
 +
  Legacy=1
  
 
==SearchPaths==
 
==SearchPaths==

Revision as of 14:12, 29 July 2013

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.

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:
  • 0: access to entire harddrive
  • 1: access to entire soldatserver/ folder
  • 2: access restricted to script's data folder (soldatserver/scripts/<script name>/data

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 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 ScriptCore2. 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. 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. Example

 [Defines]
 TEST
 DEBUG
 FANCY
 lowercasedarealsook