creating car prototype
Posted: Tue Aug 25, 2020 5:12 pm
Hello! I'm trying to make a car that detonates in an explosion when it hits something. First step: create a new car prototype. I've tried duplicating the original car with this in data.lua:
But I get an error: 'error in assignID: item with name "my-car" doesn't exist.'
If I take out the minable result then it works. If I try to create a recipe for it then I get the same error there.
I feel like I must be missing something simple. What am I doing wrong?
Code: Select all
local myCar = util.table.deepcopy(data.raw["car"]["car"])
myCar.name = "my-car"
myCar.minable.result = "my-car"
data:extend({myCar})
If I take out the minable result then it works. If I try to create a recipe for it then I get the same error there.
I feel like I must be missing something simple. What am I doing wrong?