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.

Topics - UristVanHelsing

Pages: [1]
1
Recently I decided to use the blueprint command to help designate the walls for my aboveground towers. I tried to record the designations once they were finished, but the CSV came out really weird. When I played it back in quickfort, it originally complained that "CW" was an invalid key sequence. I did a find and replace to change it to "Cw". After that, the designation that I had copied (a simple 33-diameter circle) came out all oval-y and weird. Could this be because I'm using a square tileset (I don't think so, but it's the most recent thing in the game that I modified)?

2
DF Modding / Modded interaction not being recognized
« on: January 14, 2021, 03:42:01 pm »
I wanted to create a custom "Witcher" caste that has the propel power present in some undead lieutenants. So, I did this is creature_standard:
Code: [Select]
[CASTE:WITCHER]
[MALE]
[NAME:witcher:witchers:witcher]
[SET_BP_GROUP:BY_TYPE:LOWERBODY][BP_ADD_TYPE:GELDABLE]
[BODY_DETAIL_PLAN:FACIAL_HAIR_TISSUE_LAYERS]
[CAN_DO_INTERACTION:AARD]
[CDI:ADV_NAME:Propel away]
[CDI:TARGET:B:LINE_OF_SIGHT]
[CDI:TARGET_RANGE:B:25]
[CDI:BP_REQUIRED:BY_TYPE:GRASP]
[CDI:USAGE_HINT:ATTACK]
[CDI:VERB:point:points:NA]
[CDI:MAX_TARGET_NUMBER:B:1]
[CDI:WAIT_PERIOD:50]
[POP_RATIO:0]

and this is my own file, interaction_new:
Code: [Select]
interaction_new

[OBJECT:INTERACTION]

[INTERACTION:AARD]
[I_SOURCE:CREATURE_ACTION]
[I_TARGET:A:LOCATION]
[IT_LOCATION:CONTEXT_LOCATION]
[I_TARGET:B:CREATURE]
[IT_LOCATION:CONTEXT_CREATURE]
[IT_MANUAL_INPUT:target]
[I_EFFECT:PROPEL_UNIT]
[IE_PROPEL_FORCE:100000]
[IE_TARGET:A]
[IE_TARGET:B]
[IE_IMMEDIATE]

When I run the game, the error log spits out:
Code: [Select]
*** Error(s) finalizing the creature HUMAN
Interaction Token not recognized : AARD

Why is this? Everything looks normal as far as I can tell.

3
DF Modding / Spawning a demon binding slab
« on: January 12, 2021, 12:02:21 am »
I am a DF adventure mode veteran, and I recently took my current adventurer to conquer a vault. When I got to the end of the vault, there was no slab. I am aware that this is a known bug, but I know a little bit about DFhack modding and using gui/em-editor, so I thought I would write a script to fix it. So, I looked up the artifact ID using legends and used gm-editor to get the item_slabst reference from there. After that, I wrote this little script to spawn in the slab:
Code: [Select]
local slab = df.item_slabst.find(4)

local pos = copyall(df.global.cursor)
dfhack.items.moveToGround(slab,{x=pos.x,y=pos.y,z=pos.z})

It doesn't produce any error, but the slab doesn't spawn. What's the issue here?

Thanks

4
After visiting 10 necro towers and not finding the secrets of life and death, I decided to spawn them in. The script below is heavily based on the script from http://97.107.128.126/smf/index.php?topic=169149.0

I did some updating so it works with the latest version of DF (.47.04 as of this post). Copy/paste the script into a file called secrets.lua (or whatever) in your hack/scripts directory. Then, just point the cursor where you want the book to spawn and run the command:
Code: [Select]
secrets -material_id INORGANIC:SILVER -booktitle_name "The Necronomicon"
Code: [Select]
--Author: UristVanHelsing
--Heavily based on the amazing work done by Atomic Chicken, Meph, and Burrito25man
--Version: 0.44.XX

local utils = require 'utils'

validArgs = validArgs or utils.invert({
 'material_id',
 'booktitle_name',
 'copy',
 'help'})

local args = utils.processArgs({...}, validArgs)

local artifact = true

if args.help then
 print([[ secrets.lua
 This script is designed to work with a reaction to spawn the secrets of life and death.

 arguments:
 
 -material_id
  Material book will be made of.
 
 -booktitle_name
  Title of the book to be made. String must be contained within ' ' .
 
 -copy
  If this optional argument is included, the script will make the book be treated as a copy

  To use:
 
  Place the cursor where you want the book and run the below command
  secrets -material_id INORGANIC:SILVER -booktitle_name "The Necronomicon"

 ]])
 return
end
 
local material_id = args.material_id
local booktitle_name = args.booktitle_name
local secret_id = 'the secrets of life and death'

if not args.material_id then error 'ERROR: material_id not specified.' end
if not args.booktitle_name then error 'ERROR: booktitle_name not specified.' end
if not args.secret_id then error 'ERROR: secret_id not specified.' end
if args.copy then artifact = false end

function getSecretId(secret_id)
  for _,i in ipairs(df.global.world.raws.interactions) do
    for _,is in ipairs (i.sources) do
      if getmetatable(is) == 'interaction_source_secretst' then
        if is.name == secret_id then
          return i.id
        end
      end
    end
  end
end

local pages = math.random(169,666)
local style = math.random(0,18)

function createWriting(booktitle_name,secret_id)
  local w = df.written_content:new()
  w.id = df.global.written_content_next_id
  w.title = booktitle_name
  w.page_start = 1
  w.page_end = pages --number of pages
  w.styles:insert('#',style) --writing style
  w.style_strength:insert('#',0) --'the writing drives forward relentlessly'
  w.poetic_form = 50 --'the prose is masterful'
 
  local ref = df.general_ref_interactionst:new()
  ref.interaction_id = getSecretId(secret_id)
  ref.source_id = 0
  ref.unk_08 = -1
  ref.unk_0c = -1
  w.refs:insert('#',ref)
  w.ref_aux:insert('#',0)
 
  df.global.written_content_next_id = df.global.written_content_next_id+1
  df.global.world.written_contents.all:insert('#',w)
  return w.id
end

local m = dfhack.matinfo.find(material_id)
if not m then
  error('Invalid material.')
end

local book = df.item_bookst:new()
  book.id = df.global.item_next_id
  df.global.world.items.all:insert('#',book)
  df.global.item_next_id = df.global.item_next_id+1
  book:setMaterial(m['type'])
  book:setMaterialIndex(m['index'])
  book:categorize(true)
  book.flags.removed = true
  book:setSharpness(0,0)
  book:setQuality(0)
  book.title = booktitle_name

local imp = df.itemimprovement_pagesst:new()
  imp.mat_type = m['type']
  imp.mat_index = m['index']
  imp.count = pages --number of pages
  imp.contents:insert('#',createWriting(booktitle_name,secret_id))
  book.improvements:insert('#',imp)

if artifact == true then
  local a = df.artifact_record:new()
  a.id = df.global.artifact_next_id
  df.global.artifact_next_id = df.global.artifact_next_id+1
  a.item = book
  a.name.first_name = booktitle_name
  a.name.has_name = true
  a.flags:assign(df.global.world.artifacts.all[0].flags)
  a.anon_1 = -1000000
  a.anon_2 = -1000000
  a.anon_3 = -1000000
  df.global.world.artifacts.all:insert('#',a)
  local ref = df.general_ref_is_artifactst:new()
  ref.artifact_id = a.id
  book.general_refs:insert('#',ref)
 
  df.global.world.items.other.ANY_ARTIFACT:insert('#',book)
 
  local e = df.history_event_artifact_createdst:new()
  e.year = df.global.cur_year
  e.seconds = df.global.cur_year_tick
  e.id = df.global.hist_event_next_id
  e.artifact_id = a.id
  df.global.world.history.events:insert('#',e)
  df.global.hist_event_next_id = df.global.hist_event_next_id+1
end
local pos = copyall(df.global.cursor)
dfhack.items.moveToGround(book,{x=pos.x,y=pos.y,z=pos.z})

print('A magical book as been created!')

5
DF Dwarf Mode Discussion / Deisgnate floor grates as fishing area?
« on: December 12, 2019, 09:57:35 pm »
I recently filled my 15x15x3 cistern with water, and I have a hospital with a few wells above one half and a bunch of floor grates on the other half. The problem is I can't designate the floor grates as a fishing zone. When I try, it just says "Fishing (0)" in the zones menu. I'm fairly certain this is possible (I believe I've done it before). Is there anything I'm doing wrong?

6
DF Adventure Mode Discussion / HFS Lag
« on: December 08, 2019, 11:05:07 pm »
How do you handle HFS lag? I've been using DFHack to mass genocide beak dogs, goblin, and trolls. If I don't, the lag is relentless. Any tips?

7
DF Adventure Mode Discussion / Adventure Mode Sites
« on: December 08, 2019, 11:05:35 am »
Can I leave a companion at a site that I build and then come back for them? I have a demon bound to me, but he's a huge asshole sometimes and I'd like to leave him behind on select missions. I'd also love to make other sites and store my other demons there so they don't fight each other. Is this possible?

8
I play a lot of adventure mode, and recently I wanted to try my hand at playing instruments. So I found myself a nice masterwork spotug and tried to play in a logical way, pressing "I" for Advanced Interaction. Funnily enough, the only option was to name it. I assume that there is a way to do this, and I'm just missing it. Please enlighten me, O dwarf gods of the forums.

Pages: [1]