It's code to detect if another mod is also active. I have two mods, Natural_Evolution_Enemies_5.3.2 & Natural_Evolution_Buildings_5.3.2. I want to update a recipe in Enemies, if both mods are running.
I'm using some of bob's functions to do the recipe updates and that part is working fine, it's just the mod detection part that's failing me.
So currently I have my check code look like this:
Code: Select all
--Detect N.E. Enemies
if data.raw["unit"]["small-biter-Mk2"] ~= nil and data.raw["unit"]["small-spitter-Mk2"] ~= nil then
	NEConfig.mod.NEEnemies=true
else 
	NEConfig.mod.NEEnemies=false
end
Code: Select all
if NEConfig.mod.NEEnemies then
	---- Add Alien Toxin as a result if NE Enemies
	bobmods.lib.add_recipe_result ("NE_enhanced-alien-nutrientant", {type="fluid", name="NE_alien_toxin", amount=5})
	
	-- Add Alien Toxin as a ingriedient for Bio Ammo 
	bobmods.lib.remove_recipe_item ("Biological-bullet-magazine", "alien-artifact")
	bobmods.lib.remove_recipe_item ("Biological-bullet-magazine", "sulfuric-acid")
	bobmods.lib.add_new_recipe_item ("Biological-bullet-magazine", {type="fluid", name="NE_alien_toxin", amount=10})
	
end
Code: Select all
if data.raw["item"]["Biological-bullet-magazine"] ~= nil thenWhy!?!
It's already in the data-updates.lua, so both mods should have loaded the data.lua.
Biological-bullet-magazine is there, since it's updating it, so why is the check failing..
I currently can't add NE Enemies in the info.json as a optional load, since I'm doing something in NE Enemies regarding buildings.
This is very frustrating and help would be appreciated. It's probably something very simple that' just slipping my coding talents.
Thanks.



 
 

