1
Roll To Dodge / Re: Tower of Makhios - Turn 2 (8/8, waitlist open)
« on: May 09, 2023, 09:20:23 am »
(PTW)
May 9, 2024: The May '24 Report is up.
News: April 23, 2024: Dwarf Fortress 50.13 has been released.
News: February 4, 2021: Dwarf Fortress Talk #28 has been posted.
News: November 21, 2018: A new Threetoe story has been posted.
Forum Guidelines
Facility
- Amazonian Bunker: (5) Kashyyk, m1895, NUKE9.13, ConscriptFive, AC
- Chernobyl Subterranean Complex: ()
- Boston Storage Facility: (3) VermilionSkies, Doomblade, Quarque
- Arctic Habitat: (1) DoubloonSeven
Proposal
A Step Above Rations: (1) VermilionSkies
Secure Containment Procedures: (4) Kashyyk, m1895, NUKE9.13, AC
Behavioral Science Counseling Technician "Biscuit" Ward: (1) ConscriptFive
emergency supplies: (0)
Plan: Open for Business
-Smooth Things Over (the more people like us, the less likely we are to have problems happen)
-Worker Retraining, Smithing (everybody everywhere needs equipment, be it arms and armor or tools for working; with how many skeletons we’ve got, we need it more than most. It also synergizes well with making the mine, though that has to wait for next turn.)
-Lianna starts Recruiting a Coven (more magic support is helpful, and it gets people with magical potential under our protection)
-Adventure: Reach Out to Rebels with Meaning, Recruitment/Alliance (we seem likely to need to defend ourselves from the Church, and if we’re not building an army with actions, we may as well see about recruiting one via adventure)
-- Change the age of a creature.
-- Author: Atomic Chicken
-- to do: set profession appropriately when making somebody grow up
local createUnit = reqscript('modtools/create-unit')
local utils = require 'utils'
local validArgs = utils.invert({
'unit',
'age'
})
local args = utils.processArgs({...}, validArgs)
if not args.age then
qerror("Age not specified!")
end
local unit = args.unit and df.unit.find(tonumber(args.unit)) or dfhack.gui.getSelectedUnit()
if not unit then
if args.unit then
qerror("Invalid unit ID: " .. tostring(args.unit))
else
qerror("You must either select the target creature prior to running this script, such as by viewing its description, or specify it via the -unit argument followed by its unit ID.")
end
end
if unit.profession == df.profession.BABY or unit.profession == df.profession.CHILD then
unit.profession = df.profession.STANDARD -- clear the Child/Baby profession in case we're making somebody grow up. Would be ideal to make the script set profession appropriately later on.
local hf = df.historical_figure.find(unit.hist_figure_id)
if hf then
hf.profession = df.profession.STANDARD
end
end
createUnit.setAge(unit, tonumber(args.age))
createUnit.induceBodyComputations(unit)
set-unit-age -age 10
-- Create a secret-conveying slab at the cursor position.
-- Author: Atomic Chicken
--@module = true
--[====[
gui/create-secret-slab
======================
A graphical interface for creating slabs that are capable of conveying
an I_SOURCE:SECRET interaction to readers.
Place the cursor wherever you want the slab to appear and run the script.
You will then be asked to select the slab's material and quality,
to input the text that will appear on the slab
(for example, "the secrets of life and death"),
and to select the secret that it will transfer.
]====]
local dialogs = require 'gui.dialogs'
local script = require 'gui.script'
local createItem = reqscript('gui/create-item')
function createSlab(matType, matIndex, quality, slabText, engravingType, topicID)
local slab = df.item_slabst:new()
slab.id = df.global.item_next_id
slab:setMaterial(matType)
slab:setMaterialIndex(matIndex)
slab:setQuality(quality)
slab.engraving_type = engravingType or -1
slab.topic = topicID or -1
slab.description = slabText or ""
df.global.world.items.all:insert('#', slab)
df.global.item_next_id = df.global.item_next_id+1
slab:categorize(true)
slab.flags.removed = true
return slab
end
function guiSpawnSecretSlab()
local pos = copyall(df.global.cursor)
if pos.x < 0 then
qerror("You must first select a location using the cursor.")
end
script.start(function()
local matInputReceived, matType, matIndex, matFilter
matInputReceived, matType, matIndex = createItem.showMaterialPrompt('Select Material', 'What material should the slab be made of?', createItem.matFilter)
if not matInputReceived then
return
end
local qualityInputReceived, quality
qualityInputReceived, quality = script.showListPrompt('Select Quality', 'How high-quality should the slab be?', COLOR_WHITE, createItem.qualityTable())
if not qualityInputReceived then
return
end
local textInputReceived, slabText
textInputReceived, slabText = script.showInputPrompt('Engrave', 'What should be written on the slab?', COLOR_WHITE)
if not textInputReceived then
return
end
local secrets = {}
for _, interaction in ipairs(df.global.world.raws.interactions) do
for _, source in ipairs(interaction.sources) do
if source._type == df.interaction_source_secretst then
local secretName = interaction.name
if source.name ~= "" then
secretName = secretName .. " - " .. source.name
end
table.insert(secrets, {text = secretName, interactionID = interaction.id, search_key = secretName:lower()})
break
end
end
end
dialogs.showListPrompt('Engrave', 'What secret should the slab convey?', COLOR_WHITE, secrets, function(id, choice)
local slab = createSlab(matType, matIndex, quality-1, slabText, df.slab_engraving_type.Secrets, choice.interactionID)
dfhack.items.moveToGround(slab, pos)
end, nil, nil, true)
end)
end
guiSpawnSecretSlab()
modtools/create-unit -race WYVERN -caste MALE -age 200 -location [ 110 119 98 ]
lua printall(df.global.cursor)