mirror of
https://github.com/Oarcinae/FactorioScenarioMultiplayerSpawn.git
synced 2025-01-24 03:16:22 +02:00
183 lines
9.6 KiB
Lua
183 lines
9.6 KiB
Lua
|
-- oarc_global_cfg.lua
|
||
|
-- April 2019
|
||
|
--
|
||
|
-- Here is where we store/init config values to the global table.
|
||
|
-- Allows runtime modification of game settings if we want it.
|
||
|
-- Also allows supporting both MOD and SCENARIO versions.
|
||
|
|
||
|
|
||
|
function InitOarcConfig()
|
||
|
|
||
|
-- Short and sweet.
|
||
|
global.ocfg = {}
|
||
|
|
||
|
|
||
|
local is_mod = false
|
||
|
for name, version in pairs(game.active_mods) do
|
||
|
if (name == "oarc-mod") then
|
||
|
is_mod = true
|
||
|
log("Oarc MOD! Version: " .. version)
|
||
|
end
|
||
|
end
|
||
|
|
||
|
-- That's a LOT of settings. -- SCENARIO VERSION
|
||
|
if (not is_mod) then
|
||
|
global.ocfg["welcome-title"] = WELCOME_MSG_TITLE
|
||
|
global.ocfg["welcome-msg"] = WELCOME_MSG
|
||
|
global.ocfg["server-rules"] = SERVER_MSG
|
||
|
global.ocfg["minimum-online-time"] = MIN_ONLINE_TIME_IN_MINUTES
|
||
|
global.ocfg["server-contact"] = CONTACT_MSG
|
||
|
global.ocfg["enable-vanilla-spawns"] = ENABLE_VANILLA_SPAWNS
|
||
|
global.ocfg["enable-buddy-spawn"] = ENABLE_BUDDY_SPAWN
|
||
|
global.ocfg["frontier-rocket-silo"] = FRONTIER_ROCKET_SILO_MODE
|
||
|
global.ocfg["enable-undecorator"] = ENABLE_UNDECORATOR
|
||
|
global.ocfg["enable-tags"] = ENABLE_TAGS
|
||
|
global.ocfg["enable-long-reach"] = ENABLE_LONGREACH
|
||
|
global.ocfg["enable-autofill"] = ENABLE_AUTOFILL
|
||
|
global.ocfg["enable-player-list"] = ENABLE_PLAYER_LIST
|
||
|
global.ocfg["list-offline-players"] = PLAYER_LIST_OFFLINE_PLAYERS
|
||
|
global.ocfg["enable-shared-team-vision"] = ENABLE_SHARED_TEAM_VISION
|
||
|
global.ocfg["enable-regrowth"] = ENABLE_REGROWTH
|
||
|
global.ocfg["enable-abandoned-base-removal"] = ENABLE_ABANDONED_BASE_REMOVAL
|
||
|
global.ocfg["enable-research-queue"] = ENABLE_RESEARCH_QUEUE
|
||
|
global.ocfg["modified-enemy-spawning"] = OARC_MODIFIED_ENEMY_SPAWNING
|
||
|
global.ocfg["near-dist-start"] = NEAR_MIN_DIST
|
||
|
global.ocfg["near-dist-end"] = NEAR_MAX_DIST
|
||
|
global.ocfg["far-dist-start"] = FAR_MIN_DIST
|
||
|
global.ocfg["far-dist-end"] = FAR_MAX_DIST
|
||
|
global.ocfg["vanilla-spawn-count"] = VANILLA_SPAWN_COUNT
|
||
|
global.ocfg["vanilla-spawn-spacing"] = VANILLA_SPAWN_SPACING
|
||
|
|
||
|
global.ocfg["spawn_config"] = OARC_CFG
|
||
|
|
||
|
global.ocfg["enable-separate-teams"] = ENABLE_SEPARATE_TEAMS
|
||
|
global.ocfg["main-force"] = MAIN_FORCE
|
||
|
global.ocfg["enable-shared-spawns"] = ENABLE_SHARED_SPAWNS
|
||
|
global.ocfg["max-players-shared-spawn"] = MAX_ONLINE_PLAYERS_AT_SHARED_SPAWN
|
||
|
global.ocfg["enable-shared-chat"] = ENABLE_SHARED_TEAM_CHAT
|
||
|
global.ocfg["respawn-cooldown-min"] = RESPAWN_COOLDOWN_IN_MINUTES
|
||
|
global.ocfg["frontier-silo-count"] = SILO_NUM_SPAWNS
|
||
|
global.ocfg["frontier-silo-distance"] = SILO_CHUNK_DISTANCE
|
||
|
global.ocfg["frontier-silo-vision"] = ENABLE_SILO_VISION
|
||
|
|
||
|
-- That's a LOT of settings. -- MOD VERSION
|
||
|
else
|
||
|
global.ocfg["welcome-title"] = settings.global["oarc-welcome-title"].value
|
||
|
global.ocfg["welcome-msg"] = settings.global["oarc-welcome-msg"].value
|
||
|
global.ocfg["server-rules"] = settings.global["oarc-server-rules"].value
|
||
|
global.ocfg["minimum-online-time"] = settings.global["oarc-minimum-online-time"].value
|
||
|
global.ocfg["server-contact"] = settings.global["oarc-server-contact"].value
|
||
|
global.ocfg["enable-vanilla-spawns"] = settings.global["oarc-enable-vanilla-spawns"].value
|
||
|
global.ocfg["enable-buddy-spawn"] = settings.global["oarc-enable-buddy-spawn"].value
|
||
|
global.ocfg["frontier-rocket-silo"] = settings.global["oarc-frontier-rocket-silo"].value
|
||
|
global.ocfg["enable-undecorator"] = settings.global["oarc-enable-undecorator"].value
|
||
|
global.ocfg["enable-tags"] = settings.global["oarc-enable-tags"].value
|
||
|
global.ocfg["enable-long-reach"] = settings.global["oarc-enable-long-reach"].value
|
||
|
global.ocfg["enable-autofill"] = settings.global["oarc-enable-autofill"].value
|
||
|
global.ocfg["enable-player-list"] = settings.global["oarc-enable-player-list"].value
|
||
|
global.ocfg["list-offline-players"] = settings.global["oarc-list-offline-players"].value
|
||
|
global.ocfg["enable-shared-team-vision"] = settings.global["oarc-enable-shared-team-vision"].value
|
||
|
global.ocfg["enable-regrowth"] = settings.global["oarc-enable-regrowth"].value
|
||
|
global.ocfg["enable-abandoned-base-removal"] = settings.global["oarc-enable-abandoned-base-removal"].value
|
||
|
global.ocfg["enable-research-queue"] = settings.global["oarc-enable-research-queue"].value
|
||
|
global.ocfg["modified-enemy-spawning"] = settings.global["oarc-modified-enemy-spawning"].value
|
||
|
global.ocfg["near-dist-start"] = settings.global["oarc-near-dist-start"].value
|
||
|
global.ocfg["near-dist-end"] = settings.global["oarc-near-dist-end"].value
|
||
|
global.ocfg["far-dist-start"] = settings.global["oarc-far-dist-start"].value
|
||
|
global.ocfg["far-dist-end"] = settings.global["oarc-far-dist-end"].value
|
||
|
global.ocfg["vanilla-spawn-count"] = settings.global["oarc-vanilla-spawn-count"].value
|
||
|
global.ocfg["vanilla-spawn-spacing"] = settings.global["oarc-vanilla-spawn-spacing"].value
|
||
|
|
||
|
global.ocfg["spawn_config"] = {
|
||
|
gen_settings = {
|
||
|
land_area_tiles = settings.global["oarc-enforce-land-area-tile-dist"].value,
|
||
|
moat_choice_enabled = settings.global["oarc-allow-moat-choice"].value,
|
||
|
moat_size_modifier = settings.global["oarc-moat-size-mod"].value,
|
||
|
resources_circle_shape = settings.global["oarc-resource-shape-circle"].value,
|
||
|
force_grass = settings.global["oarc-force-grass"].value,
|
||
|
tree_circle = settings.global["oarc-tree-circle"].value,
|
||
|
tree_octagon = settings.global["oarc-tree-octagon"].value,
|
||
|
},
|
||
|
safe_area =
|
||
|
{
|
||
|
safe_radius = CHUNK_SIZE*10,
|
||
|
warn_radius = CHUNK_SIZE*20,
|
||
|
warn_reduction = 20,
|
||
|
danger_radius = CHUNK_SIZE*50,
|
||
|
danger_reduction = 5,
|
||
|
},
|
||
|
water = {
|
||
|
x_offset = settings.global["oarc-water-x-offset"].value,
|
||
|
y_offset = settings.global["oarc-water-y-offset"].value,
|
||
|
length = settings.global["oarc-water-length"].value,
|
||
|
},
|
||
|
resource_rand_pos_settings =
|
||
|
{
|
||
|
enabled = settings.global["oarc-resource-rand-pos-enabled"].value,
|
||
|
radius = settings.global["oarc-resource-rand-pos-radius"].value,
|
||
|
angle_offset = settings.global["oarc-resource-rand-pos-angle-offset"].value,
|
||
|
angle_final = settings.global["oarc-resource-rand-pos-angle-final"].value,
|
||
|
},
|
||
|
resource_tiles =
|
||
|
{
|
||
|
[settings.global["oarc-resource-1-name"].value] =
|
||
|
{
|
||
|
amount = settings.global["oarc-resource-1-amount"].value,
|
||
|
size = settings.global["oarc-resource-1-size"].value,
|
||
|
x_offset = -29,
|
||
|
y_offset = 16
|
||
|
},
|
||
|
[settings.global["oarc-resource-2-name"].value] =
|
||
|
{
|
||
|
amount = settings.global["oarc-resource-2-amount"].value,
|
||
|
size = settings.global["oarc-resource-2-size"].value,
|
||
|
x_offset = -28,
|
||
|
y_offset = -3
|
||
|
},
|
||
|
[settings.global["oarc-resource-3-name"].value] =
|
||
|
{
|
||
|
amount = settings.global["oarc-resource-3-amount"].value,
|
||
|
size = settings.global["oarc-resource-3-size"].value,
|
||
|
x_offset = -27,
|
||
|
y_offset = -34
|
||
|
},
|
||
|
[settings.global["oarc-resource-4-name"].value] =
|
||
|
{
|
||
|
amount = settings.global["oarc-resource-4-amount"].value,
|
||
|
size = settings.global["oarc-resource-4-size"].value,
|
||
|
x_offset = -27,
|
||
|
y_offset = -20
|
||
|
}
|
||
|
-- [settings.global["oarc-resource-5-name"].value] =
|
||
|
-- {
|
||
|
-- amount = settings.global["oarc-resource-5-amount"].value,
|
||
|
-- size = settings.global["oarc-resource-5-size"].value,
|
||
|
-- x_offset = -27,
|
||
|
-- y_offset = -20
|
||
|
-- }
|
||
|
},
|
||
|
resource_patches =
|
||
|
{
|
||
|
[settings.global["oarc-resource-patch-1-name"].value] =
|
||
|
{
|
||
|
num_patches = settings.global["oarc-resource-patch-1-count"].value,
|
||
|
amount = settings.global["oarc-resource-patch-1-amount"].value,
|
||
|
x_offset_start = 0,
|
||
|
y_offset_start = 48,
|
||
|
x_offset_next = 4,
|
||
|
y_offset_next = 0
|
||
|
}
|
||
|
},
|
||
|
}
|
||
|
|
||
|
global.ocfg["enable-separate-teams"] = settings.global["oarc-enable-separate-teams"].value
|
||
|
global.ocfg["main-force"] = settings.global["oarc-main-force"].value
|
||
|
global.ocfg["enable-shared-spawns"] = settings.global["oarc-enable-shared-spawns"].value
|
||
|
global.ocfg["max-players-shared-spawn"] = settings.global["oarc-max-players-shared-spawn"].value
|
||
|
global.ocfg["enable-shared-chat"] = settings.global["oarc-enable-shared-chat"].value
|
||
|
global.ocfg["respawn-cooldown-min"] = settings.global["oarc-respawn-cooldown-min"].value
|
||
|
global.ocfg["frontier-silo-count"] = settings.global["oarc-frontier-silo-count"].value
|
||
|
global.ocfg["frontier-silo-distance"] = settings.global["oarc-frontier-silo-distance"].value
|
||
|
global.ocfg["frontier-silo-vision"] = settings.global["oarc-frontier-silo-vision"].value
|
||
|
end
|
||
|
end
|