This is a DFHack script that simulates an invasion that gets more difficult based on wealth and pop.
https://github.com/danamlund/scripts/blob/master/outsider-invasion.luaUsage:
1) download outsider-invasion.lua to your dwarf_fortress/hack/scripts/ folder.
2) In your dfhack console type:
outsider-invasion -now
3) For more options type:
outsider-invasion -help
This will spawn a random type of invasion with number of invaders, equipment, and skills that are scaled to the wealth and pop of your fortress.
Types of invasions:
1) goblins: Goblins and trolls with metal weapons and metal armor.
2) elves: Elves with wooden weapons and armor. Very high skills to compensate for poor equipment.
3) semimegabeasts: An invasion of either minotaurs, ettin, cyclops, or giants. Not balanced very well.
Challenge:
My newish 40 strong military handled a -strength 1000 goblins invasion with only a few casualties.
outsider-invasion -invasion-type goblins -cap 200 -now -strength 1000
How much fun can your military handle?
Bugs:
- It crashes dwarf fortress quite regularly.
- More laggy than regular invasions.
- I only got CAN_LEARN or INTELLIGENT units to work together (so no cave dragons and unicorns). And I could not get the semimegabeasts to work together either.
- Building destroyers do not destroy buildings.
- Balance, both risk and rewards.
Help:
I would love to get feedback on the code. (Maybe reduce crashes)
Help with balance issues.
I would also like saves with a visit from the different semimegabeasts. (so far I have just guessed at their skills/equipment)
DFHack tricks used:
I spawn units that attack the fortress and not each other by setting these flags:
unit.flags1.marauder = true
unit.flags1.active_invader = true
unit.flags1.invader_origin = true
unit.flags1.invades = true
unit.flags1.hidden_ambusher = true
And when I want them to flee I only set:
marauder = true
Other features:
You can spawn in an invasion in arena mode under your cursor. You can see goblins vs elves (or elves vs themselves if you forget to set '-arena-side <number>').
You can auto spawn an invasion every 12 months by adding the following line to your dwarf_fortress/dfhack.init (This is not recommended due to frequent crashes):
outsider-invasion -every-months 12
Design your own invasion. I hope the code is clean enough that you can figure out how to create your own invasion challenge. And I would love to see what you come up with.