[Solved]DeepCopy of unsorted items missing from normal gameplay
[Solved]DeepCopy of unsorted items missing from normal gameplay
I am trying to make a mod which utilizes the lane splitter found in the unsorted item group when in editor mode. I would love to use this during normal gameplay but when I use deepcopy to make the item and entity, nothing shows up in the menu unless I enable the editor mode. Is there a setting or flag somewhere that I need to change to ensure items that I copy show up without the editor mode being enabled?
Last edited by keeper317 on Tue Dec 03, 2024 10:20 am, edited 1 time in total.
Re: DeepCopy of unsorted items missing from normal gameplay
Try setting item.hidden = false.
Re: DeepCopy of unsorted items missing from normal gameplay
I tried that, also made a custom subgroup in the logistics group to move the item to and set its new order.
The custom subgroup works, but only in editor mode.
Re: DeepCopy of unsorted items missing from normal gameplay
This worked for me.
Code: Select all
local entity = table.deepcopy(data.raw['lane-splitter']['lane-splitter'])
entity.name = "my-splitter"
entity.hidden = false
data:extend{entity}
local item = table.deepcopy(data.raw['item']['lane-splitter'])
item.name = "my-splitter"
item.subgroup = "belt"
item.place_result = "my-splitter"
item.hidden = false
data:extend{item}
local recipe = table.deepcopy(data.raw['recipe']['splitter'])
recipe.name = "my-splitter"
recipe.results = {{type="item", name="my-splitter", amount=1}}
recipe.enabled = true
data:extend{recipe}
Re: DeepCopy of unsorted items missing from normal gameplay
Thank you, apparently I had my recipe.enabled set to false and forgot to unlock it with a technology. Fixed now.DaveMcW wrote: Tue Dec 03, 2024 12:33 am This worked for me.
Code: Select all
local entity = table.deepcopy(data.raw['lane-splitter']['lane-splitter']) entity.name = "my-splitter" entity.hidden = false data:extend{entity} local item = table.deepcopy(data.raw['item']['lane-splitter']) item.name = "my-splitter" item.subgroup = "belt" item.place_result = "my-splitter" item.hidden = false data:extend{item} local recipe = table.deepcopy(data.raw['recipe']['splitter']) recipe.name = "my-splitter" recipe.results = {{type="item", name="my-splitter", amount=1}} recipe.enabled = true data:extend{recipe}