diff --git a/Liquid_Fueled_0.1.0/data.lua b/Liquid_Fueled_0.1.0/data.lua new file mode 100644 index 0000000..1e2338b --- /dev/null +++ b/Liquid_Fueled_0.1.0/data.lua @@ -0,0 +1,7 @@ +--prototype crap +require("prototypes.entities") +require("prototypes.items") +require("prototypes.fluids") +require("prototypes.automatic_recipes") +require("prototypes.entity_overrides") +--require("prototypes.technologies") diff --git a/Liquid_Fueled_0.1.0/functions.lua b/Liquid_Fueled_0.1.0/functions.lua new file mode 100644 index 0000000..a8fd28c --- /dev/null +++ b/Liquid_Fueled_0.1.0/functions.lua @@ -0,0 +1,42 @@ + +--table of common metric prefixes +metric_suffix = { + --above 1 --name + E = 10^18, --exa + P = 10^15, --peta + T = 10^12, --tera + G = 10^9, --giga + M = 10^6, --mega + k = 10^3, --kilo + h = 10^2, --hecto + da = 10^1, --deca + --below 1 + d = 10^-1, --deci + c = 10^-2, --centi + m = 10^-3 --mili +} +function string_to_num(str) + num = "" + for i = 1, #str do + local a = str:sub(i,i) + if tonumber(a) ~= nil then + num = num .. a + elseif tonumber(a) == nil and metric_suffix[a] ~= nil then + suffix = a + end + end + if suffix ~= nil then + return tonumber(num) * metric_suffix[suffix] + else + return tonumber(num) + end +end +--print(string_to_num("5G43j")) --debug crap + +--Takes a list and recognises the existence of the elements in the list, +--allowing it to be used in statements +function Set (list) + local set = {} + for _, l in ipairs(list) do set[l] = true end + return set +end diff --git a/Liquid_Fueled_0.1.0/graphics/chemical-plant/boiling-green-patch-mask.png b/Liquid_Fueled_0.1.0/graphics/chemical-plant/boiling-green-patch-mask.png new file mode 100644 index 0000000..f755100 Binary files /dev/null and b/Liquid_Fueled_0.1.0/graphics/chemical-plant/boiling-green-patch-mask.png differ diff --git a/Liquid_Fueled_0.1.0/graphics/chemical-plant/boiling-green-patch.png b/Liquid_Fueled_0.1.0/graphics/chemical-plant/boiling-green-patch.png new file mode 100644 index 0000000..a2b58e0 Binary files /dev/null and b/Liquid_Fueled_0.1.0/graphics/chemical-plant/boiling-green-patch.png differ diff --git a/Liquid_Fueled_0.1.0/graphics/chemical-plant/boiling-window-green-patch.png b/Liquid_Fueled_0.1.0/graphics/chemical-plant/boiling-window-green-patch.png new file mode 100644 index 0000000..5da8572 Binary files /dev/null and b/Liquid_Fueled_0.1.0/graphics/chemical-plant/boiling-window-green-patch.png differ diff --git a/Liquid_Fueled_0.1.0/graphics/chemical-plant/chemical-plant-shadow.png b/Liquid_Fueled_0.1.0/graphics/chemical-plant/chemical-plant-shadow.png new file mode 100644 index 0000000..3d4ec3d Binary files /dev/null and b/Liquid_Fueled_0.1.0/graphics/chemical-plant/chemical-plant-shadow.png differ diff --git a/Liquid_Fueled_0.1.0/graphics/chemical-plant/chemical-plant.png b/Liquid_Fueled_0.1.0/graphics/chemical-plant/chemical-plant.png new file mode 100644 index 0000000..18ae0e1 Binary files /dev/null and b/Liquid_Fueled_0.1.0/graphics/chemical-plant/chemical-plant.png differ diff --git a/Liquid_Fueled_0.1.0/graphics/chemical-plant/hr-boiling-green-patch-mask.png b/Liquid_Fueled_0.1.0/graphics/chemical-plant/hr-boiling-green-patch-mask.png new file mode 100644 index 0000000..2b23c74 Binary files /dev/null and b/Liquid_Fueled_0.1.0/graphics/chemical-plant/hr-boiling-green-patch-mask.png differ diff --git a/Liquid_Fueled_0.1.0/graphics/chemical-plant/hr-boiling-green-patch.png b/Liquid_Fueled_0.1.0/graphics/chemical-plant/hr-boiling-green-patch.png new file mode 100644 index 0000000..b15f294 Binary files /dev/null and b/Liquid_Fueled_0.1.0/graphics/chemical-plant/hr-boiling-green-patch.png differ diff --git a/Liquid_Fueled_0.1.0/graphics/chemical-plant/hr-boiling-window-green-patch.png b/Liquid_Fueled_0.1.0/graphics/chemical-plant/hr-boiling-window-green-patch.png new file mode 100644 index 0000000..73073c4 Binary files /dev/null and b/Liquid_Fueled_0.1.0/graphics/chemical-plant/hr-boiling-window-green-patch.png differ diff --git a/Liquid_Fueled_0.1.0/graphics/chemical-plant/hr-chemical-plant-shadow.png b/Liquid_Fueled_0.1.0/graphics/chemical-plant/hr-chemical-plant-shadow.png new file mode 100644 index 0000000..13b93b2 Binary files /dev/null and b/Liquid_Fueled_0.1.0/graphics/chemical-plant/hr-chemical-plant-shadow.png differ diff --git a/Liquid_Fueled_0.1.0/graphics/chemical-plant/hr-chemical-plant.png b/Liquid_Fueled_0.1.0/graphics/chemical-plant/hr-chemical-plant.png new file mode 100644 index 0000000..ddb505c Binary files /dev/null and b/Liquid_Fueled_0.1.0/graphics/chemical-plant/hr-chemical-plant.png differ diff --git a/Liquid_Fueled_0.1.0/info.json b/Liquid_Fueled_0.1.0/info.json new file mode 100644 index 0000000..9ccf794 --- /dev/null +++ b/Liquid_Fueled_0.1.0/info.json @@ -0,0 +1,10 @@ +{ + "name": "Liquid_Fueled", + "version": "0.1.0", + "factorio_version": "0.17", + "title": "Liquid Fueled", + "author": "npc_strider(morley376)", + "contact": "", + "homepage": "http://steamcommunity.com/id/morley376", + "description": "Template Description" +} \ No newline at end of file diff --git a/Liquid_Fueled_0.1.0/prototypes/automatic_recipes.lua b/Liquid_Fueled_0.1.0/prototypes/automatic_recipes.lua new file mode 100644 index 0000000..5a4e2ed --- /dev/null +++ b/Liquid_Fueled_0.1.0/prototypes/automatic_recipes.lua @@ -0,0 +1,55 @@ +require("functions") + +fuel_blacklist = Set { + "fuel-gas", + "nuclear-fuel", + "rocket-fuel", + "solid-fuel" +} + +--hidden category +data:extend( +{{ + type = "recipe-category", + name = "gasification-recipes" +}}) + +for _, item in pairs(data.raw.item) do + if item.fuel_value ~= nil and item.fuel_category == "chemical" and fuel_blacklist[item.name] == nil then + local fuel_value = string_to_num(item.fuel_value) + local output_amount = math.ceil(fuel_value/10000) + local water_amount = math.ceil(fuel_value/100000) + --local energy = (output_amount^1.5)/(output_amount^1.1) + local energy = 0.25 + --[[ + Coal example: + 4MJ = 4,000,000J + 4,000,000/10,000 = 400 fuel-gas + 400*0.01MJ = 4MJ + Fuel-Gas == Coal + ]] + local recipe = { + type = "recipe", + name = "gasification-of-" .. item.name, + category = "gasification-recipes", + energy_required = energy, + enabled = true, --change this to false on release + ingredients = + { + {type="fluid", name="water", amount=water_amount}, + {type="item", name=item.name, amount=1} + }, + results= + { + {type="fluid", name="fuel-gas", amount=output_amount, temperature = 25} + }, + crafting_machine_tint = + { + primary = {r = 0.498, g = 0.498, b = 0.498, a = 0.000}, -- #7f7f7f00 + secondary = {r = 0.400, g = 0.400, b = 0.400, a = 0.000}, -- #66666600 + tertiary = {r = 0.305, g = 0.305, b = 0.305, a = 0.000}, -- #4d4d4d00 + } + } + data:extend({recipe}) + end +end \ No newline at end of file diff --git a/Liquid_Fueled_0.1.0/prototypes/entities.lua b/Liquid_Fueled_0.1.0/prototypes/entities.lua new file mode 100644 index 0000000..bbbebde --- /dev/null +++ b/Liquid_Fueled_0.1.0/prototypes/entities.lua @@ -0,0 +1,249 @@ + +mod_scale = 2/3 + +data:extend( +{ + { + type = "assembling-machine", + name = "gasification-plant", + icon = "__base__/graphics/icons/chemical-plant.png", + icon_size = 32, + flags = {"placeable-neutral","placeable-player", "player-creation"}, + minable = {hardness = 0.2, mining_time = 0.5, result = "gasification-plant"}, + max_health = 300, + corpse = "big-remnants", + dying_explosion = "medium-explosion", + collision_box = {{-0.8, -0.8}, {0.8, 0.8}}, + selection_box = {{-0.9, -0.9}, {0.9, 0.9}}, + --[[module_specification = + { + module_slots = 3 + }, + allowed_effects = {"consumption", "speed", "productivity", "pollution"},]] + + animation = make_4way_animation_from_spritesheet({ layers = + { + { + filename = "__base__/graphics/entity/chemical-plant/chemical-plant.png", + width = 122, + height = 134, + frame_count = 1, + shift = util.by_pixel(-5, -4.5), + scale = mod_scale, + hr_version = { + filename = "__base__/graphics/entity/chemical-plant/hr-chemical-plant.png", + width = 244, + height = 268, + frame_count = 1, + shift = util.by_pixel(-5, -4.5), + scale = 0.5 * mod_scale + } + }, + { + filename = "__base__/graphics/entity/chemical-plant/chemical-plant-shadow.png", + width = 175, + height = 110, + frame_count = 1, + shift = util.by_pixel(31.5, 11), + scale = mod_scale, + draw_as_shadow = true, + hr_version = { + filename = "__base__/graphics/entity/chemical-plant/hr-chemical-plant-shadow.png", + width = 350, + height = 219, + frame_count = 1, + shift = util.by_pixel(31.5, 10.75), + draw_as_shadow = true, + scale = 0.5 * mod_scale + } + }, + }}), + working_visualisations = + { + { + north_position = util.by_pixel(30, -24), + west_position = util.by_pixel(1, -49.5), + south_position = util.by_pixel(-30, -48), + east_position = util.by_pixel(-11, -1), + apply_recipe_tint = "primary", + animation = + { + filename = "__base__/graphics/entity/chemical-plant/boiling-green-patch.png", + frame_count = 32, + width = 15, + height = 10, + animation_speed = 0.5, + scale = mod_scale, + hr_version = { + filename = "__base__/graphics/entity/chemical-plant/hr-boiling-green-patch.png", + frame_count = 32, + width = 30, + height = 20, + animation_speed = 0.5, + scale = 0.5 * mod_scale + } + } + }, + { + north_position = util.by_pixel(30, -24), + west_position = util.by_pixel(1, -49.5), + south_position = util.by_pixel(-30, -48), + east_position = util.by_pixel(-11, -1), + apply_recipe_tint = "secondary", + animation = + { + filename = "__base__/graphics/entity/chemical-plant/boiling-green-patch-mask.png", + frame_count = 32, + width = 15, + height = 10, + animation_speed = 0.5, + scale = mod_scale, + hr_version = { + filename = "__base__/graphics/entity/chemical-plant/hr-boiling-green-patch-mask.png", + frame_count = 32, + width = 30, + height = 20, + animation_speed = 0.5, + scale = 0.5 * mod_scale + } + } + }, + { + apply_recipe_tint = "tertiary", + north_position = {0, 0}, + west_position = {0, 0}, + south_position = {0, 0}, + east_position = {0, 0}, + north_animation = + { + filename = "__base__/graphics/entity/chemical-plant/boiling-window-green-patch.png", + frame_count = 1, + width = 87, + height = 60, + shift = util.by_pixel(0, -5), + scale = mod_scale, + hr_version = { + filename = "__base__/graphics/entity/chemical-plant/hr-boiling-window-green-patch.png", + x = 0, + frame_count = 1, + width = 174, + height = 119, + shift = util.by_pixel(0, -5.25), + scale = 0.5 * mod_scale + } + }, + east_animation = + { + filename = "__base__/graphics/entity/chemical-plant/boiling-window-green-patch.png", + x = 87, + frame_count = 1, + width = 87, + height = 60, + shift = util.by_pixel(0, -5), + scale = mod_scale, + hr_version = { + filename = "__base__/graphics/entity/chemical-plant/hr-boiling-window-green-patch.png", + x = 174, + frame_count = 1, + width = 174, + height = 119, + shift = util.by_pixel(0, -5.25), + scale = 0.5 * mod_scale + } + }, + south_animation = + { + filename = "__base__/graphics/entity/chemical-plant/boiling-window-green-patch.png", + x = 174, + frame_count = 1, + width = 87, + height = 60, + shift = util.by_pixel(0, -5), + scale = mod_scale, + hr_version = { + filename = "__base__/graphics/entity/chemical-plant/hr-boiling-window-green-patch.png", + x = 348, + frame_count = 1, + width = 174, + height = 119, + shift = util.by_pixel(0, -5.25), + scale = 0.5 * mod_scale + } + } + } + }, + vehicle_impact_sound = { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 }, + working_sound = + { + sound = + { + { + filename = "__base__/sound/boiler.ogg", + volume = 0.8 + } + }, + idle_sound = { filename = "__base__/sound/idle1.ogg", volume = 0.6 }, + apparent_volume = 1.5, + }, + crafting_speed = 1.25, + energy_source = + { + type = "burner", + fuel_category = "chemical", + effectivity = 0.9, + emissions = 0.03 / 3.5, + fuel_inventory_size = 1, + --[[smoke = + { + { + name = "smoke", + frequency = 10, + position = {0.7, -1.2}, + starting_vertical_speed = 0.08, + starting_frame_deviation = 60 + } + }]] + }, + --[[energy_source = + { + type = "electric", + usage_priority = "secondary-input", + emissions = 0.03 / 3.5 + },]] + energy_usage = "210kW", + ingredient_count = 4, + crafting_categories = {"gasification-recipes"}, + fluid_boxes = + { + { + production_type = "input", + pipe_covers = pipecoverspictures(), + base_area = 10, + base_level = -1, + pipe_connections = {{ type="input", position = {-0.5, -1.5} }} + }, + --[[ + { + production_type = "input", + pipe_covers = pipecoverspictures(), + base_area = 10, + base_level = -1, + pipe_connections = {{ type="input", position = {1, -2} }} + },]] + { + production_type = "output", + pipe_covers = pipecoverspictures(), + base_level = 1, + pipe_connections = {{ position = {-0.5, 1.5} }} + } + --[[ + { + production_type = "output", + pipe_covers = pipecoverspictures(), + base_level = 1, + pipe_connections = {{ position = {1, 2} }} + }]] + } + } +} +) \ No newline at end of file diff --git a/Liquid_Fueled_0.1.0/prototypes/entity_overrides.lua b/Liquid_Fueled_0.1.0/prototypes/entity_overrides.lua new file mode 100644 index 0000000..d23dba5 --- /dev/null +++ b/Liquid_Fueled_0.1.0/prototypes/entity_overrides.lua @@ -0,0 +1,51 @@ + +local entities = { + {type="furnace", name="steel-furnace"}, + {type="assembling-machine", name="assembling-machine-1"}, + {type="assembling-machine", name="assembling-machine-2"}, +} + +for _, entities in pairs(entities) do + local entity = util.table.deepcopy(data.raw[entities.type][entities.name]) + local smoke = entity.energy_source.smoke + local item = util.table.deepcopy(data.raw["item"][entities.name]) + item.name = "liquid-" .. entity.name + item.place_result = "liquid-" .. entity.name + data:extend({item}) + entity.name = "liquid-" .. entity.name + entity.minable.result = entity.name + entity.energy_source = { + type = "fluid", + fuel_category = "basic-fuel", + effectivity = 1, + emissions = 0.02, + fuel_inventory_size = 1, + maximum_temperature = 40.0, + scale_fluid_usage = true, + smoke = smoke, + fluid_box = + { + production_type = "input", + pipe_picture = assembler2pipepictures(), + pipe_covers = pipecoverspictures(), + base_area = 5, + base_level = -1, + filter = "fuel-gas", + pipe_connections = {{ type="input", position = {-0.5, -1.5}}} + } + } + if entity.fluid_boxes == nil then + entity.fluid_boxes = {} + end + entity.fluid_boxes[#entity.fluid_boxes+1] = + { + production_type = "output", + -- pipe_covers = pipecoverspictures(), --TODO: ADD NULL PIPE COVER PICTURES + base_area = 10^-5, + base_level = 0, + -- filter = "water", --TODO: ADD NULL FILTER WITH NULL IMAGE. try the filter = "none" first + pipe_connections = {{ type="output", position = {0, entity.selection_box[2][2]}}} + } + entity.fluid_boxes.off_when_no_fluid_recipe = false + data:extend({entity}) +end \ No newline at end of file diff --git a/Liquid_Fueled_0.1.0/prototypes/fluids.lua b/Liquid_Fueled_0.1.0/prototypes/fluids.lua new file mode 100644 index 0000000..01a09b6 --- /dev/null +++ b/Liquid_Fueled_0.1.0/prototypes/fluids.lua @@ -0,0 +1,26 @@ + + +data:extend( +{ + { + type = "fuel-category", + name = "basic-fuel" + }, + { + type = "fluid", + name = "fuel-gas", + default_temperature = 24, + base_color = {r=0, g=0, b=0}, + flow_color = {r=0.5, g=0.5, b=0.5}, + max_temperature = 1000, + icon = "__base__/graphics/icons/fluid/crude-oil.png", + icon_size = 32, + pressure_to_speed_ratio = 0.4, + flow_to_energy_ratio = 0.59, + heat_capacity = "0.01MJ", + fuel_value = "0.01MJ", + fuel_category = "basic-fuel", + order = "a[fluid]-b[crude-oil]" + } +} +) \ No newline at end of file diff --git a/Liquid_Fueled_0.1.0/prototypes/items.lua b/Liquid_Fueled_0.1.0/prototypes/items.lua new file mode 100644 index 0000000..d070150 --- /dev/null +++ b/Liquid_Fueled_0.1.0/prototypes/items.lua @@ -0,0 +1,24 @@ +data:extend( +{ + { + type = "item", + name = "gasification-plant", + icon = "__base__/graphics/icons/chemical-plant.png", + icon_size = 32, + subgroup = "production-machine", + order = "e[gasification-plant]", + place_result = "gasification-plant", + stack_size = 50 + }, + { + type = "item", + name = "liquid-steel-furnace", + icon = "__base__/graphics/icons/steel-furnace.png", + icon_size = 32, + subgroup = "smelting-machine", + order = "b[liquid-steel-furnace]", + place_result = "liquid-steel-furnace", + stack_size = 50 + }, +} +) \ No newline at end of file diff --git a/Liquid_Fueled_0.1.0/prototypes/recipes.lua b/Liquid_Fueled_0.1.0/prototypes/recipes.lua new file mode 100644 index 0000000..e69de29 diff --git a/Liquid_Fueled_0.1.0/prototypes/technologies.lua b/Liquid_Fueled_0.1.0/prototypes/technologies.lua new file mode 100644 index 0000000..7a89db8 --- /dev/null +++ b/Liquid_Fueled_0.1.0/prototypes/technologies.lua @@ -0,0 +1,6 @@ +data:extend( +{ + { + } +} +) \ No newline at end of file diff --git a/README.md b/README.md index 5996351..31c8ce0 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ # Factorio-Dieselpunk -Test mod test mod +Mod aims to remove power from the game and replace it with fuel-powered machines and inserters, which should pose a hard logistical challenge for seasoned players. +Reskins of electronic components planned as well. \ No newline at end of file