Devilishness with a code
Posted: Sun Nov 24, 2024 6:33 pm
I have some kind of devilry going on with the code.
I'm trying to remove the unlocking of recipes in the game's technologies and other mods.
I use a special code for this. Example:
With vanilla technologies it works quite well... But with mods some devilry starts!!!
For example, in the chemical-rocket mod https://mods.factorio.com/mod/chemical-rocket/ it says:
I'm trying to delete these recipes:
But instead of deleting them, recipe = "explosive-rocket" is deleted
What the hell?""""!!!!!!!
I'm trying to remove the unlocking of recipes in the game's technologies and other mods.
I use a special code for this. Example:
Code: Select all
if data.raw.technology["explosive-rocketry"] then
for i = 1, #data.raw.technology["explosive-rocketry"].effects do
effect = data.raw.technology["explosive-rocketry"].effects[i]
if effect.type == "unlock-recipe" and effect.recipe == "flamethrower-ammo" then
index = i
end
end
table.remove(data.raw.technology["explosive-rocketry"].effects, index)
end
For example, in the chemical-rocket mod https://mods.factorio.com/mod/chemical-rocket/ it says:
Code: Select all
local technology = data.raw.technology["explosive-rocketry"]
table.insert(technology.effects, {type = "unlock-recipe", recipe = "chemical-rocket"})
table.insert(technology.effects, {type = "unlock-recipe", recipe = "incendiary-rocket"})
table.insert(technology.effects, {type = "unlock-recipe", recipe = "flamethrower-ammo"})
Code: Select all
if mods["chemical-rocket"] then
if data.raw.technology["explosive-rocketry"] then
for i = 1, #data.raw.technology["explosive-rocketry"].effects do
effect = data.raw.technology["explosive-rocketry"].effects[i]
if effect.type == "unlock-recipe" and effect.recipe == "chemical-rocket" then
index = i
end
end
table.remove(data.raw.technology["explosive-rocketry"].effects, index)
end
if data.raw.technology["explosive-rocketry"] then
for i = 1, #data.raw.technology["explosive-rocketry"].effects do
effect = data.raw.technology["explosive-rocketry"].effects[i]
if effect.type == "unlock-recipe" and effect.recipe == "incendiary-rocket" then
index = i
end
end
table.remove(data.raw.technology["explosive-rocketry"].effects, index)
end
if data.raw.technology["explosive-rocketry"] then
for i = 1, #data.raw.technology["explosive-rocketry"].effects do
effect = data.raw.technology["explosive-rocketry"].effects[i]
if effect.type == "unlock-recipe" and effect.recipe == "flamethrower-ammo" then
index = i
end
end
table.remove(data.raw.technology["explosive-rocketry"].effects, index)
end
end
What the hell?""""!!!!!!!