Compare commits
21 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
215dd76d90 | ||
![]() |
1adf84ef1a | ||
![]() |
3c0ebc98e2 | ||
![]() |
ae788825fe | ||
![]() |
4d875f2eaa | ||
![]() |
562ed9dd76 | ||
![]() |
19012408a5 | ||
![]() |
42c7360a39 | ||
![]() |
b6e46d3849 | ||
![]() |
c8ff481c4d | ||
![]() |
935ee5268e | ||
![]() |
104312531b | ||
![]() |
e2739df5ca | ||
![]() |
a49891d547 | ||
![]() |
b2bb6b14bf | ||
![]() |
aaa8f8e778 | ||
![]() |
485fc97d74 | ||
![]() |
59bcccac74 | ||
![]() |
53c3ce6907 | ||
![]() |
1b24772cbb | ||
![]() |
ee97c9cb52 |
22 changed files with 228 additions and 52 deletions
|
@ -10,7 +10,7 @@ This mod adds a global variable named `HotMetals`. Add things to it to add suppo
|
|||
It has the following properties.
|
||||
|
||||
### `items`
|
||||
Add an item name as string or a table with `name` and optional `spoilTicks` and `iconFolder`. The icon file will be `iconFolder .. "hot-" .. itemName .. ".png"`.
|
||||
Add an item name as string or a table with `name` and optional `spoilTicks` and `iconFolder`. The icon file will be `iconFolder .. "hot-" .. itemName .. ".png"`. If you need more control over the icons, provide a table `icons` instead of `iconFolder`.
|
||||
|
||||
### `craftingCategories`
|
||||
A table containing all supported crafting categories. This mod uses a white list to prevent unwanted categories by default. Only categories used by smelting buildings like the furnace and the foundry should be added.
|
||||
|
|
|
@ -1,17 +1,62 @@
|
|||
Version: 1.1.1
|
||||
Date: 21.12.2024
|
||||
Bug Fixes:
|
||||
- Fixed labels for hot pipe and underground pipe items and recipes (https://mods.factorio.com/mod/hot-metals/discussion/67493d0742705fa9914f61ca)
|
||||
- Fixed technology triggers being replaced for items that have non-hot early game recipes (https://mods.factorio.com/mod/hot-metals/discussion/676668fb9ce172be6c25f87a)
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 1.1.0
|
||||
Date: 03.12.2024
|
||||
Changes:
|
||||
- Added support for Vanilla (you still need to purchase Space Age)
|
||||
- Added support for AAI Industry
|
||||
- Added modding support
|
||||
- Removed Low density structure from the list because of https://forums.factorio.com/viewtopic.php?f=7&t=123081
|
||||
Bug Fixes:
|
||||
- Fixed research triggers that use metals with hot variants
|
||||
- Fixed missing recipe names
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 1.2.6
|
||||
Date: 18.04.2025
|
||||
Changes:
|
||||
- Add polish translation (I forgot who did it :-( )
|
||||
- Move technology changes to final fixes stage
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 1.2.5
|
||||
Date: 04.02.2025
|
||||
Changes:
|
||||
- Add Low density structure again after Wube fixed a bug (https://forums.factorio.com/123081)
|
||||
- Add support for Muluna (Aluminum plate)
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 1.2.4
|
||||
Date: 03.02.2025
|
||||
Bug Fixes:
|
||||
- Fix item weights (many items weights where way off)
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 1.2.3
|
||||
Date: 03.02.2025
|
||||
Changes:
|
||||
- Use non-hot icon variants for the recipes
|
||||
Bug Fixes:
|
||||
- Properly load cf-lib util
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 1.2.2
|
||||
Date: 02.02.2025
|
||||
Changes:
|
||||
- Recipes always output "fresh" hot metals (https://mods.factorio.com/mod/hot-metals/discussion/6775293c1c4d7b0e4bba8648)
|
||||
- Recipe code now also works if the main result is not the first result in the results list
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 1.2.1
|
||||
Date: 09.01.2025
|
||||
Changes:
|
||||
- Add hot stone bricks and hot concrete (https://mods.factorio.com/mod/hot-metals/discussion/677fdef8d37eef8332fa6c2f)
|
||||
- Biochambers don't generate hot plastic (https://mods.factorio.com/mod/hot-metals/discussion/675af47f1fba71716b2b7f7f)
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 1.2.0
|
||||
Date: 01.01.2025
|
||||
Changes:
|
||||
- Add support for custom icons (https://mods.factorio.com/mod/hot-metals/discussion/6773ea5e1c4d7b0e4bba85b6)
|
||||
- Add hot plastic (https://mods.factorio.com/mod/hot-metals/discussion/675af47f1fba71716b2b7f7f)
|
||||
Bug Fixes:
|
||||
- Support main_product (https://mods.factorio.com/mod/hot-metals/discussion/6773e919c568cd84f3f0884f)
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 1.1.1
|
||||
Date: 21.12.2024
|
||||
Bug Fixes:
|
||||
- Fixed labels for hot pipe and underground pipe items and recipes (https://mods.factorio.com/mod/hot-metals/discussion/67493d0742705fa9914f61ca)
|
||||
- Fixed technology triggers being replaced for items that have non-hot early game recipes (https://mods.factorio.com/mod/hot-metals/discussion/676668fb9ce172be6c25f87a)
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 1.1.0
|
||||
Date: 03.12.2024
|
||||
Changes:
|
||||
- Added support for Vanilla (you still need to purchase Space Age)
|
||||
- Added support for AAI Industry
|
||||
- Added modding support
|
||||
- Removed Low density structure from the list because of https://forums.factorio.com/viewtopic.php?f=7&t=123081
|
||||
Bug Fixes:
|
||||
- Fixed research triggers that use metals with hot variants
|
||||
- Fixed missing recipe names
|
||||
- Fixed Holmium
|
|
@ -1,6 +1,7 @@
|
|||
local modList = {
|
||||
"space-age",
|
||||
"aai-industry"
|
||||
"aai-industry",
|
||||
"planet-muluna"
|
||||
}
|
||||
|
||||
for _, mod in pairs(modList) do
|
||||
|
|
1
hot-metals/compatibility/planet-muluna.lua
Normal file
1
hot-metals/compatibility/planet-muluna.lua
Normal file
|
@ -0,0 +1 @@
|
|||
table.insert(HotMetals.items, "aluminum-plate")
|
|
@ -5,8 +5,7 @@ table.insert(HotMetals.items, "iron-stick")
|
|||
table.insert(HotMetals.items, "pipe")
|
||||
table.insert(HotMetals.items, "pipe-to-ground")
|
||||
table.insert(HotMetals.items, "tungsten-plate")
|
||||
-- Disabled because of https://forums.factorio.com/viewtopic.php?f=7&t=123081
|
||||
--table.insert(HotMetals.items, "low-density-structure")
|
||||
table.insert(HotMetals.items, "low-density-structure")
|
||||
|
||||
table.insert(HotMetals.craftingCategories, "metallurgy")
|
||||
table.insert(HotMetals.craftingCategories, "crafting-with-fluid-or-metallurgy")
|
||||
|
@ -16,4 +15,12 @@ table.insert(HotMetals.skipTechUnlocksFor, "iron-gear-wheel")
|
|||
table.insert(HotMetals.skipTechUnlocksFor, "copper-cable")
|
||||
table.insert(HotMetals.skipTechUnlocksFor, "iron-stick")
|
||||
table.insert(HotMetals.skipTechUnlocksFor, "pipe")
|
||||
table.insert(HotMetals.skipTechUnlocksFor, "pipe-to-ground")
|
||||
table.insert(HotMetals.skipTechUnlocksFor, "pipe-to-ground")
|
||||
|
||||
if settings.startup["hot-metals-plastic"].value then
|
||||
table.insert(HotMetals.craftingCategories, "chemistry-or-cryogenics")
|
||||
end
|
||||
|
||||
if settings.startup["hot-metals-bricks"].value then
|
||||
table.insert(HotMetals.items, "concrete")
|
||||
end
|
1
hot-metals/data-final-fixes.lua
Normal file
1
hot-metals/data-final-fixes.lua
Normal file
|
@ -0,0 +1 @@
|
|||
require("prototypes/hot-metals-final")
|
|
@ -2,7 +2,7 @@ HotMetals = {
|
|||
items = {
|
||||
"copper-plate",
|
||||
"iron-plate",
|
||||
"steel-plate",
|
||||
"steel-plate"
|
||||
},
|
||||
craftingCategories = {
|
||||
"smelting"
|
||||
|
@ -10,4 +10,17 @@ HotMetals = {
|
|||
skipTechUnlocksFor = {}
|
||||
}
|
||||
|
||||
require("__cf-lib__/util")
|
||||
|
||||
if settings.startup["hot-metals-plastic"].value then
|
||||
table.insert(HotMetals.items, "plastic-bar")
|
||||
if not mods["space-age"] then -- Space age uses other crafting categories
|
||||
table.insert(HotMetals.craftingCategories, "chemistry")
|
||||
end
|
||||
end
|
||||
|
||||
if settings.startup["hot-metals-bricks"].value then
|
||||
table.insert(HotMetals.items, "stone-brick")
|
||||
end
|
||||
|
||||
require("compatibility.data")
|
BIN
hot-metals/graphics/icons/hot-aluminum-plate.png
Normal file
BIN
hot-metals/graphics/icons/hot-aluminum-plate.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
BIN
hot-metals/graphics/icons/hot-concrete.png
Normal file
BIN
hot-metals/graphics/icons/hot-concrete.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
BIN
hot-metals/graphics/icons/hot-plastic-bar.png
Normal file
BIN
hot-metals/graphics/icons/hot-plastic-bar.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7 KiB |
BIN
hot-metals/graphics/icons/hot-stone-brick.png
Normal file
BIN
hot-metals/graphics/icons/hot-stone-brick.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
|
@ -1,13 +1,14 @@
|
|||
{
|
||||
"name": "hot-metals",
|
||||
"version": "1.1.1",
|
||||
"title": "Hot metals",
|
||||
"description": "A furnace doesn't just output cold usable results. You need to wait for them to cool down.",
|
||||
"author": "cackling fiend",
|
||||
"homepage": "",
|
||||
"factorio_version": "2.0",
|
||||
"dependencies": [
|
||||
"base"
|
||||
],
|
||||
"spoiling_required": true
|
||||
{
|
||||
"name": "hot-metals",
|
||||
"version": "1.2.6",
|
||||
"title": "Hot metals",
|
||||
"description": "A furnace doesn't just output cold usable results. You need to wait for them to cool down.",
|
||||
"author": "cackling fiend",
|
||||
"homepage": "",
|
||||
"factorio_version": "2.0",
|
||||
"dependencies": [
|
||||
"base",
|
||||
"cf-lib >= 0.0.2"
|
||||
],
|
||||
"spoiling_required": true
|
||||
}
|
|
@ -3,6 +3,10 @@ hot=Hot
|
|||
|
||||
[mod-setting-name]
|
||||
hot-metals-time=Cooldown time
|
||||
hot-metals-plastic=Add hot plastic
|
||||
hot-metals-bricks=Add hot stone bricks and concrete
|
||||
|
||||
[mod-setting-description]
|
||||
hot-metals-time=The time in seconds for a hot item to cool down.
|
||||
hot-metals-time=The time in seconds for a hot item to cool down.
|
||||
hot-metals-plastic=Although the temperature of hot plastic is way lower compared to metals, you might want to have a hot variant anyway.
|
||||
hot-metals-bricks=Stone bricks and concrete are not included by default. If you like to play with hot variants, you can enable this option.
|
12
hot-metals/locale/pl/strings.cfg
Normal file
12
hot-metals/locale/pl/strings.cfg
Normal file
|
@ -0,0 +1,12 @@
|
|||
[item-name]
|
||||
hot=Hot
|
||||
|
||||
[mod-setting-name]
|
||||
hot-metals-time=Czas stygnięcia
|
||||
hot-metals-plastic=Dodaj gorący plastik
|
||||
hot-metals-bricks=dodaj gorące kamienne cegły i beton
|
||||
|
||||
[mod-setting-description]
|
||||
hot-metals-time=Czas w sekundach, jaki jest potrzebny, aby gorący przedmiot ostygł.
|
||||
hot-metals-plastic=Chociaż temperatura gorącego plastiku jest znacznie niższa w porównaniu do metali, możesz chcieć mieć jego gorącą wersję.
|
||||
hot-metals-bricks=Kamienne cegły i beton nie są domyślnie uwzględnione. Jeśli lubisz grać z gorącymi wariantami, możesz włączyć tę opcję.
|
9
hot-metals/prototypes/hot-metals-final.lua
Normal file
9
hot-metals/prototypes/hot-metals-final.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
-- Change technology triggers
|
||||
for _, tech in pairs(data.raw.technology) do
|
||||
if tech.research_trigger then
|
||||
local item = data.raw.item[tech.research_trigger.item]
|
||||
if item and item.hot_item and not contains(HotMetals.skipTechUnlocksFor, item.name) then
|
||||
tech.research_trigger.item = item.hot_item
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,38 +1,106 @@
|
|||
local defaultSpoilTicks = settings.startup["hot-metals-time"].value * 60
|
||||
|
||||
function createHotVariant(item)
|
||||
local itemName = item
|
||||
---@param name data.ItemID
|
||||
---@return data.ItemPrototype?
|
||||
function getItem(name)
|
||||
if data.raw.item[name] then
|
||||
return data.raw.item[name] --[[@as data.ItemPrototype]]
|
||||
end
|
||||
for item_type in pairs(defines.prototypes.item) do
|
||||
local type_lookup = data.raw[item_type]
|
||||
if type_lookup and type_lookup[name] then
|
||||
return type_lookup[name] --[[@as data.ItemPrototype]]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---@param table item
|
||||
---@return number
|
||||
function getWeight(item)
|
||||
if type(item) == "string" then
|
||||
item = getItem(item)
|
||||
end
|
||||
if item.weight then return item.weight end
|
||||
local factor = item.ingredient_to_weight_coefficient or 0.5
|
||||
for _, recipe in pairs(data.raw.recipe) do
|
||||
if recipe.results == nil then
|
||||
goto continue
|
||||
end
|
||||
local function isResultMatch(result)
|
||||
return result.name == item.name
|
||||
end
|
||||
local results = table.filter(recipe.results, isResultMatch)
|
||||
if #results > 0 then
|
||||
for _, ingredient in pairs(recipe.ingredients) do
|
||||
if ingredient.type == "item" then
|
||||
local weight = data.raw.item[ingredient.name].weight or getWeight(data.raw.item[ingredient.name])
|
||||
local amount = ingredient.amount
|
||||
if ingredient.amount_min and ingredient.amount_max then
|
||||
amount = (ingredient.amount_min + ingredient.amount_max) / 2
|
||||
end
|
||||
return amount * weight * factor
|
||||
end
|
||||
end
|
||||
end
|
||||
::continue::
|
||||
end
|
||||
return 100
|
||||
end
|
||||
|
||||
function createHotVariant(config)
|
||||
local itemName = config
|
||||
local spoilTicks = defaultSpoilTicks
|
||||
local iconFolder = "__hot-metals__/graphics/icons/"
|
||||
|
||||
if type(item) == "table" then
|
||||
itemName = item.name
|
||||
spoilTicks = item.spoilTicks or spoilTicks
|
||||
iconFolder = item.iconFolder or iconFolder
|
||||
if type(config) == "table" then
|
||||
itemName = config.name
|
||||
spoilTicks = config.spoilTicks or spoilTicks
|
||||
iconFolder = config.iconFolder or iconFolder
|
||||
end
|
||||
local item = data.raw.item[itemName]
|
||||
item.weight = getWeight(item)
|
||||
|
||||
-- Create new item
|
||||
local hotItem = table.deepcopy(data.raw.item[itemName])
|
||||
hotItem.name = "hot-" .. itemName
|
||||
hotItem.localised_name = { "", { "item-name.hot" }, " ", { "item-name." .. itemName } }
|
||||
hotItem.icon = iconFolder .. "hot-" .. itemName .. ".png"
|
||||
if (config.icons) then
|
||||
hotItem.icons = config.icons
|
||||
else
|
||||
hotItem.icon = iconFolder .. "hot-" .. itemName .. ".png"
|
||||
end
|
||||
hotItem.order = hotItem.order .. "-hot"
|
||||
hotItem.ingredient_to_weight_coefficient = item.ingredient_to_weight_coefficient
|
||||
hotItem.weight = item.weight
|
||||
hotItem.spoil_result = itemName
|
||||
hotItem.spoil_ticks = spoilTicks
|
||||
data:extend({ hotItem })
|
||||
|
||||
item.hot_item = hotItem.name
|
||||
|
||||
-- Change recipes
|
||||
for _, recipe in pairs(data.raw.recipe) do
|
||||
if contains(HotMetals.craftingCategories, recipe.category) and recipe.results[1].name == itemName then
|
||||
recipe.results[1].name = hotItem.name
|
||||
recipe.localised_name = { "item-name." .. itemName }
|
||||
end
|
||||
end
|
||||
if contains(HotMetals.craftingCategories, recipe.category) then
|
||||
local function isResultMatch(result)
|
||||
return result.name == itemName
|
||||
end
|
||||
local results = table.filter(recipe.results, isResultMatch)
|
||||
if #results > 0 then
|
||||
-- Change regular recipe to be the "hot" recipe
|
||||
for _, result in pairs(results) do
|
||||
result.name = hotItem.name
|
||||
end
|
||||
recipe.localised_name = { "item-name." .. itemName }
|
||||
recipe.icon = recipe.icon or item.icon
|
||||
recipe.icon_size = recipe.icon_size or item.icon_size
|
||||
recipe.icons = recipe.icons or item.icons
|
||||
if recipe.main_product == itemName then
|
||||
recipe.main_product = hotItem.name
|
||||
end
|
||||
|
||||
-- Change technology triggers
|
||||
for _, tech in pairs(data.raw.technology) do
|
||||
if tech.research_trigger and tech.research_trigger.item == itemName and not contains(HotMetals.skipTechUnlocksFor, itemName) then
|
||||
tech.research_trigger.item = hotItem.name
|
||||
recipe.preserve_products_in_machine_output = true
|
||||
recipe.result_is_always_fresh = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -5,5 +5,19 @@ data:extend({
|
|||
setting_type = "startup",
|
||||
default_value = 20,
|
||||
order = "a"
|
||||
},
|
||||
{
|
||||
type = "bool-setting",
|
||||
name = "hot-metals-plastic",
|
||||
setting_type = "startup",
|
||||
default_value = false,
|
||||
order = "b"
|
||||
},
|
||||
{
|
||||
type = "bool-setting",
|
||||
name = "hot-metals-bricks",
|
||||
setting_type = "startup",
|
||||
default_value = false,
|
||||
order = "c"
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
BIN
sources/hot-aluminum-plate.afphoto
Normal file
BIN
sources/hot-aluminum-plate.afphoto
Normal file
Binary file not shown.
BIN
sources/hot-concrete.afphoto
Normal file
BIN
sources/hot-concrete.afphoto
Normal file
Binary file not shown.
Binary file not shown.
BIN
sources/hot-plastic-bar.afphoto
Normal file
BIN
sources/hot-plastic-bar.afphoto
Normal file
Binary file not shown.
BIN
sources/hot-stone-brick.afphoto
Normal file
BIN
sources/hot-stone-brick.afphoto
Normal file
Binary file not shown.
Loading…
Add table
Reference in a new issue