Changing Build Distance from on_init
Posted: Thu Apr 27, 2017 1:11 am
I'm trying to help with some updates to the Long Reach mod, to make it use the new mod settings interface in the options screen. I've got the settings displaying, but I can't figure out how to affect the actual build distance or reach distance once outside the data-final-fixes stage.
Is there a way to affect these values during game create/load?
For clarity, the values being changed in data-final-fixes.lua are:
And my settings are set up as such:
Is there a way to affect these values during game create/load?
For clarity, the values being changed in data-final-fixes.lua are:
Code: Select all
data.raw.player.player.build_distance = 125
data.raw.player.player.reach_distance = 125
Code: Select all
data:extend({
{
type = "int-setting",
name = "long-reach-build-distance",
setting_type = "runtime-global",
default_value = 125,
maximum_value = 10000,
minimum_value = 1,
per_user = false,
},
{
type = "int-setting",
name = "long-reach-reach-distance",
setting_type = "runtime-global",
default_value = 125,
maximum_value = 10000,
minimum_value = 1,
per_user = false,
},
})