Ver 0.2.0

- Added regrowth time configuration for all supported entities.
This commit is contained in:
secXsQuared 2018-02-01 01:04:37 -05:00
parent fd8a256870
commit dfa3e57bc9
4 changed files with 151 additions and 144 deletions

View File

@ -1,6 +1,6 @@
name = "World Regrowth++"
version = "0.1.5"
description = "Version "..version.."\n\nAdvanced world regrowth including caves! Please see the Steam Workshop page for the update notes.\n\nHappy hunting and do starve!"
version = "0.2.0"
description = "Version "..version.."\nPlease reset the mod configuration after updating from 0.1.X to 0.2.0 and above\n\nWorld regrowth with caves support. Please see the Steam Workshop page for changes notes.\n\nHappy hunting and do starve!"
author = "lolo"
forumthread = ""
@ -24,95 +24,95 @@ local REGROWTH_TYPE =
-- I can't reference this from another file... duplicate
local config_table =
{
{"evergreen","Evergreen", REGROWTH_TYPE.NATURAL, 251},
{"deciduoustree","Birchnut Tree",REGROWTH_TYPE.NATURAL, 251},
{"marsh_tree","Spiky Tree",REGROWTH_TYPE.NATURAL, 480},
{"twiggytree","Twiggy Tree",REGROWTH_TYPE.NATURAL, 491},
{"marbletree","Marble Tree",REGROWTH_TYPE.EVENT, 960},
{"livingtree","Totally Normal Tree",REGROWTH_TYPE.EVENT, 969},
{"mushtree_tall","Blue Mushtree", REGROWTH_TYPE.NATURAL, 251},
{"mushtree_medium","Red Mushtree",REGROWTH_TYPE.NATURAL, 229},
{"mushtree_small","Green Mushtree", REGROWTH_TYPE.NATURAL, 240},
{"evergreen","Evergreen", REGROWTH_TYPE.NATURAL, 1},
{"deciduoustree","Birchnut Tree",REGROWTH_TYPE.NATURAL, 1},
{"marsh_tree","Spiky Tree",REGROWTH_TYPE.NATURAL, 2},
{"twiggytree","Twiggy Tree",REGROWTH_TYPE.NATURAL, 2},
{"marbletree","Marble Tree",REGROWTH_TYPE.EVENT, 4},
{"livingtree","Totally Normal Tree",REGROWTH_TYPE.EVENT, 4},
{"mushtree_tall","Blue Mushtree", REGROWTH_TYPE.NATURAL, 1},
{"mushtree_medium","Red Mushtree",REGROWTH_TYPE.NATURAL, 1},
{"mushtree_small","Green Mushtree", REGROWTH_TYPE.NATURAL, 1},
{"berrybush","Berry Bush",REGROWTH_TYPE.NATURAL, 1451},
{"berrybush2","Spiky Berry Bush",REGROWTH_TYPE.NATURAL, 1429},
{"berrybush_juicy","Juicy Berry Bush",REGROWTH_TYPE.NATURAL, 1429},
{"berrybush","Berry Bush",REGROWTH_TYPE.NATURAL, 6},
{"berrybush2","Spiky Berry Bush",REGROWTH_TYPE.NATURAL, 6},
{"berrybush_juicy","Juicy Berry Bush",REGROWTH_TYPE.NATURAL, 6},
{"carrot_planted","Carrot",REGROWTH_TYPE.NATURAL, 240},
{"flower","Flower",REGROWTH_TYPE.NATURAL, 229},
{"flower_evil","Evil Flower",REGROWTH_TYPE.EVENT, 480},
{"flower_cave","Light Flower",REGROWTH_TYPE.EVENT, 480},
{"flower_cave_double","Double Light Flower",REGROWTH_TYPE.EVENT, 489},
{"flower_cave_triple","Triple Light Flower",REGROWTH_TYPE.EVENT, 471},
{"blue_mushroom","Blue Mushroom",REGROWTH_TYPE.NATURAL, 249},
{"red_mushroom","Red Mushroom",REGROWTH_TYPE.NATURAL, 240},
{"green_mushroom","Green Mushroom",REGROWTH_TYPE.NATURAL, 240},
{"cactus","Cactus",REGROWTH_TYPE.NATURAL, 479},
{"mandrake_planted","Mandrake",REGROWTH_TYPE.EVENT, 969},
{"carrot_planted","Carrot",REGROWTH_TYPE.NATURAL, 1},
{"flower","Flower",REGROWTH_TYPE.NATURAL, 1},
{"flower_evil","Evil Flower",REGROWTH_TYPE.EVENT, 2},
{"flower_cave","Light Flower",REGROWTH_TYPE.EVENT, 2},
{"flower_cave_double","Double Light Flower",REGROWTH_TYPE.EVENT, 2},
{"flower_cave_triple","Triple Light Flower",REGROWTH_TYPE.EVENT, 2},
{"blue_mushroom","Blue Mushroom",REGROWTH_TYPE.NATURAL, 1},
{"red_mushroom","Red Mushroom",REGROWTH_TYPE.NATURAL, 1},
{"green_mushroom","Green Mushroom",REGROWTH_TYPE.NATURAL, 1},
{"cactus","Cactus",REGROWTH_TYPE.NATURAL, 2},
{"mandrake_planted","Mandrake",REGROWTH_TYPE.EVENT, 6},
{"reeds","Reeds",REGROWTH_TYPE.NATURAL, 480},
{"sapling","Sapling",REGROWTH_TYPE.NATURAL, 240},
{"grass","Grass",REGROWTH_TYPE.NATURAL, 229},
{"marsh_bush","Spiky Bush",REGROWTH_TYPE.NATURAL, 480},
{"reeds","Reeds",REGROWTH_TYPE.NATURAL, 2},
{"sapling","Sapling",REGROWTH_TYPE.NATURAL, 1},
{"grass","Grass",REGROWTH_TYPE.NATURAL, 1},
{"marsh_bush","Spiky Bush",REGROWTH_TYPE.NATURAL, 2},
{"rock1","Boulder",REGROWTH_TYPE.NATURAL, 229},
{"rock2","Gold Vein",REGROWTH_TYPE.NATURAL, 240},
{"rock_flintless","Flintless Boulder",REGROWTH_TYPE.NATURAL, 251},
{"rock_moon","Moon Rock",REGROWTH_TYPE.NATURAL, 480},
{"rock1","Boulder",REGROWTH_TYPE.NATURAL, 1},
{"rock2","Gold Vein",REGROWTH_TYPE.NATURAL, 1},
{"rock_flintless","Flintless Boulder",REGROWTH_TYPE.NATURAL, 1},
{"rock_moon","Moon Rock",REGROWTH_TYPE.NATURAL, 2},
{"stalagmite","Stalagmite",REGROWTH_TYPE.NATURAL, 229},
{"stalagmite_tall","Tall Stalagmite",REGROWTH_TYPE.NATURAL, 240},
{"stalagmite","Stalagmite",REGROWTH_TYPE.NATURAL, 1},
{"stalagmite_tall","Tall Stalagmite",REGROWTH_TYPE.NATURAL, 1},
{"beehive","Beehive",REGROWTH_TYPE.EVENT, 489},
{"wasphive","Killer Bee Hive",REGROWTH_TYPE.EVENT, 969},
{"houndmound","Hound Mound",REGROWTH_TYPE.EVENT, 1449},
{"pighouse","Pig House",REGROWTH_TYPE.EVENT, 960},
{"mermhouse","Rundown House",REGROWTH_TYPE.EVENT, 1429},
{"spiderden","Spider Den",REGROWTH_TYPE.EVENT, 1431},
{"catcoonden","Hollow Stump",REGROWTH_TYPE.EVENT, 951},
{"rabbithouse","Rabbit Hutch",REGROWTH_TYPE.EVENT, 951},
{"monkeypods","Splumonkey Pod",REGROWTH_TYPE.EVENT, 951},
{"slurtlehole", "Slurtle Mound", REGROWTH_TYPE.EVENT, 951},
{"tallbirdnest", "Tallbird Nest", REGROWTH_TYPE.EVENT, 960},
{"beehive","Beehive",REGROWTH_TYPE.EVENT, 2},
{"wasphive","Killer Bee Hive",REGROWTH_TYPE.EVENT, 4},
{"houndmound","Hound Mound",REGROWTH_TYPE.EVENT, 6},
{"pighouse","Pig House",REGROWTH_TYPE.EVENT, 4},
{"mermhouse","Rundown House",REGROWTH_TYPE.EVENT, 6},
{"spiderden","Spider Den",REGROWTH_TYPE.EVENT, 6},
{"catcoonden","Hollow Stump",REGROWTH_TYPE.EVENT, 4},
{"rabbithouse","Rabbit Hutch",REGROWTH_TYPE.EVENT, 4},
{"monkeypods","Splumonkey Pod",REGROWTH_TYPE.EVENT, 4},
{"slurtlehole", "Slurtle Mound", REGROWTH_TYPE.EVENT, 4},
{"tallbirdnest", "Tallbird Nest", REGROWTH_TYPE.EVENT, 4},
{"fireflies","Fireflies",REGROWTH_TYPE.EVENT, 471},
{"tentacle","Tentacle",REGROWTH_TYPE.EVENT, 489},
{"knight","Clockwork Knight",REGROWTH_TYPE.EVENT, 1440},
{"bishop","Clockwork Bishop",REGROWTH_TYPE.EVENT, 1431},
{"rook","Clockwork Rook",REGROWTH_TYPE.EVENT, 1449},
{"knight_nightmare","Damaged Knight",REGROWTH_TYPE.EVENT, 1449},
{"bishop_nightmare","Damaged Bishop",REGROWTH_TYPE.EVENT, 1440},
{"rook_nightmare","Damaged Rook",REGROWTH_TYPE.EVENT, 1440},
{"fireflies","Fireflies",REGROWTH_TYPE.EVENT, 2},
{"tentacle","Tentacle",REGROWTH_TYPE.EVENT, 2},
{"knight","Clockwork Knight",REGROWTH_TYPE.EVENT, 6},
{"bishop","Clockwork Bishop",REGROWTH_TYPE.EVENT, 6},
{"rook","Clockwork Rook",REGROWTH_TYPE.EVENT, 6},
{"knight_nightmare","Damaged Knight",REGROWTH_TYPE.EVENT, 6},
{"bishop_nightmare","Damaged Bishop",REGROWTH_TYPE.EVENT, 6},
{"rook_nightmare","Damaged Rook",REGROWTH_TYPE.EVENT, 6},
{"ruins_statue_mage","Ancient Mage Statue",REGROWTH_TYPE.EVENT, 969},
{"ruins_statue_mage_nogem","Gemless Ancient Mage Statue",REGROWTH_TYPE.EVENT, 969},
{"ruins_statue_head","Ancient Head Statue",REGROWTH_TYPE.EVENT, 960},
{"ruins_statue_head_nogem", "Gemless Ancient Head Statue", REGROWTH_TYPE.EVENT, 951}
{"ruins_statue_mage","Ancient Mage Statue",REGROWTH_TYPE.EVENT, 4},
{"ruins_statue_mage_nogem","Gemless Ancient Mage Statue",REGROWTH_TYPE.EVENT, 4},
{"ruins_statue_head","Ancient Head Statue",REGROWTH_TYPE.EVENT, 4},
{"ruins_statue_head_nogem", "Gemless Ancient Head Statue", REGROWTH_TYPE.EVENT, 4}
}
local config_options = {}
for i = 1, #config_table do
local opt = {}
for j = 0,20 do
opt[#opt+1] =
{
description = (j == 0) and "Disabled" or (j * 0.5 .. ((j == 2) and " day" or " days")),
data = j
}
end
local entry =
{
name = config_table[i][1],
label = config_table[i][2],
hover = config_table[i][3] == REGROWTH_TYPE.EVENT and "Event-based" or "Natural",
options =
{
{
description = "Disabled",
data = false
},
{
description = "Enabled",
data = true
}
},
default = true
options = opt,
default = config_table[i][4]
}
config_options[#config_options+1] = entry
config_options[i] = entry
end
configuration_options = config_options

View File

@ -6,76 +6,79 @@ local REGROWTH_TYPE =
local DEBUG = false
-- Configuration Generation
-- I can't reference this from another file... duplicate
-- Configuration Generation
-- I can't reference this from another file... duplicate
local config_table =
{
{"evergreen","Evergreen", REGROWTH_TYPE.NATURAL, 251},
{"deciduoustree","Birchnut Tree",REGROWTH_TYPE.NATURAL, 251},
{"marsh_tree","Spiky Tree",REGROWTH_TYPE.NATURAL, 480},
{"twiggytree","Twiggy Tree",REGROWTH_TYPE.NATURAL, 491},
{"marbletree","Marble Tree",REGROWTH_TYPE.EVENT, 960},
{"livingtree","Totally Normal Tree",REGROWTH_TYPE.EVENT, 969},
{"mushtree_tall","Blue Mushtree", REGROWTH_TYPE.NATURAL, 251},
{"mushtree_medium","Red Mushtree",REGROWTH_TYPE.NATURAL, 229},
{"mushtree_small","Green Mushtree", REGROWTH_TYPE.NATURAL, 240},
{"evergreen","Evergreen", REGROWTH_TYPE.NATURAL, 1},
{"deciduoustree","Birchnut Tree",REGROWTH_TYPE.NATURAL, 1},
{"marsh_tree","Spiky Tree",REGROWTH_TYPE.NATURAL, 2},
{"twiggytree","Twiggy Tree",REGROWTH_TYPE.NATURAL, 2},
{"marbletree","Marble Tree",REGROWTH_TYPE.EVENT, 4},
{"livingtree","Totally Normal Tree",REGROWTH_TYPE.EVENT, 4},
{"mushtree_tall","Blue Mushtree", REGROWTH_TYPE.NATURAL, 1},
{"mushtree_medium","Red Mushtree",REGROWTH_TYPE.NATURAL, 1},
{"mushtree_small","Green Mushtree", REGROWTH_TYPE.NATURAL, 1},
{"berrybush","Berry Bush",REGROWTH_TYPE.NATURAL, 1451},
{"berrybush2","Spiky Berry Bush",REGROWTH_TYPE.NATURAL, 1429},
{"berrybush_juicy","Juicy Berry Bush",REGROWTH_TYPE.NATURAL, 1429},
{"berrybush","Berry Bush",REGROWTH_TYPE.NATURAL, 6},
{"berrybush2","Spiky Berry Bush",REGROWTH_TYPE.NATURAL, 6},
{"berrybush_juicy","Juicy Berry Bush",REGROWTH_TYPE.NATURAL, 6},
{"carrot_planted","Carrot",REGROWTH_TYPE.NATURAL, 240},
{"flower","Flower",REGROWTH_TYPE.NATURAL, 229},
{"flower_evil","Evil Flower",REGROWTH_TYPE.EVENT, 480},
{"flower_cave","Light Flower",REGROWTH_TYPE.EVENT, 480},
{"flower_cave_double","Double Light Flower",REGROWTH_TYPE.EVENT, 489},
{"flower_cave_triple","Triple Light Flower",REGROWTH_TYPE.EVENT, 471},
{"blue_mushroom","Blue Mushroom",REGROWTH_TYPE.NATURAL, 249},
{"red_mushroom","Red Mushroom",REGROWTH_TYPE.NATURAL, 240},
{"green_mushroom","Green Mushroom",REGROWTH_TYPE.NATURAL, 240},
{"cactus","Cactus",REGROWTH_TYPE.NATURAL, 479},
{"mandrake_planted","Mandrake",REGROWTH_TYPE.EVENT, 969},
{"carrot_planted","Carrot",REGROWTH_TYPE.NATURAL, 1},
{"flower","Flower",REGROWTH_TYPE.NATURAL, 1},
{"flower_evil","Evil Flower",REGROWTH_TYPE.EVENT, 2},
{"flower_cave","Light Flower",REGROWTH_TYPE.EVENT, 2},
{"flower_cave_double","Double Light Flower",REGROWTH_TYPE.EVENT, 2},
{"flower_cave_triple","Triple Light Flower",REGROWTH_TYPE.EVENT, 2},
{"blue_mushroom","Blue Mushroom",REGROWTH_TYPE.NATURAL, 1},
{"red_mushroom","Red Mushroom",REGROWTH_TYPE.NATURAL, 1},
{"green_mushroom","Green Mushroom",REGROWTH_TYPE.NATURAL, 1},
{"cactus","Cactus",REGROWTH_TYPE.NATURAL, 2},
{"mandrake_planted","Mandrake",REGROWTH_TYPE.EVENT, 6},
{"reeds","Reeds",REGROWTH_TYPE.NATURAL, 480},
{"sapling","Sapling",REGROWTH_TYPE.NATURAL, 240},
{"grass","Grass",REGROWTH_TYPE.NATURAL, 229},
{"marsh_bush","Spiky Bush",REGROWTH_TYPE.NATURAL, 480},
{"reeds","Reeds",REGROWTH_TYPE.NATURAL, 2},
{"sapling","Sapling",REGROWTH_TYPE.NATURAL, 1},
{"grass","Grass",REGROWTH_TYPE.NATURAL, 1},
{"marsh_bush","Spiky Bush",REGROWTH_TYPE.NATURAL, 2},
{"rock1","Boulder",REGROWTH_TYPE.NATURAL, 229},
{"rock2","Gold Vein",REGROWTH_TYPE.NATURAL, 240},
{"rock_flintless","Flintless Boulder",REGROWTH_TYPE.NATURAL, 251},
{"rock_moon","Moon Rock",REGROWTH_TYPE.NATURAL, 480},
{"rock1","Boulder",REGROWTH_TYPE.NATURAL, 1},
{"rock2","Gold Vein",REGROWTH_TYPE.NATURAL, 1},
{"rock_flintless","Flintless Boulder",REGROWTH_TYPE.NATURAL, 1},
{"rock_moon","Moon Rock",REGROWTH_TYPE.NATURAL, 2},
{"stalagmite","Stalagmite",REGROWTH_TYPE.NATURAL, 229},
{"stalagmite_tall","Tall Stalagmite",REGROWTH_TYPE.NATURAL, 240},
{"stalagmite","Stalagmite",REGROWTH_TYPE.NATURAL, 1},
{"stalagmite_tall","Tall Stalagmite",REGROWTH_TYPE.NATURAL, 1},
{"beehive","Beehive",REGROWTH_TYPE.EVENT, 489},
{"wasphive","Killer Bee Hive",REGROWTH_TYPE.EVENT, 969},
{"houndmound","Hound Mound",REGROWTH_TYPE.EVENT, 1449},
{"pighouse","Pig House",REGROWTH_TYPE.EVENT, 960},
{"mermhouse","Rundown House",REGROWTH_TYPE.EVENT, 1429},
{"spiderden","Spider Den",REGROWTH_TYPE.EVENT, 1431},
{"catcoonden","Hollow Stump",REGROWTH_TYPE.EVENT, 951},
{"rabbithouse","Rabbit Hutch",REGROWTH_TYPE.EVENT, 951},
{"monkeypods","Splumonkey Pod",REGROWTH_TYPE.EVENT, 951},
{"slurtlehole", "Slurtle Mound", REGROWTH_TYPE.EVENT, 951},
{"tallbirdnest", "Tallbird Nest", REGROWTH_TYPE.EVENT, 960},
{"beehive","Beehive",REGROWTH_TYPE.EVENT, 2},
{"wasphive","Killer Bee Hive",REGROWTH_TYPE.EVENT, 4},
{"houndmound","Hound Mound",REGROWTH_TYPE.EVENT, 6},
{"pighouse","Pig House",REGROWTH_TYPE.EVENT, 4},
{"mermhouse","Rundown House",REGROWTH_TYPE.EVENT, 6},
{"spiderden","Spider Den",REGROWTH_TYPE.EVENT, 6},
{"catcoonden","Hollow Stump",REGROWTH_TYPE.EVENT, 4},
{"rabbithouse","Rabbit Hutch",REGROWTH_TYPE.EVENT, 4},
{"monkeypods","Splumonkey Pod",REGROWTH_TYPE.EVENT, 4},
{"slurtlehole", "Slurtle Mound", REGROWTH_TYPE.EVENT, 4},
{"tallbirdnest", "Tallbird Nest", REGROWTH_TYPE.EVENT, 4},
{"fireflies","Fireflies",REGROWTH_TYPE.EVENT, 471},
{"tentacle","Tentacle",REGROWTH_TYPE.EVENT, 489},
{"knight","Clockwork Knight",REGROWTH_TYPE.EVENT, 1440},
{"bishop","Clockwork Bishop",REGROWTH_TYPE.EVENT, 1431},
{"rook","Clockwork Rook",REGROWTH_TYPE.EVENT, 1449},
{"knight_nightmare","Damaged Knight",REGROWTH_TYPE.EVENT, 1449},
{"bishop_nightmare","Damaged Bishop",REGROWTH_TYPE.EVENT, 1440},
{"rook_nightmare","Damaged Rook",REGROWTH_TYPE.EVENT, 1440},
{"fireflies","Fireflies",REGROWTH_TYPE.EVENT, 2},
{"tentacle","Tentacle",REGROWTH_TYPE.EVENT, 2},
{"knight","Clockwork Knight",REGROWTH_TYPE.EVENT, 6},
{"bishop","Clockwork Bishop",REGROWTH_TYPE.EVENT, 6},
{"rook","Clockwork Rook",REGROWTH_TYPE.EVENT, 6},
{"knight_nightmare","Damaged Knight",REGROWTH_TYPE.EVENT, 6},
{"bishop_nightmare","Damaged Bishop",REGROWTH_TYPE.EVENT, 6},
{"rook_nightmare","Damaged Rook",REGROWTH_TYPE.EVENT, 6},
{"ruins_statue_mage","Ancient Mage Statue",REGROWTH_TYPE.EVENT, 969},
{"ruins_statue_mage_nogem","Gemless Ancient Mage Statue",REGROWTH_TYPE.EVENT, 969},
{"ruins_statue_head","Ancient Head Statue",REGROWTH_TYPE.EVENT, 960},
{"ruins_statue_head_nogem", "Gemless Ancient Head Statue", REGROWTH_TYPE.EVENT, 951}
{"ruins_statue_mage","Ancient Mage Statue",REGROWTH_TYPE.EVENT, 4},
{"ruins_statue_mage_nogem","Gemless Ancient Mage Statue",REGROWTH_TYPE.EVENT, 4},
{"ruins_statue_head","Ancient Head Statue",REGROWTH_TYPE.EVENT, 4},
{"ruins_statue_head_nogem", "Gemless Ancient Head Statue", REGROWTH_TYPE.EVENT, 4}
}
if GLOBAL.STRINGS.NAMES.MIGRATION_PORTAL then
-- we have caves
AddPrefabPostInit("forest", function(inst)
@ -102,13 +105,12 @@ end
AddComponentPostInit("natural_regrowth", function(component)
for i = 1, #config_table do
local entry = config_table[i]
if entry[3] == REGROWTH_TYPE.NATURAL then
local prefab = entry[1]
local delay = entry[4]
if GetModConfigData(prefab) then
component:RegisterRegrowth(prefab, prefab, DEBUG and (delay / 100) or delay)
end
local entry = config_table[i]
local prefab = entry[1]
if (entry[3] == REGROWTH_TYPE.NATURAL) and (GetModConfigData(prefab) ~= 0) then
-- i % 3 - 1 = round robbin -1,0,1
local delay = GetModConfigData(prefab) * 240 + ((i % 3) - 1) * component:GetUpdatePeriod()
component:RegisterRegrowth(prefab, prefab, DEBUG and (delay / 100) or delay)
end
end
component:FinishModConfig()
@ -116,13 +118,12 @@ end)
AddComponentPostInit("event_regrowth", function(component)
for i = 1, #config_table do
local entry = config_table[i]
if entry[3] == REGROWTH_TYPE.EVENT then
local prefab = entry[1]
local delay = entry[4]
if GetModConfigData(prefab) then
component:RegisterRegrowth(prefab, prefab, DEBUG and (delay / 100) or delay)
end
local entry = config_table[i]
local prefab = entry[1]
if (entry[3] == REGROWTH_TYPE.EVENT) and (GetModConfigData(prefab) ~= 0) then
-- i % 3 - 1 = round robbin -1,0,1
local delay = GetModConfigData(prefab) * 240 + ((i % 3) - 1) * component:GetUpdatePeriod()
component:RegisterRegrowth(prefab, prefab, DEBUG and (delay / 100) or delay)
end
end
component:FinishModConfig()

View File

@ -17,7 +17,6 @@ return Class(function(self, inst)
--------------------------------------------------------------------------
local DEBUG = false
local DEBUG_TELE = false
local UPDATE_PERIOD = 9
local BASE_RADIUS = 20
local EXCLUDE_RADIUS = 2
@ -204,6 +203,10 @@ return Class(function(self, inst)
--------------------------------------------------------------------------
--[[ Public member functions ]]
--------------------------------------------------------------------------
function self:GetUpdatePeriod()
return UPDATE_PERIOD
end
function self:FinishModConfig()
regrowth_table_populated_by_mod = true
end
@ -229,7 +232,7 @@ return Class(function(self, inst)
end
if DEBUG then
print("[EventRegrowth] Registered ", product ," for ", prefab)
print("[EventRegrowth] Registered ", product ," for ", prefab, " with interval ", interval)
end
end

View File

@ -143,6 +143,9 @@ return Class(function(self, inst)
--------------------------------------------------------------------------
--[[ Public member functions ]]
--------------------------------------------------------------------------
function self:GetUpdatePeriod()
return UPDATE_PERIOD
end
function self:FinishModConfig()
regrowth_table_populated_by_mod = true
@ -158,7 +161,7 @@ return Class(function(self, inst)
end
if DEBUG then
print("[NaturalRegrowth] Registered ", product, " for prefab " ,prefab )
print("[NaturalRegrowth] Registered ", product, " for prefab " ,prefab, " with interval ", interval)
end
regrowth_table[prefab] = {product = product, interval = interval}