I also like to use the Dytec Warfare mod, this adds 11 new laser turrets and 3 new wall types
thats a lot of additions to a couple of already large if statements, in addition we only want them active when the dytech warfare mod is .. so in addition to my last post here is the code iv used to integrate Dytech Warfare into the previous tweak. It should also be expandable to just about any entity or mod people want to integrate to the FARL blueprint system.
using FARL version 0.2.3
control.lua
Code: Select all
glob.cruiseSpeed = glob.cruiseSpeed or 0.4
--create a global variable (table) for all entity to be recognized in blueprints ~line 200
glob.bpentitys = {"small-lamp","laser-turret","stone-wall"}
-- add to the above table the additional entity's to be recognized from dytech using laserturret2 because dytech no longer has a warfare interface and the dytech-core to make sure its dytech installed and not another mod
if game.interfaces["DyTech-Core"] and game.entityprototypes["laser-turret-2"] then
table.insert(glob.bpentitys, "laser-turret-2")
table.insert(glob.bpentitys, "laser-turret-3")
table.insert(glob.bpentitys, "laser-turret-4")
table.insert(glob.bpentitys, "laser-turret-5")
table.insert(glob.bpentitys, "laser-turret-6")
table.insert(glob.bpentitys, "laser-turret-7")
table.insert(glob.bpentitys, "laser-turret-8")
table.insert(glob.bpentitys, "laser-turret-9")
table.insert(glob.bpentitys, "laser-turret-sniper-1")
table.insert(glob.bpentitys, "laser-turret-sniper-2")
table.insert(glob.bpentitys, "laser-turret-sniper-3")
table.insert(glob.bpentitys, "tungsten-wall")
table.insert(glob.bpentitys, "chitin-wall")
table.insert(glob.bpentitys, "sandwall")
end
-- end mod
for i,farl in ipairs(glob.farl) do
FARL.lua
Code: Select all
--change cargo manifest update to add the pre-approved entity's from the blueprints ~line 436
updateCargo = function(self)
-- removed all blueprint related entity's from the existing list
local types = { "straight-rail", "curved-rail","rail-signal",
"big-electric-pole", "medium-electric-pole", "green-wire", "red-wire"
}
-- create loop to add entity's from global blueprint list to types table
for _,bpentity in pairs(glob.bpentitys) do
table.insert(types, bpentity)
end
-- end mod
****************
-- added new function just before the parseBlueprints function to check entity names against the preset list ~line 488
checkbpentity = function(self,entity)
for _,ventity in ipairs(glob.bpentitys) do
if entity == ventity then
return true
end
end
return false
end,
-- end mod
**************************
-- change if statement from multiple and's to a call to the previously created function, if the name of the entity is on the pre-approved list then the entity will be inserted into the lamps table as per original design
-- ~line 510
if self:checkbpentity(e[i].name) == true then
-- end mod
table.insert(offsets.lamps, {name = e[i].name, direction = e[i].direction, position = e[i].position})
end