modding:developerinfo:baseconfig

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

modding:developerinfo:baseconfig [2019/03/19 10:18] (current)
Line 1: Line 1:
 +===== Base config =====
  
 +==== Overview ====
 +
 +All main aspects of the game world can be configured in the file ''​base_config.lua'',​ which can be found in the folder ''​res\config\''​.
 +
 +
 +It is structured as follows:
 +
 +<code lua>
 +game.config.costs = {
 +  -- general cost configuration
 +}
 +
 +game.config.cargotypes = {
 +  -- table with cargo types
 +}
 +
 +game.config.terrain = {
 +  -- configuration of generator, shaders, textures, and vegetation
 +}
 +
 +game.config.environment = {
 +  -- lighting, fog, sky box and environment map
 +}
 +
 +game.config.audio = {
 +  -- configuration of environment audio sources and music tracks
 +}
 +
 +game.config.world = {
 +  -- towns and industries
 +}
 +</​code>​
 +
 +Most of the parameters are self-explanatory or are explained with comments in the file itself.
 +
 +
 +==== Example mod ====
 +
 +All values in the ''​base_config.lua''​ can be changed by a mod without altering the original file.\\
 +\\
 +This can be achieved by setting the value in the run function of the main mod file ''​mod.lua'':​\\
 +
 +<code lua>
 +
 +runFn = function (settings)
 +     ​game.config.millisPerDay = 8000      -- length of a day [ms]
 +end
 +
 +</​code>​
 +
 +Example download [example_length_of_day_1]
modding/developerinfo/baseconfig.txt · Last modified: 2019/03/19 10:18 (external edit)