Page 1 of 1

Integration of mods. Item does not exist.

Posted: Fri Mar 31, 2017 5:39 am
by KepperMIEM
I try to use items of other(Yuoki) mod in recipes of my mod.
"Error in assignID 'y-coal-dust' does not exist"

My info.json

Code: Select all

...
"dependencies": ["base >= 0.14.0", "? Nucular >= 1.0.4", "? Yuoki >= 0.4.63", "? yi_engines >= 0.4.19"],
...
Integration with Yuoki mod is optional.

My mod see some Yuoki items(y-toxic-dust) and do not see other Yuoki items(y-coal-dust).
I guess that the "y-coal-dust" does not have time to load.

How can my mod wait for other mod?


Yuoki data.lua

Code: Select all

...
require("prototypes.item.y_items")  -- y-toxic-dust  declaration
...
require("prototypes.z_items") -- y-coal-dust  declaration
...

My data.lua

Code: Select all

...
require("Yuoki.Yuoki")
My Yuoki.lua

Code: Select all

...
if data.raw.fluid["y-con_water"] then
	local tmp_recipe = data.raw.recipe["clearing-contaminated-water"]
	tmp_recipe.results = {
		{type="fluid", name="water", amount=24},
		{type="item", name="dirt", amount=5},
		[b]{type="item", name="y-toxic-dust", amount=1}, -- this line work correct[/b]
	}
...
	tmp_recipe = data.raw.recipe["coal-dust|solid-fuel"]	--coal-processing-recipes.lua
	tmp_recipe.ingredients = {
		[b]{type="item",name="y-coal-dust ", amount=4},  -- this line generate error[/b]
	}
...
end

Re: Integration of mods. Item does not exist.

Posted: Fri Mar 31, 2017 6:00 am
by daniel34
KepperMIEM wrote:My mod see some Yuoki items(y-toxic-dust) and do not see other Yuoki items(y-coal-dust).
I guess that the "y-coal-dust" does not have time to load.

How can my mod wait for other mod?
If you define it as a dependency (even an optional one) it is always completely loaded before your mod.

The error is here:

Code: Select all

{type="item",name="y-coal-dust ", amount=4},  -- this line generate error
You have a space after y-coal-dust before the closing quotation mark.

Re: Integration of mods. Item does not exist.

Posted: Fri Mar 31, 2017 7:01 am
by KepperMIEM
Yes. You right.
I did not notice the space.

Thank you.