mod compatibility
Posted: Mon Mar 17, 2014 8:58 pm
currently, all mods can be made compatible.
in the data.lua file, that is something like: (this was for industrio, but considering its died, i deleted it anyway) (and yes, i know the "else return" is abundant. didnt know it at that time
)
or in the control.lua (also industrio):
well i find this ineffecient. why? simply if a mod changes the name of item in question or deletes it (in this case quartz) the compatibility ceases to exist.
i suggest this for data.lua:
and control.lua:
if you make it, it will allow me make a powerful compatibility for all mods to mine. all mods will then be able to add to the dynamic system, or the database of it.
in the data.lua file, that is something like: (this was for industrio, but considering its died, i deleted it anyway) (and yes, i know the "else return" is abundant. didnt know it at that time

Code: Select all
if data.raw.resource["quartz"] then
require("prototypes.recipe.industrio")
require("prototypes.recipe.recycling-industrio")
else return
end
Code: Select all
if game.entityprototypes.quartz then --[[Industrio Compatibility]]--
if ds.craftitemsindustrio[event.itemstack.name] then
for counter, ingredients in pairs(ds.craftitemsindustrio[event.itemstack.name]) do
glob.counter[counter]=glob.counter[counter]+(event.itemstack.count*ingredients)
end
end
end
i suggest this for data.lua:
Code: Select all
if data.raw.mod["Industrio"] then
require("prototypes.recipe.industrio")
require("prototypes.recipe.recycling-industrio")
else return
end
Code: Select all
if mod.Industrio then --[[Industrio Compatibility]]--
if ds.craftitemsindustrio[event.itemstack.name] then
for counter, ingredients in pairs(ds.craftitemsindustrio[event.itemstack.name]) do
glob.counter[counter]=glob.counter[counter]+(event.itemstack.count*ingredients)
end
end
end