[Solved]DeepCopy of unsorted items missing from normal gameplay

Place to get help with not working mods / modding interface.
keeper317
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sun Dec 01, 2024 6:13 pm
Contact:

[Solved]DeepCopy of unsorted items missing from normal gameplay

Post by keeper317 »

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.
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3733
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: DeepCopy of unsorted items missing from normal gameplay

Post by DaveMcW »

Try setting item.hidden = false.
keeper317
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sun Dec 01, 2024 6:13 pm
Contact:

Re: DeepCopy of unsorted items missing from normal gameplay

Post by keeper317 »

DaveMcW wrote: Mon Dec 02, 2024 9:16 am Try setting item.hidden = false.
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.
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3733
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: DeepCopy of unsorted items missing from normal gameplay

Post by DaveMcW »

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}

keeper317
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sun Dec 01, 2024 6:13 pm
Contact:

Re: DeepCopy of unsorted items missing from normal gameplay

Post by keeper317 »

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}

Thank you, apparently I had my recipe.enabled set to false and forgot to unlock it with a technology. Fixed now.
Post Reply

Return to “Modding help”