Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Atomic Chicken

Pages: [1] 2 3 ... 35
1
Roll To Dodge / Re: Tower of Makhios - Turn 2 (8/8, waitlist open)
« on: May 09, 2023, 09:20:23 am »
(PTW)

2
Quote from: Vote Box
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)

3
Forum Games and Roleplaying / Re: Lich King: Beginnings (SG)
« on: August 06, 2022, 11:26:47 pm »
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)

+1

4
BC

5
Forum Games and Roleplaying / Re: Of Seals and Trumpets: Angel SG
« on: April 25, 2022, 10:40:50 am »
The Sorceress of the Mountain

6
DF General Discussion / Re: Using DFHack Gm-Editor to rename civs?
« on: January 07, 2022, 12:03:43 pm »
This is what you're after:
Code: [Select]
df.global.world.entities.all

7
Forum Games and Roleplaying / Re: [Suggestion game]Choice of Magics
« on: November 23, 2021, 04:02:14 pm »
1

8
Forum Games and Roleplaying / Re: [Suggestion game]Choice of Magics
« on: November 14, 2021, 03:24:10 am »
5

9
Forum Games and Roleplaying / Re: [Suggestion game]Choice of Magics
« on: November 13, 2021, 02:07:41 pm »
2

10
DF Community Games & Stories / Re: Museum III, adventure succession game
« on: August 05, 2021, 09:58:06 pm »
Work's consuming all of my energy at the moment; I'm going to have to pass on this turn to the next person on the list.

11
Loaded a save to actually test it, with the result of spotting and fixing a small typo. It should work now, at least for your purposes (converting children into adults isn't fully supported yet; their profession needs to be set appropriately in place of the Child/Baby status, which the function in create-unit does not currently handle, so they'll initially be labelled as Peasants regardless of the skills they might possess).

12
Here's a quick draft of one:

Code: [Select]
-- 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)

This was a fairly simple task as modtools/create-unit already has an age modifying function. However, I threw it together on my phone and haven't had the opportunity to test it out yet, so don't be surprised if it shoots an error at you when you try to use it. Edit: now tested. I've also omitted a -help printout for now.

To use:
- Install DFHack if you've not done so already.
- Copy-paste the above code into a text editor.
- Save it as a .lua file within the \hack\scripts folder.
- When playing, select the creature whose age you want to alter (in adventure mode, this is most easily done by viewing its description, but I've also made it possible to specify the target via its unit ID following a -unit argument as per convention) and enter [whatever it was that you named the file when saving it] as a command in the DFHack console followed by -age and your desired age in years.

Example (with the unit selected):
Code: [Select]
set-unit-age -age 10
Alternatively, you could locate a child and use bodyswap or unretire-anyone to turn them into a player character.

13
I'm thrilled to see that the Museum is still going strong after nearly a decade since the inception of its original incarnation! Lots to catch up on here, but I'd like to sign up for a turn once again.

In addition, Bralbaard, might I suggest adding links to the previous games in the first post of this thread?

14
Utilities and 3rd Party Applications / Re: Necromancer Script help
« on: May 21, 2021, 03:34:33 pm »
Here's an updated version, now embellished with a gui:

Code: [Select]
-- 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()

To use:
- Install DFHack if you've not done so already.
- Copy-paste the above code into a text editor.
- Save it as a .lua file within the \hack\scripts folder.
- When playing, point the cursor wherever you want the slab to appear and enter [the name you assigned to the file when saving it] as a command in the DFHack console.

15
DF Modding / Re: how to spawn units and get tile coordinates?
« on: April 29, 2021, 07:54:10 am »
Questions related to DFHack scripts should be posted in the Utilities and 3rd Party Applications subforum since they're more likely to be missed elsewhere, as was the case here.

The main issue with your command is that the coordinates need to be enclosed in square brackets as such:
Code: [Select]
modtools/create-unit -race WYVERN -caste MALE -age 200 -location [ 110 119 98 ]

As a modtools script, this was primarily designed to receive -location coordinates from scripts like modtools/reaction-trigger, which is why it currently lacks cursor support. Until an option to obtain the coordinates directly from the cursor is implemented, you may retrieve these manually by selecting the target location with your cursor and entering the following into the DFHack console:

Code: [Select]
lua printall(df.global.cursor)

Pages: [1] 2 3 ... 35