Code: Select all
remote.add_interface(interface_name, table_of_functions)
Code: Select all
remote.add_interface(interface_name, table_of_functions)
Code: Select all
if remote.interfaces.modA and remote.interfaces.modB then
Code: Select all
if data.raw["item"]["item-from-modA"] and data.raw["item"]["item-from-modB"] then
after the then on the data.raw what would I do to create the entity, item, and recipe for the new turret? as well as add it to a technology?Choumiko wrote:If both mods have a remote interface it will work:but since you're talking about adding a turret i think you want this to happen in data.lua? data.lua doesn't have remote available, so you'll have to check data.raw for items/turrets added by these 2 mods. And add them as optional depenencies, so they are loaded before your mod (or do it in data-updates.lua)Code: Select all
if remote.interfaces.modA and remote.interfaces.modB then
Code: Select all
if data.raw["item"]["item-from-modA"] and data.raw["item"]["item-from-modB"] then
okay, so I'm probably doing this wrong, but it keeps saying the item I'm trying to index is a nil value.Choumiko wrote:Code: Select all
if data.raw["item"]["item-from-modA"] and data.raw["item"]["item-from-modB"] then
Code: Select all
if data.raw["charge-pack"]["advanced-weaponry"] then
Oh, that makes a bit more sense, its not an item name it the item type?prg wrote:"charge-pack" is not a valid type defined by the game. You can't just put something you made up yourself there. What is the prototype you're trying to access?