[Solved] Error in assignID

Place to get help with not working mods / modding interface.
Post Reply
Gamker
Burner Inserter
Burner Inserter
Posts: 8
Joined: Tue Jan 12, 2021 5:38 pm
Contact:

[Solved] Error in assignID

Post by Gamker »

I have started modding and I got an error (Error in assignID: item with name 'inserter2' does not exits.)
My code so far (item.lua):

Code: Select all

local inserter2 = table.deepcopy(data.raw["inserter"]["inserter"])

inserter2.name = "inserter2"
inserter2.icons = {
  {
    icon = inserter2.icon,
    tint = {r=1,g=0,b=0,a=0.3}
  },
}

local recipe = table.deepcopy(data.raw["recipe"]["inserter"])
recipe.enabled = true
recipe.name = "inserter2"
recipe.ingredients = {{"copper-plate",200},{"steel-plate",50}}
recipe.result = "inserter2"

data:extend{inserter2,recipe}
Last edited by Gamker on Thu Jan 14, 2021 12:52 pm, edited 2 times in total.

User avatar
ptx0
Filter Inserter
Filter Inserter
Posts: 661
Joined: Wed Jan 01, 2020 7:16 pm
Contact:

Re: Error in assignID

Post by ptx0 »

are you doing that in data stage?

Gamker
Burner Inserter
Burner Inserter
Posts: 8
Joined: Tue Jan 12, 2021 5:38 pm
Contact:

Re: Error in assignID

Post by Gamker »

ptx0 wrote:
Tue Jan 12, 2021 5:56 pm
are you doing that in data stage?
No, it's in item.lua. It's the last bit that seems to not work (recepie.result= "inserter2").

PFQNiet
Fast Inserter
Fast Inserter
Posts: 124
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

Re: Error in assignID

Post by PFQNiet »

You have an entity and a recipe, but you need an item.

Gamker
Burner Inserter
Burner Inserter
Posts: 8
Joined: Tue Jan 12, 2021 5:38 pm
Contact:

Re: Error in assignID

Post by Gamker »

PFQNiet wrote:
Wed Jan 13, 2021 9:42 am
You have an entity and a recipe, but you need an item.
And how do I add an item(I'm a beginner at modding)?

PFQNiet
Fast Inserter
Fast Inserter
Posts: 124
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

Re: Error in assignID

Post by PFQNiet »

Deepcopy data.raw.item.inserter and change its properties as needed.

Gamker
Burner Inserter
Burner Inserter
Posts: 8
Joined: Tue Jan 12, 2021 5:38 pm
Contact:

Re: Error in assignID

Post by Gamker »

PFQNiet wrote:
Wed Jan 13, 2021 3:33 pm
Deepcopy data.raw.item.inserter and change its properties as needed.
Ok I'll try that.

Gamker
Burner Inserter
Burner Inserter
Posts: 8
Joined: Tue Jan 12, 2021 5:38 pm
Contact:

Re: Error in assignID

Post by Gamker »

It helped a lot.

Gamker
Burner Inserter
Burner Inserter
Posts: 8
Joined: Tue Jan 12, 2021 5:38 pm
Contact:

Re: Error in assignID

Post by Gamker »

I'm going to leave this thread open because I have no idea how to close it so if anyone knows plz tell me.

User avatar
ickputzdirwech
Filter Inserter
Filter Inserter
Posts: 425
Joined: Sun May 07, 2017 10:16 am
Contact:

Re: Error in assignID

Post by ickputzdirwech »

Only moderators and admins can close topics. And it’s usually only done when a discussion derailed completely. What I do in a case like this is changing the topic title and adding “[Solved]” at the beginning of it. So people know that there is no further help needed and that there might be an answer in the topic if they have a similar issue.
Mods: Shortcuts for 1.1, ick's vanilla tweaks
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write.

Gamker
Burner Inserter
Burner Inserter
Posts: 8
Joined: Tue Jan 12, 2021 5:38 pm
Contact:

Re: Error in assignID

Post by Gamker »

Oh ok.

Post Reply

Return to “Modding help”

Who is online

Users browsing this forum: No registered users