aboutsummaryrefslogtreecommitdiffstats
path: root/data/mods
diff options
context:
space:
mode:
authorEmil A. Overbeck <emil.a.overbeck@gmail.com>2026-07-19 04:19:48 +0200
committerEmil A. Overbeck <emil.a.overbeck@gmail.com>2026-07-19 04:19:48 +0200
commit521b5da83485a956811fc510cba9f139acad8b26 (patch)
tree29b210263300479e9a565af568812c5e707d23f7 /data/mods
parentff85499d5567c36ce63e2d7903d5f872fd9aef1d (diff)
downloadforts_clone-521b5da83485a956811fc510cba9f139acad8b26.tar.gz
forts_clone-521b5da83485a956811fc510cba9f139acad8b26.zip
New maps and map selectormain
Diffstat (limited to 'data/mods')
-rw-r--r--data/mods/enemy-fort/map.lua3
-rw-r--r--data/mods/enemy-fort/maps.lua21
-rw-r--r--data/mods/enemy-fort/mod.lua3
-rw-r--r--data/mods/enemy-fort/structures.lua19
4 files changed, 23 insertions, 23 deletions
diff --git a/data/mods/enemy-fort/map.lua b/data/mods/enemy-fort/map.lua
deleted file mode 100644
index 443b74b..0000000
--- a/data/mods/enemy-fort/map.lua
+++ /dev/null
@@ -1,3 +0,0 @@
--- The enemy fort's reactor (team 1). Sits inside the fort (columns x=25..29).
--- Destroy it to win.
-table.insert(MapDevices, { type = "reactor", x = 27, y = 3.0, team = 1 })
diff --git a/data/mods/enemy-fort/maps.lua b/data/mods/enemy-fort/maps.lua
new file mode 100644
index 0000000..4f748ae
--- /dev/null
+++ b/data/mods/enemy-fort/maps.lua
@@ -0,0 +1,21 @@
+-- Layered-modding demo: this runs AFTER data/maps.lua, so it can reach into a
+-- map the base game defined and change it. Here we bolt an extra armour skin
+-- onto the Proving Ground enemy fort, making it a tougher target.
+--
+-- A mod could equally `table.insert(Maps, { ... })` to ship a whole new map;
+-- see data/maps.lua for the shape of an entry.
+
+local m = FindMap("Proving Ground")
+if m then
+ table.insert(m.structures, {
+ name = "enemy outer plating",
+ beams = {
+ -- a second armoured skin one unit in front of the fort's face,
+ -- tied back to it so the whole thing stays triangulated
+ {24,1,24,3,"armour"}, {24,3,24,5,"armour"},
+ {24,1,25,1,"wood"}, {24,3,25,3,"wood"}, {24,5,25,5,"wood"},
+ {24,1,25,3,"wood"}, {24,3,25,5,"wood"},
+ },
+ })
+ m.description = m.description .. " (+ enemy-fort mod plating)"
+end
diff --git a/data/mods/enemy-fort/mod.lua b/data/mods/enemy-fort/mod.lua
index b2bc990..01a6b42 100644
--- a/data/mods/enemy-fort/mod.lua
+++ b/data/mods/enemy-fort/mod.lua
@@ -1,4 +1,5 @@
--- Scenario mod: a prebuilt enemy fort on the right for the player to shoot at.
+-- Scenario mod: reinforces the Proving Ground enemy fort with extra armour
+-- plating. Doubles as the worked example of layered map modding (maps.lua).
Selectable = true
Priority = 5
Category = "Scenario"
diff --git a/data/mods/enemy-fort/structures.lua b/data/mods/enemy-fort/structures.lua
deleted file mode 100644
index ce6bdd0..0000000
--- a/data/mods/enemy-fort/structures.lua
+++ /dev/null
@@ -1,19 +0,0 @@
--- A triangulated wooden fort on the right side (columns at x=25,27,29; rows at
--- y=1,3,5). Foundations sit on the ground (y=1). All beams <= 3 units so they
--- obey the material length limits. Shoot it apart with the cannon.
-table.insert(Structures, {
- name = "enemy fort",
- beams = {
- -- verticals
- {25,1,25,3,"wood"}, {25,3,25,5,"wood"},
- {27,1,27,3,"wood"}, {27,3,27,5,"wood"},
- {29,1,29,3,"wood"}, {29,3,29,5,"wood"},
- -- horizontals
- {25,1,27,1,"wood"}, {27,1,29,1,"wood"},
- {25,3,27,3,"wood"}, {27,3,29,3,"wood"},
- {25,5,27,5,"wood"}, {27,5,29,5,"wood"},
- -- diagonals (triangulation, so it's rigid)
- {25,1,27,3,"wood"}, {27,1,29,3,"wood"},
- {25,3,27,5,"wood"}, {27,3,29,5,"wood"},
- },
-})