Config Files
All config files in DSL are comprised of simple key/value pairs using plain text. They are used to define settings for both the script loader itself and for individual script collections.
Syntax
The first word on a line is considered the key, and the rest of the line (after skipping whitespace) is considered the value. Key names are case-sensitive.
# This is a comment
KeyName Value
Starting with DSL 5, the config file parser was improved to be more like traditional INI files:
- Keys and values can be separated with a colon (
:
) or an equals sign (=
). - String values can be wrapped in quotation marks.
- Lines starting with
[
(e.g.,[SECTION]
) are ignored by the parser. - Comments can be specified using a hash (
#
) or a semicolon (;
), which instructs DSL to ignore the rest of the line.
; This is also a comment
KeyName = "Some String Value"
AnotherKey: 123
The same key can be specified multiple times in a single config file. This functionality can be used to define an array of values, which can be iterated over using functions like AllConfigValues
.
weapon_model: 301
weapon_model: 305
Main DSL Config
DSL's main config file is located at _derpy_script_loader/config.txt
. This file is generated when DSL is started for the first time if it does not exist, or if the existing one is from an older version. It contains global settings for the script loader.
While most options are self-explanatory within the generated file, there are some hidden options that are not generated by default.
Hidden Developer Options (DSL 5)
These options are primarily for developers and are not included in the default config file.
[DEVELOPER OPTIONS]
dev_add_debug_functions false # add debug functions to the global environment
dev_add_rebuild_function false # add the RebuildArchives function to the global environment
Hidden Pool Options (DSL 5)
These experimental options allow for resizing the game's memory pools. Modifying these can lead to instability, as many parts of the game do not support larger pools.
[EXPERIMENTAL GAME POOL RESIZING]
resize_pool_scale 0 # multiply the value of all other pool options (pools are left alone when result is zero)
resize_pool_ptr_node 15000 # resize game pools (keep in mind many parts of the game will not support it)
resize_pool_entry_info_node 2000
resize_pool_vehicle 15
resize_pool_ped 24 # also controls 8 parallel pools
resize_pool_joint_constraint 48 # also controls 3 parallel pools
resize_pool_weapon 57 # actual name unknown
resize_pool_lua_script 8
resize_pool_dummy 300
resize_pool_prop_anim 220
resize_pool_building 2250
resize_pool_treadable 1
resize_pool_col_model 4150
resize_pool_stimulus 87
resize_pool_object 275
resize_pool_projectile 35
resize_pool_cut_scene 30
resize_pool_unknown 200 # unknown pool
Script Collection Config
Every script collection can have its own configuration file that defines how it should behave. This file must be named config.txt
or config.ini
and placed in the root of the collection's folder (or zip archive).
Starting from DSL 10, configuration files for script collections are no longer generated automatically. You must create one manually to define your collection's settings, scripts, and requirements.
For more details on how these settings affect a collection's behavior, see the Script Collections documentation.
Example Configuration
Below is an example of a config.ini
file for a script collection, demonstrating various available options.
; Name and requirements for the collection
require_name: My Awesome Mod
require_version: 10
; require_dependency: AnotherMod
; --- Startup Behavior ---
; Main script(s) that start when the collection starts.
; If a .lua file doesn't exist, .lur will be attempted.
; Defaults to "main.lua" if not specified.
main_script: scripts/main.lua
; Optional script(s) that run when the main menu is reached for the first time.
; Game functions are unavailable at this stage.
init_script: scripts/init.lua
; Optional script(s) that run very early during game initialization.
; Rendering is not allowed, and game functions are unavailable.
pre_init_script: scripts/pre-init.lua
; If this collection should automatically start.
; It's best to leave this commented out to respect the user's global preference.
; auto_start: true
; --- Network Settings ---
; Allows the collection to keep running when connected to a server.
; This is meant for non-gameplay-altering mods.
allow_on_server: false
; --- Game File Registration ---
; Registers files to be loaded into a temporary IMG archive when the game starts.
; This has no effect on server scripts.
; act_file: AI/AI.cat
; cuts_file: Cutscenes/1-01.dat
; trigger_file: Triggers/MisTrig.dat
; ide_file: IDE/default.idb
; scripts_file: Scripts/main.lur
; world_file: World/MG_Biology.nft
; --- Custom Mod Settings ---
; You can define any custom key/value pairs your scripts might need.
; These can be read using functions like GetConfigString, GetConfigNumber, etc.
font: Consolas
scale: 1.5
vertical_position: top
horizontal_position: right