if data.raw
Posted: Sun Jan 19, 2014 10:30 pm
how to get
to work in the control.lua???
it works just fine in the data.lua, but in control.lua it gives an nil error. i was kinda hoping they had access to the same tables xD (apparently not)
i want it in my control.lua because i want to add compatibility between other mods and my Dynamic System.
the entire code for the compatibility:
and yes, i already tried with
at the top of the control.lua. it didnt help
Code: Select all
if data.raw.resource["quartz"] then
it works just fine in the data.lua, but in control.lua it gives an nil error. i was kinda hoping they had access to the same tables xD (apparently not)
i want it in my control.lua because i want to add compatibility between other mods and my Dynamic System.
the entire code for the compatibility:
Code: Select all
game.onevent(defines.events.onplayermineditem, function(event)
if data.raw.resource["quartz"] then --[[Industrio Compatibility]]--
if ds.mineitemsindustrio[event.itemstack.name] then
for counter, ingredients in pairs(ds.mineitemsindustrio[event.itemstack.name]) do
glob.counter[counter]=glob.counter[counter]+(event.itemstack.count*ingredients)
end
end
end
end)
Code: Select all
require "dataloader"