We figured out limiting when tunnels are dug by mapScripts, an example of using the same mapScript to do both underground bases with tunnels and above ground bases without for anyone interested:
mapScripts:
- type: XBASE
commands:
#*** normal facility placing happens here, before anything else
#*** figure out if this is a normal base or an outpost
- type: fillArea # mask off everything for the checkblock
groups: [6]
- type: checkBlock # check the map for which type of lift we placed
rects:
- [0, 0, 6, 6]
groups: [7] # or whichever group we set the outpost to
label: 1
- type: removeBlock # remove the mask
groups: [6]
rects:
- [0, 0, 6, 6]
#*** this is a normal base, dig some tunnels and fill in with dirt
- type: digTunnel
conditionals: [-1]
direction: both
tunnelData:
level: 1
MCDReplacements:
- type: westWall
set: 1
entry: 13
- type: northWall
set: 1
entry: 14
- type: fillArea
conditionals: [-1]
blocks: 20
#*** this is an above-ground outpost, don't dig and fill in with above-ground stuff
- type: fillArea
conditionals: [1]
groups: [8] # or whatever we want to do for above-ground stuff