Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 2.4.0
Date: 15. 10. 2025
Features:
- Updated to 2.0.69
---------------------------------------------------------------------------------------------------
Version: 2.3.8
Date: 14. 05. 2021
Bugfixes:
Expand Down
8 changes: 4 additions & 4 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ require 'remote'

-- on load game for first time or when settings change
function init()
if not global.forcefields then
global.forcefields = {}
if not storage.forcefields then
storage.forcefields = {}
end
global.forcefields.version = ConfigChanges.currentVersion
storage.forcefields.version = ConfigChanges.currentVersion
end

script.on_init(function(_)
Expand All @@ -35,7 +35,7 @@ end)
-- on loading the map
script.on_event(defines.events.on_tick, nil)
script.on_load(function(event)
if global.forcefields and global.forcefields.ticking then
if storage.forcefields and storage.forcefields.ticking then
script.on_event(defines.events.on_tick, function(_) Emitter:onTick() end)
end
end)
Expand Down
8 changes: 4 additions & 4 deletions info.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "ForceFields2",
"version": "2.3.8",
"factorio_version": "1.1",
"version": "2.4.0",
"factorio_version": "2.0",
"title": "Force Fields",
"author": "lovely_santa",
"homepage": "https://mods.factorio.com/mod/ForceFields2",
"description": "Adds multiple types of electric powered, self healing walls to keep the biters out.",
"dependencies": [
"base >= 1.1.1",
"LSlib >= 2020.11.26"
"base >= 2.0.69",
"LSlib >= 2025.10.15"
]
}
4 changes: 2 additions & 2 deletions prototypes/entity/forcefield-builder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function forcefieldWallEntity(color)
table.insert(forcefieldWall.flags, "not-repairable")
table.insert(forcefieldWall.flags, "not-blueprintable")
table.insert(forcefieldWall.flags, "not-deconstructable")
table.insert(forcefieldWall.flags, "hidden")
forcefieldWall.hidden = true
table.insert(forcefieldWall.flags, "not-upgradable")
table.insert(forcefieldWall.flags, "no-copy-paste")

Expand Down Expand Up @@ -98,7 +98,7 @@ function forcefieldGateEntity(color)
table.insert(forcefieldGate.flags, "not-repairable")
table.insert(forcefieldGate.flags, "not-blueprintable")
table.insert(forcefieldGate.flags, "not-deconstructable")
table.insert(forcefieldGate.flags, "hidden")
forcefieldGate.hidden = true
table.insert(forcefieldGate.flags, "not-upgradable")
table.insert(forcefieldGate.flags, "no-copy-paste")

Expand Down
11 changes: 9 additions & 2 deletions prototypes/gui/styles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,15 @@ LSlib.styles.addFlowStyle{
name = guiSettings["guiTableRowHeaderFlowStyle"],
parent = "flow",

margin = 0,
padding = 0,
top_margin = 0,
bottom_margin = 0,
left_margin = 0,
right_margin = 0,

top_padding = 0,
bottom_padding = 0,
left_padding = 0,
right_padding = 0,
horizontaly_strechable = true,
}

Expand Down
12 changes: 2 additions & 10 deletions prototypes/item/forcefield-builder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ function forcefieldWallItem(color)
forcefieldWall.icon = nil
forcefieldWall.icons = LSlib.item.getIcons("item", "stone-wall", nil, nil, colorTint)

if forcefieldWall.flags then
table.insert(forcefieldWall.flags, "hidden")
else
forcefieldWall.flags = { "hidden" }
end
forcefieldWall.hidden = true

forcefieldWall.order = string.format("f[forcefields]-b[field]-%s[%s]-a[wall]", settings.order, color)
forcefieldWall.subgroup = "forcefield"
Expand Down Expand Up @@ -59,11 +55,7 @@ function forcefieldGateItem(color)
forcefieldGate.icon = nil
forcefieldGate.icons = LSlib.item.getIcons("item", "gate", nil, nil, colorTint)

if forcefieldGate.flags then
table.insert(forcefieldGate.flags, "hidden")
else
forcefieldGate.flags = { "hidden" }
end
forcefieldGate.hidden = true

forcefieldGate.order = string.format("f[forcefields]-b[field]-%s[%s]-b[gate]", settings.order, color)
forcefieldGate.subgroup = "forcefield"
Expand Down
16 changes: 8 additions & 8 deletions prototypes/recipe/emitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ data:extend{
name = emitterSettings.emitterName,
energy_required = 5,
ingredients = {
{"steel-plate", 50},
{"battery", 200},
{"advanced-circuit", 20},
{"small-lamp", 4},
{type = "item", name = "steel-plate", amount = 50},
{type = "item", name = "battery", amount = 200},
{type = "item", name = "advanced-circuit", amount = 20},
{type = "item", name = "small-lamp", amount = 4},
},
result = emitterSettings.emitterName,
enabled = "false",
always_show_made_in = "true",
allow_decomposition = "false",
results = {{type = "item", name = emitterSettings.emitterName, amount = 1}},
enabled = false,
always_show_made_in = true,
allow_decomposition = false,
}
}
24 changes: 12 additions & 12 deletions prototypes/recipe/forcefield-builder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function forcefieldWallRecipe(color)
data:extend{{
type = "recipe",
name = string.format(settings.name, "wall", color),
enabled = "false",
enabled = false,

localised_name = {"entity-name."..string.format(settings.name, "wall", color)},
localised_description = (not settings.manualPlaceable) and {"",
Expand All @@ -25,15 +25,15 @@ function forcefieldWallRecipe(color)
ingredients = {},
energy_required = math.floor(settings.properties.respawnRate * emitter.tickRate / 60 * 100)/100,

allow_decomposition = "false",
allow_as_intermediate = "false",
hide_from_stats = "true",
allow_decomposition = false,
allow_as_intermediate = false,
hide_from_stats = true,

results = {},
always_show_products = "false",
always_show_products = false,

category = emitter["crafting-category"],
always_show_made_in = "true",
always_show_made_in = true,
}}

end
Expand All @@ -49,7 +49,7 @@ function forcefieldGateRecipe(color)
data:extend{{
type = "recipe",
name = string.format(settings.name, "gate", color),
enabled = "false",
enabled = false,

localised_name = {"entity-name."..string.format(settings.name, "gate", color)},
localised_description = (not settings.manualPlaceable) and {"",
Expand All @@ -67,15 +67,15 @@ function forcefieldGateRecipe(color)
ingredients = {},
energy_required = math.floor(settings.properties.respawnRate * emitter.tickRate / 60 * 100)/100,

allow_decomposition = "false",
allow_as_intermediate = "false",
hide_from_stats = "true",
allow_decomposition = false,
allow_as_intermediate = false,
hide_from_stats = true,

results = {},
always_show_made_in = "true",
always_show_made_in = true,

category = emitter["crafting-category"],
always_show_made_in = "true",
always_show_made_in = true,
}}

end
16 changes: 8 additions & 8 deletions prototypes/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,19 @@ prototypeSettings["blue"] =
["manualPlaceable"] = false,
["wallTechnology"] = prototyping and {
["additionalPrerequisites"] = {
"optics",
"lamp",
"stone-wall",
"military-2",
"advanced-electronics",
"advanced-circuit",
"battery",
},
["additionalEffects"] = {
{type = "unlock-recipe", recipe = prototypeSettings["emitter"].emitterName}
},
["technologyRecipe"] = {
["count"] = math.floor( 0.5 + 2.5 * data.raw["technology"]["advanced-electronics"].unit.count),
["ingredients"] = util.table.deepcopy(data.raw["technology"]["advanced-electronics"].unit.ingredients),
["time"] = 2 * data.raw["technology"]["advanced-electronics"].unit.time,
["count"] = math.floor( 0.5 + 2.5 * data.raw["technology"]["advanced-circuit"].unit.count),
["ingredients"] = util.table.deepcopy(data.raw["technology"]["advanced-circuit"].unit.ingredients),
["time"] = 2 * data.raw["technology"]["advanced-circuit"].unit.time,
},
},
["gateTechnology"] = prototyping and {
Expand All @@ -105,9 +105,9 @@ prototypeSettings["blue"] =

},
["technologyRecipe"] = {
["count"] = math.floor( 0.5 + 0.5 * (2.5 * data.raw["technology"]["advanced-electronics"].unit.count)),
["ingredients"] = util.table.deepcopy(data.raw["technology"]["advanced-electronics"].unit.ingredients),
["time"] = 2 * data.raw["technology"]["advanced-electronics"].unit.time,
["count"] = math.floor( 0.5 + 0.5 * (2.5 * data.raw["technology"]["advanced-circuit"].unit.count)),
["ingredients"] = util.table.deepcopy(data.raw["technology"]["advanced-circuit"].unit.ingredients),
["time"] = 2 * data.raw["technology"]["advanced-circuit"].unit.time,
},
},
}
Expand Down
14 changes: 7 additions & 7 deletions remote.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ remote.add_interface("forcefields", {

-- reset removes all entities from the surface and re-init
reset = function()
global.forcefields.emitters = nil
global.forcefields.fields = nil
global.forcefields.searchDamagedPos = nil
global.forcefields.activeEmitters = nil
global.forcefields.degradingFields = nil
global.forcefields.ticking = nil
global.forcefields.emitterConfigGUIs = nil
storage.forcefields.emitters = nil
storage.forcefields.fields = nil
storage.forcefields.searchDamagedPos = nil
storage.forcefields.activeEmitters = nil
storage.forcefields.degradingFields = nil
storage.forcefields.ticking = nil
storage.forcefields.emitterConfigGUIs = nil
script.on_event(defines.events.on_tick, nil)

for k,surface in pairs(game.surfaces) do
Expand Down
Loading