[solved] Error in AssignID...

Place to get help with not working mods / modding interface.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

[solved] Error in AssignID...

Post by aubergine18 »

Anyone know how to track down the source of this error (specifically, which file it happens in)?

Image

I've got techs that enable a bunch of recipes, and the recipes result in various items.

One of the recipes radio-wire-pack (1 red + 1 green = wire-pack) is used by several other recipes, which are all defined after the radio-wire-pack recipe. There's also a radio-wire-pack item defined in my items.lua. The items.lua is loaded after the recipes.lua which is loaded after the techs.lua.

Does the item need defining before any recipes that use it?
Last edited by aubergine18 on Fri Aug 12, 2016 10:34 pm, edited 1 time in total.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Error in AssignID...

Post by prg »

Order in which things are defined isn't important, everything that's needed by something just needs to exist at the end of the data loading phase.

No idea what advice to give for debugging this properly, but if you provide the complete code I could take a look, maybe I'll notice something.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Rseding91
Factorio Staff
Factorio Staff
Posts: 15967
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Error in AssignID...

Post by Rseding91 »

The error is saying you don't have an item definition with that name.

Most likely you defined the recipe but didn't actually define the item that the recipe is told to produce.

Or, you did define it and the definition is malformed in some way that it doesn't work.
If you want to get ahold of me I'm almost always on Discord.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Error in AssignID...

Post by aubergine18 »

I've fixed it - there were two fubars on my part:

1. I'd somehow left the 'require' statement for /prototypes/items.lua commented out in data.lua *hangs head in shame*

2. I'd written a helper function to create lots of similar items, which prefixed item names with 'radio-', but in the recipes.lua I'd not prefixed the added items with 'radio-' in the subsequent recipes that used them.

So two causes for same error.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Post Reply

Return to “Modding help”