|
1 | | -AutoCeiling |
2 | | -============= |
| 1 | +autoceiling |
| 2 | +=========== |
| 3 | + |
| 4 | +.. dfhack-tool:: |
| 5 | + :summary: Place floors above dug areas to seal surface openings. |
| 6 | + :tags: construction automation utility |
| 7 | + |
| 8 | +**AutoCeiling** is a DFHack Lua script that automatically places constructed |
| 9 | +floors above any dug-out area. It uses a flood-fill algorithm to detect connected |
| 10 | +dug tiles on the selected Z-level, then creates planned floor constructions |
| 11 | +directly above them to seal the area. This prevents surface collapse and stops |
| 12 | +creatures from entering your fortress through unexpected openings. It’s |
| 13 | +especially useful when building farms directly below the surface, since those |
| 14 | +areas are prone to collapsing without warning and can leave open spaces that |
| 15 | +allow surface creatures to breach your fort. |
3 | 16 |
|
4 | | -This is a DFHack Lua script for **Dwarf Fortress (Steam version)** that automatically places constructed floors above any dug-out area. It uses a flood-fill algorithm to detect connected dug tiles on the selected Z-level, then creates planned floor constructions directly above them to seal the area. This helps prevent surface collapse and creature intrusion when mining under open ground. |
| 17 | +Usage |
| 18 | +----- |
| 19 | + |
| 20 | +:: |
| 21 | + |
| 22 | + autoceiling [t] [<max>] |
5 | 23 |
|
6 | | -Features |
| 24 | +Examples |
7 | 25 | -------- |
8 | 26 |
|
9 | | -- **Automatic Flood Fill Detection**: Finds all connected dug tiles from the cursor location. |
10 | | -- **Smart Floor Placement**: Builds floors one level above the dug region. |
11 | | -- **Buildingplan Integration**: When the `buildingplan` plugin is active, floors are added as planned constructions and will auto-assign materials. |
12 | | -- **Native DF Construction Support**: Falls back to native designations if `buildingplan` is unavailable. |
13 | | -- **Safety Checks**: Skips tiles that already have player-made constructions or any existing buildings. |
14 | | -- **Parameter Input**: Run `autoceiling t` to enable diagonal flood fill (8-way). Default is 4-way fill. |
15 | | -- **Performance Limit**: Caps flood-fill to a configurable number of tiles (default 4000) for safety. |
| 27 | +``autoceiling`` |
| 28 | + Run with default settings (4,000 tile flood-fill limit, no diagonal fill). |
16 | 29 |
|
17 | | -Usage |
18 | | ------ |
| 30 | +``autoceiling t`` |
| 31 | + Enable diagonal flood-fill connections (8-way fill). |
19 | 32 |
|
20 | | -1. Move the **game cursor** to a dug-out tile at the level you want to seal the ceiling. |
21 | | -2. In the DFHack console, run: |
| 33 | +``autoceiling 500`` |
| 34 | + Raise or lower flood-fill limits. |
22 | 35 |
|
23 | | - ``` |
24 | | - autoceiling |
25 | | - ``` |
26 | | - or, for diagonal (8-way) flood fill: |
27 | | - ``` |
28 | | - autoceiling t |
29 | | - ``` |
| 36 | +``autoceiling t 6000`` or ``autoceiling 6000 t`` |
| 37 | + Allow diagonals and increase fill limit to 6,000 tiles. |
30 | 38 |
|
31 | | -3. The script will automatically: |
32 | | - - Scan connected walkable tiles at the current Z-level. |
33 | | - - Attempt to place floor constructions one Z-level above. |
34 | | - - Report how many tiles were placed and skipped. |
| 39 | +Options |
| 40 | +------- |
35 | 41 |
|
36 | | -4. If the `buildingplan` plugin is active, you’ll see a message confirming planned floor placement. Otherwise, the script will use standard construction designations. |
| 42 | +``t`` |
| 43 | + Enables 8-directional (diagonal) flood fill mode. |
37 | 44 |
|
38 | | -Notes |
39 | | ------ |
| 45 | +``<max>`` |
| 46 | + Sets the maximum number of tiles the flood fill can cover (default: 4000). |
40 | 47 |
|
41 | | -- Ideal for use after large excavation projects to prevent breaches to the surface. |
42 | | -- Works well in conjunction with the **buildingplan** plugin for automatic material management. |
| 48 | +These are the only two options available for this command. Use ``t`` to toggle |
| 49 | +diagonal fill and ``<max>`` to control the tile limit for flood fill. |
0 commit comments