Deep copy

Place to get help with not working mods / modding interface.
Post Reply
Homewarriors
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Dec 08, 2020 4:50 pm
Contact:

Deep copy

Post by Homewarriors »

If I use util.table.deepcopy , can I change the parameters and if so, how

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Deep copy

Post by eradicator »

Code: Select all

local new = util.table.deepcopy(data.raw['foo']['bar'])
new. name = 'newname'
new. whatever = 42
data:extend{new}
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Modding help”