I could not find the mod I was seeking, so I decided to try and build it myself. I started (with what I think is) basic, by just addingt the item I want: linked-chest https://www.reddit.com/r/factorio/comme ... le_in_the/
I used the tutorial on the Wiki https://wiki.factorio.com/Tutorial:Modd ... al/Gangsir as a starting point.
I got the fireArmor from the example working sans the control.lua file as that went beyond the scope of what I was trying to do for Step 1. I then tried replacing the necessary variables to add linked-chests. I got various errors as I worked through it, but I kept hitting a wall when trying to load the game with:
Here is my code:
Code: Select all
--item.lua
local warpChest = table.deepcopy(data.raw["linked-container"]["linked-chest"])
warpChest.name = "warp-chest"
warpChest.icons = {
{
icon = warpChest.icon,
tint = {r=1,g=0,b=0,a=0.3}
},
}
local recipe = table.deepcopy(data.raw["recipe"]["heavy-armor"])
recipe.enabled = true
recipe.name = "warp-chest"
recipe.ingredients = {{"copper-plate",200},{"steel-plate",50}}
recipe.result = "warp-chest"
data:extend{warpChest,recipe}
When I loaded into the game, I got this (red chest is the new item in the unsorted category):
This definitely felt like progress. However, when I would place one of those chests on the ground in the game, it would "change" to a normal linked chest. i.e. The custom color would go away, and the item-name would change back to the default.
The other mods I could find that dealt with linked-chests seemed to use "linked-container" in the deepcopy, but more indirectly, so I can't look at an easy 1:1 working example to compare.
I would like to be able to add modified linked-chest(s) as a first step that "stay" modified.
Several notes:
- I am aware that linked-chests are not a normal item and that I am modifying a hidden item that requires using the editor/console (see Reddit link above).
- Apologies if I am conflating 2 or more issues in a single post.
- I realize a lot of people consider linked chests to defeat a lot of the purpose of Factorio. I am trying to build a mod with that in mind.
- My end goal is to have linked-chests that can be named for different purposes vs the checkbox GUI. Based on my forum deep dive, I don't think that will be possible, but I would like to at least figure out this "step 1".
Edit: Clarity.