Page 1 of 1

[solved] Error in AssignID...

Posted: Fri Aug 12, 2016 4:28 pm
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?

Re: Error in AssignID...

Posted: Fri Aug 12, 2016 4:39 pm
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.

Re: Error in AssignID...

Posted: Fri Aug 12, 2016 6:11 pm
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.

Re: Error in AssignID...

Posted: Fri Aug 12, 2016 7:18 pm
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.