* Magenta particle explosion effect when quarry digs a node * Option to enable dig particle effects, disabled by default. Reduced particle count to 20. * Changed dig particle effect - a particle starts in each of the 8 corners of the cube and move to the middle * Only generate dig particles if network lag is < 35000 * Replaced quarry dig effect with a particle spawner - the node's particles stream towards the quarry, stopping just in front of it, like they're being sucked up. * Simplifying dig particle vector maths using vector functions * Fixing comment typo * Dig particles now accelerate towards the quarry along a particular axis, causing them to approach the quarry in a curve. This also means they end inside the node in front of the quarry, which improves how the effect looks when digging deep down. * Adding network to run_nodes call, using network passed through to check lag for quarry dig particles * Missing local * Missing local * Using vector.new to copy a vector and make a 0,0,0 vector * Update technic/machines/HV/quarry.lua Co-authored-by: OgelGames <olliverdc28@gmail.com> * Adding enable_quarry_dig_particles to README * Renaming enable_quarry_dig_particles to quarry_dig_particles * Reorganising quarry_dig_particles position in config list * Missing comma Co-authored-by: OgelGames <olliverdc28@gmail.com> Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>
77 lines
2.4 KiB
Lua
77 lines
2.4 KiB
Lua
local config_file = minetest.get_worldpath() .. "/technic.conf"
|
|
|
|
local defaults = {
|
|
-- Power tools enabled
|
|
enable_cans = "true",
|
|
enable_chainsaw = "true",
|
|
enable_flashlight = "false",
|
|
enable_mining_drill = "true",
|
|
enable_mining_laser = "false",
|
|
enable_multimeter = "true",
|
|
enable_prospector = "true",
|
|
enable_sonic_screwdriver = "true",
|
|
enable_tree_tap = "true",
|
|
enable_vacuum = "true",
|
|
enable_wrench_crafting = "false",
|
|
|
|
-- Power tool options
|
|
multimeter_remote_start_ttl = "300",
|
|
|
|
-- Machine options
|
|
enable_wind_mill = "false",
|
|
enable_frames = "false",
|
|
enable_nuclear_reactor_digiline_selfdestruct = "false",
|
|
quarry_dig_above_nodes = "3",
|
|
quarry_max_depth = "100",
|
|
quarry_time_limit = "5000",
|
|
quarry_dig_particles = "false",
|
|
|
|
-- Power network and general options
|
|
switch_off_delay_seconds = "1800",
|
|
network_overload_reset_time = "20",
|
|
admin_priv = "basic_privs",
|
|
enable_corium_griefing = "true",
|
|
enable_radiation_protection = "true",
|
|
enable_radiation_throttling = "false",
|
|
enable_entity_radiation_damage = "true",
|
|
enable_longterm_radiation_damage = "true",
|
|
max_lag_reduction_multiplier = "0.99",
|
|
--constant_digit_count = nil,
|
|
}
|
|
|
|
--
|
|
-- Create technic.config settings object and
|
|
-- initialize configuration with default values.
|
|
--
|
|
|
|
local config_obj = Settings(config_file)
|
|
|
|
technic.config = {}
|
|
|
|
function technic.config:get_int(key)
|
|
local value = tonumber(self:get(key))
|
|
if not value then
|
|
error("Invalid configuration value for key " .. key .. " in " .. config_file .. ". Number expected.")
|
|
end
|
|
return value
|
|
end
|
|
|
|
function technic.config:get(...) return config_obj:get(...) end
|
|
function technic.config:get_bool(...) return config_obj:get_bool(...) end
|
|
function technic.config:get_np_group(...) return config_obj:get_np_group(...) end
|
|
function technic.config:get_flags(...) return config_obj:get_flags(...) end
|
|
function technic.config:set(...) return config_obj:set(...) end
|
|
function technic.config:set_bool(...) return config_obj:set_bool(...) end
|
|
function technic.config:set_np_group(...) return config_obj:set_np_group(...) end
|
|
function technic.config:remove(...) return config_obj:remove(...) end
|
|
function technic.config:get_names(...) return config_obj:get_names(...) end
|
|
function technic.config:write(...) return config_obj:write(...) end
|
|
function technic.config:to_table(...) return config_obj:to_table(...) end
|
|
|
|
local conf_table = technic.config:to_table()
|
|
for k, v in pairs(defaults) do
|
|
if conf_table[k] == nil then
|
|
technic.config:set(k, v)
|
|
end
|
|
end
|