reading new csv config
parent
c7c1aae3a0
commit
e6cb9548b9
38
crops.csv
38
crops.csv
|
@ -1,11 +1,27 @@
|
||||||
#name,enabled,next_plant,rarety,steps,harvest_max,eat_hp,to_culture,has_harvest,on_soil,punchable,infectable,snappy,temperature_min,temperature_max,humidity_min,humidity_max,elevation_min,elevation_max,light_min,light_max,infect_rate_base,infect_rate_monoculture,spread_rate
|
#name,enabled,next_plant,rarety,steps,harvest_max,eat_hp,to_culture,to_dig,has_harvest,on_soil,punchable,infectable,seed_extractable,snappy,temperature_min,temperature_max,humidity_min,humidity_max,elevation_min,elevation_max,light_min,light_max,infect_rate_base,infect_rate_monoculture,spread_rate
|
||||||
default,1,,10,8,2,1,,1,1,,1,3,15,50,10,50,0,100,11,14,1e-5,1e-3,1e-3
|
default,1,,10,8,2,1,,,,,,,,3,15,50,10,50,0,31000,11,14,1E-05,0.001,0.001
|
||||||
barley,1,,10,7,2,1,,1,1,,1,3,15,50,10,50,0,100,11,14,1e-5,1e-3,1e-3
|
barley,1,,10,7,2,1,,,1,1,,1,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001
|
||||||
coffee,1,,20,5,2,1,,,,1,,3,25,50,10,50,50,1000,11,14,1e-5,1e-3,1e-3
|
beetroot,1,,10,5,2,2,,1,,1,,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001
|
||||||
cocoa,1,,20,5,2,1,,,,1,,3,25,50,10,50,50,1000,11,14,1e-5,1e-3,1e-3
|
blackberry,1,,10,4,2,1,,,,,1,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001
|
||||||
corn,1,,10,8,2,1,,,1,,1,3,15,50,10,50,0,100,11,14,1e-5,1e-3,1e-3
|
blueberry,1,,10,4,2,1,,,,,1,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001
|
||||||
culturewheat,1,,100,4,2,,11,1,1,,1,3,15,50,10,50,0,100,11,14,1e-5,1e-3,1e-3
|
carrot,1,,10,8,2,2,,1,,1,,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001
|
||||||
mustard,1,,10,5,2,1,,1,1,,1,3,15,50,10,50,0,100,11,14,1e-5,1e-3,1e-3
|
chili,1,,20,8,2,1,,,,,1,,,3,25,50,10,50,50,1000,11,14,1E-05,0.001,0.001
|
||||||
potato,1,,10,4,2,1,,,1,,1,3,15,50,10,50,0,100,11,14,1e-5,1e-3,1e-3
|
coffee,1,,20,5,2,1,,,,,1,,,3,25,50,10,50,50,1000,11,14,1E-05,0.001,0.001
|
||||||
spelt,1,,10,7,2,1,,1,1,,1,3,15,50,10,50,0,100,11,14,1e-5,1e-3,1e-3
|
cocoa,1,,20,5,2,1,,,,,1,,,3,25,50,10,50,50,1000,11,14,1E-05,0.001,0.001
|
||||||
wheat,1,culturewheat,10,8,2,1,,1,1,,1,3,15,50,10,50,0,100,11,14,1e-5,1e-3,1e-3
|
corn,1,,10,8,2,2,,,,1,,1,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001
|
||||||
|
cotton,1,,10,8,2,2,,,1,1,,1,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001
|
||||||
|
culturewheat,1,,100,4,2,1,1,,1,1,,1,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001
|
||||||
|
garlic,1,,10,5,2,2,,1,,1,,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001
|
||||||
|
hemp,,,10,8,2,2,,,1,1,,1,,3,,50,10,50,0,100,11,14,1E-05,0.001,0.001
|
||||||
|
hop,1,,10,7,2,1,,,1,1,1,1,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001
|
||||||
|
mustard,1,,10,5,2,1,,,1,,,1,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001
|
||||||
|
potato,1,,10,4,2,2,,,,1,,1,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001
|
||||||
|
raspberry,1,,10,4,2,1,,,,,1,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001
|
||||||
|
rhubarb,1,,10,3,2,2,,1,,1,,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001
|
||||||
|
spelt,1,,10,7,2,1,,,1,1,,1,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001
|
||||||
|
strawberry,1,,10,4,2,1,,,,,1,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001
|
||||||
|
tea,1,,20,5,2,1,,,,,1,,1,3,25,50,10,50,50,,11,14,1E-05,0.001,0.001
|
||||||
|
tobaco,,,10,8,2,2,,,,1,,1,1,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001
|
||||||
|
tomato,1,,10,8,2,1,,,1,1,1,1,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001
|
||||||
|
urtica,,,10,8,2,1,,,1,,,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.01
|
||||||
|
wheat,1,culturewheat,10,8,2,1,,,1,1,,1,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001
|
||||||
|
|
|
60
crops.lua
60
crops.lua
|
@ -7,11 +7,10 @@ local crop_definition = {}
|
||||||
local file = io.open(farming.path .. "/crops.csv", "r")
|
local file = io.open(farming.path .. "/crops.csv", "r")
|
||||||
for line in file:lines() do
|
for line in file:lines() do
|
||||||
local attribs = line:split(",", true)
|
local attribs = line:split(",", true)
|
||||||
local name,enabled,next_plant,rarety,steps,harvest_max,eat_hp,to_culture,has_harvest,on_soil,punchable,infectable,snappy,
|
local name,enabled,next_plant,rarety,steps,harvest_max,eat_hp,to_culture,has_harvest,on_soil,punchable,infectable,
|
||||||
temperature_min,temperature_max,humidity_min,humidity_max,elevation_min,elevation_max,infect_rate_base,
|
seed_extractable,snappy,temperature_min,temperature_max,humidity_min,humidity_max,elevation_min,elevation_max,
|
||||||
infect_rate_monoculture,spread_rate = unpack(attribs)
|
infect_rate_base,infect_rate_monoculture,spread_rate = unpack(attribs)
|
||||||
if #name > 0 and name:sub(1,1) ~= "#" and #enabled > 0 and #steps > 0 then
|
if #name > 0 and name:sub(1,1) ~= "#" and #enabled > 0 and #steps > 0 then
|
||||||
print(dump(attribs))
|
|
||||||
biom_def={min_temp=tonumber(temperature_min) or 0,
|
biom_def={min_temp=tonumber(temperature_min) or 0,
|
||||||
max_temp=tonumber(temperature_max) or 100,
|
max_temp=tonumber(temperature_max) or 100,
|
||||||
min_humidity=tonumber(humidity_min) or 0,
|
min_humidity=tonumber(humidity_min) or 0,
|
||||||
|
@ -19,25 +18,22 @@ for line in file:lines() do
|
||||||
spawnon={spawn_min=tonumber(elevation_min) or 0,
|
spawnon={spawn_min=tonumber(elevation_min) or 0,
|
||||||
spawn_max=tonumber(elevation_max)} or 31000,
|
spawn_max=tonumber(elevation_max)} or 31000,
|
||||||
}
|
}
|
||||||
print(dump(biom_def))
|
|
||||||
local crop_biom=farming.get_biomes(biom_def)
|
|
||||||
print(dump(crop_biom))
|
|
||||||
crop_definition[name]={
|
crop_definition[name]={
|
||||||
paramtype2 = "meshoptions",
|
paramtype2 = "meshoptions",
|
||||||
fertility = {"grassland"},
|
fertility = {"grassland"},
|
||||||
place_param2 = 3,
|
place_param2 = 3,
|
||||||
groups = {farming=1},
|
groups = {farming=1},
|
||||||
steps = tonumber(steps),
|
steps = tonumber(steps),
|
||||||
grow_time_mean=tonumber(grow_time_mean) or 100,
|
grow_time_mean=tonumber(grow_time_mean),
|
||||||
harvest_max=tonumber(harvest_max) or 2,
|
harvest_max=tonumber(harvest_max),
|
||||||
light_min=tonumber(light_min) or 13,
|
light_min=tonumber(light_min),
|
||||||
light_max=tonumber(light_max) or default.LIGHT_MAX,
|
light_max=tonumber(light_max) or default.LIGHT_MAX,
|
||||||
temperature_min=tonumber(temperature_min) or 0,
|
temperature_min=tonumber(temperature_min),
|
||||||
temperature_max=tonumber(temperature_max) or 100,
|
temperature_max=tonumber(temperature_max),
|
||||||
humidity_min=tonumber(humidity_min) or 0,
|
humidity_min=tonumber(humidity_min),
|
||||||
humidity_max=tonumber(humidity_max) or 100,
|
humidity_max=tonumber(humidity_max),
|
||||||
elevation_min=tonumber(elevation_min) or 0,
|
elevation_min=tonumber(elevation_min),
|
||||||
elevation_max=tonumber(elevation_max) or 31000,
|
elevation_max=tonumber(elevation_max),
|
||||||
description=S(name),
|
description=S(name),
|
||||||
eat_hp=tonumber(eat_hp),
|
eat_hp=tonumber(eat_hp),
|
||||||
next_plant=next_plant,
|
next_plant=next_plant,
|
||||||
|
@ -68,6 +64,36 @@ for line in file:lines() do
|
||||||
if #infectable > 0 then
|
if #infectable > 0 then
|
||||||
crop_definition[name].groups["infectable"]=tonumber(infectable)
|
crop_definition[name].groups["infectable"]=tonumber(infectable)
|
||||||
end
|
end
|
||||||
|
if #seed_extractable > 0 then
|
||||||
|
crop_definition[name].groups["seed_extractable"]=tonumber(seed_extractable)
|
||||||
|
end
|
||||||
|
if #snappy > 0 then
|
||||||
|
crop_definition[name].groups["snappy"]=tonumber(snappy)
|
||||||
|
else
|
||||||
|
crop_definition[name].groups["snappy"]=3
|
||||||
|
end
|
||||||
end
|
end
|
||||||
print(dump(crop_definition))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if crop_definition["default"]~=nil then
|
||||||
|
local default_def = crop_definition["default"]
|
||||||
|
print(#crop_definition)
|
||||||
|
print(dump(default_def))
|
||||||
|
for i,tdef in ipairs(crop_definition) do
|
||||||
|
print(dump(tdef))
|
||||||
|
if tdef.name ~= "default" then
|
||||||
|
local tdef_name = tdef.name
|
||||||
|
for _,colu in ipairs({"rarety","harvest_max","temperature_min","temperature_max",
|
||||||
|
"humidity_min","humidity_max","elevation_min","elevation_max",
|
||||||
|
"infect_rate_base","infect_rate_monoculture","spread_rate"}) do
|
||||||
|
print(colu)
|
||||||
|
if crop_definition[tdef_name][colu] == nil then
|
||||||
|
print(colu)
|
||||||
|
print(default_def[colu])
|
||||||
|
crop_definition[tdef_name][colu] = default_def[colu]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- print(dump(crop_definition))
|
||||||
|
|
12
locale/de.po
12
locale/de.po
|
@ -86,3 +86,15 @@ msgstr "Tomate"
|
||||||
|
|
||||||
msgid "Hops"
|
msgid "Hops"
|
||||||
msgstr "Hopfen"
|
msgstr "Hopfen"
|
||||||
|
|
||||||
|
msgid "Urtica"
|
||||||
|
msgstr "Brennnessel"
|
||||||
|
|
||||||
|
msgid "Hemp"
|
||||||
|
msgstr "Hanf"
|
||||||
|
|
||||||
|
msgid "Tobaco"
|
||||||
|
msgstr "Tabak"
|
||||||
|
|
||||||
|
msgid "Tea"
|
||||||
|
msgstr "Tee"
|
||||||
|
|
Loading…
Reference in New Issue