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 - burrito25man

Pages: [1] 2 3 4
1
Masterwork DF / Re: Interest in Orc Fortress for vanilla 44.xx?
« on: June 08, 2018, 09:28:36 pm »
Quote from: burrito25man
fix-sentient-butcher

Looks like meat's back on the menu, boys!

Best. Reference. Ever.  :P :P :P

2
Masterwork DF / Re: Interest in Orc Fortress for vanilla 44.xx?
« on: June 02, 2018, 12:23:43 am »
Amazing! Thanks Smake!

3
sorry if i was unclear, i meant would a civ with EAT_SAPIENT_OTHER:ACCEPTABLE eat corpses of their own species with this script

Oh! I see. The way the script is written only creatures not from your current civ will be butchered. So elves can butcher elves from a dwarven civ, but wont touch naturalized goblins.

If you were so inclined, I included a modified version of the script to allow for it. I have no idea what kind of weirdness it would cause though, so modder beware  :P :P

Spoiler (click to show/hide)

4
If a modded civ has different ethics, would they be ok eating any corpse with this script?

It depends on how their ethics are set up (specifically EAT_SAPIENT_OTHER and EAT_SAPIENT_KILL).

I tested this with a modded dwarf civ (EAT_SAPIENT_OTHER and EAT_SAPIENT_KILL were set to REQUIRED) and they chopped up elves with glee. But when I tested it with a vanilla dwarf civ (EAT_SAPIENT_OTHER and EAT_SAPIENT_KILL set to UNTHINKABLE), dead elves we tossed into the refuse pile never to be touched again.

5
DF Modding / Re: [MODDING] CREATURE & ENTITY QUESTIONS THREAD
« on: February 07, 2018, 02:25:34 pm »
Does anyone know a way to make a certain caste of a species not able to be turned into a vampire? i know werebeasts cant, but i have no idea how to do that with a custom creature

you can add

Code: [Select]
[IT_IMMUNE_CREATURE:CREATURE:CASTE]
to the

Code: [Select]
[I_TARGET:A:CREATURE]
part of the vampire interaction

6
Hi! Small thing I noticed: the bookbinder and papermaker professions are MIA for the default dwarf entity file.

7
Tested it out. I can't enable the script at all. The errors are saying something about it having no enable/disable commands.

are you possibly trying:

fix-sentient-butcher enable

because to run it it only needs the the line

fix-sentient-butcher

adding in the enable will case an error

8
I'm not sure how to test it. Do I need to wait for an enemy invader from another civ to test it on fortress mode. I tried running the script in the object testing arena. Haven't tried adventure mode since I don't play that mode very much.

I used fort mode for testing, so I am unsure how the script would function during object testing arena(as the script checks for a current civ association). To check, kill an intelligent creature and run gui/gm-editor on the corpse. This will show you all the flags associated with the corpse.

Under flags2, the dead_dwarf flag should be set to false (if the dead creature isnt part of your current civ).

I used modtools/create-unit to bring in intelligent victims, but technically you can just start killing anyone (such as merchants). As long as they arent part of your civ the script should set that flag to false.

9
I'm seeming to have a problem with the script on the dfhack 44.05 version. The script you posted is refusing to load.

works fine for me as of 44.05. Make sure you change the extension of the file from .txt to .lua, or dfhack won't read it.

10
SUCCESS!!!!!!



1000 thanks Meph!!! Here's the code, for anyone that wants it. I'll change up the posting to make it more official to download later  :D :D :D

Code: [Select]
--Author: Burrito25man
--Based off the amazing work done by Atomic Chicken and Meph for guidance
--Version: 0.44.XX

local utils = require 'utils'

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

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

local artifact = true

if args.help then
 print([[ Spawn spellbook.lua
 This script is designed to work with a reaction to spawn a spellbook.

 arguments:
 
 -material_id
Material book will be made of.

 -booktitle_name
Title of the book to be made. String must be contained within ' ' .

 -secret_id
Secret conveyed by the book (must use the IS_NAME of the secret). String must be contained within ' ' .

 -copy
If this optional argument is included, the script will make the book be treated as a copy

 -location
Location which the book will spawn.

  To use:
 
 Create a file called "onLoad.init" in Dwarf Fortress/raw if one does not already exist.
 Enter the following:
  modtools/reaction-trigger -reactionName YOUR_REACTION -command [ Spawn-spellbook -material_id MATERIAL -booktitle_name "BOOK TITLE" -secret_id "SECRET ID" -location \\WORKER_ID -copy]
 
  such as:
 
  modtools/reaction-trigger -reactionName SPAWN_NECROBOOK -command [ Spawn-spellbook -material_id INORGANIC:SILVER -booktitle_name "The Necronomicon" -secret_id "the secrets of life and death" -location \\WORKER_ID -copy ]

 ]])
 return
end

local material_id = args.material_id
local booktitle_name = args.booktitle_name
local secret_id = args.secret_id
local worker = df.unit.find(tonumber(args.location))

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.anon_3 = 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)
book.flags2.has_written_content = true

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

dfhack.items.moveToGround(book,{x=worker.pos.x,y=worker.pos.y,z=worker.pos.z})

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




11
Good morning all

For the past week I've been troubleshooting a script that I made based on a script posted somewhere here by Atomic Chicken, that allows for the creation of necromancer codices. The purpose of my script is to spawn a magic codex when used with modtools/reaction-trigger. Based on testing, it is able to spawn the books, but I can't seem to figure out how to make the scipt place the book under the worker's feet.

Here's the script in the raw, please excuse all the comments. As is it will spawn a codex and it will show on the stocks screen, but it's location is a mystery.
Code: [Select]
--Author: Burrito25man
--Based off the amazing work done by Atomic Chicken
--Version: 0.44.04

local utils = require 'utils'

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

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

local artifact = true

if args.help then
 print([[ Spawn spellbook.lua
 This script is designed to work with a reaction to spawn a spellbook.

 arguments:
 
 -material_id
Material book will be made of.

 -booktitle_name
Title of the book to be made. String must be contained within ' ' .

 -secret_id
Secret conveyed by the book (must use the IS_NAME of the secret). String must be contained within ' ' .

 -copy
If this optional argument is included, the script will make the book be treated as a copy

 -location
Location which the book will spawn.

  To use:
 
 Create a file called "onLoad.init" in Dwarf Fortress/raw if one does not already exist.
 Enter the following:
  modtools/reaction-trigger -reactionName YOUR_REACTION -command [ Spawn-spellbook -material_id MATERIAL -booktitle_name "BOOK TITLE" -secret_id "SECRET ID" -location \\LOCATION -copy]
 
  such as:
 
  modtools/reaction-trigger -reactionName SPAWN_NECROBOOK -command [ Spawn-spellbook -material_id INORGANIC:SILVER -booktitle_name "The Necronomicon" -secret_id "the secrets of life and death" -location \\LOCATION -copy]

 ]])
 return
end

print('args.location')
print(' ')
print(args.location)

local material_id = args.material_id
local booktitle_name = args.booktitle_name
local secret_id = args.secret_id


--print(args.location)
--position = df.unit.find(tonumber(args.location))
--print('Position of unit from df.unit.find(tonumber(args.location))')
--print(position)
--local position = {dfhack.units.getPosition(args.location)}


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

print(' ')
print('Material')
print(args.material_id)
print(' ')
print('Title')
print(args.booktitle_name)
print(' ')
print('secret id')
print(args.secret_id)
print(' ')

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

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 = 42--number of pages
  w.styles:insert('#',7)--(forceful)
  w.style_strength:insert('#',0)--'the writing drives forward relentlessly'
  w.anon_3 = 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 pos = position.pos
print('pos')
print(location.pos.x)
print(pos.x)

local pos = copyall(df.global.cursor)
if pos.x <0 then
  error('Please place the cursor wherever you want to spawn the slab.')
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 = 666 --number of pages
imp.contents:insert('#',createWriting(booktitle_name,secret_id))
book.improvements:insert('#',imp)
book.flags2.has_written_content = true

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

dfhack.items.moveToGround(book,[args.location])

I'm open to any ideas. I'm still teaching myself LUA through scripts by other people, so please excuse if there's an obvious solution  :-[

12
DF Dwarf Mode Discussion / Re: Wood chute from surface
« on: January 04, 2018, 06:14:06 pm »
I prefer not to use quantum stockpiles simply because I like to learn the intricacies and nuances of the game.  It forces me to think my way around the problem and better learn the game.

So let's say I set a minecart stop at the top to dump down the chute instead of designating a dump.  I haven't messed with minecarts but it sounds like it's about time for me!

So at the bottom of the "chute" if I build a series of downramps going into an adjoining room or a big open space in the wall the logs won't simply "topple" into the room?  I wasn't planning on setting the exact bottom of the chute as the collection point, I really pictured the logs just kind of rolling into the next room down a ramp but actually they will just keep stacking up on the ramps?

Regards,

Haytrid

unfortunately the logs will stay put wherever they are dropped. There is no "rolling" from one tile to another laterally, except for a for particular situations (fligging with bridges for example). That said, you can easily have a minecart take wood from a stockpile on the surface, and have a dwarf walk the minecart to your wood stockpile below and deload it. Your dwarf will wilk it back up when he's done.

13
DF Modding / Re: [MODDING] 0.44.x questions thread
« on: January 04, 2018, 05:33:50 pm »
How would one go about to reference procedurally generated divine materials with dfhack? I want to create items with them, but I am not sure how to go about finding the necessary tags if they exist, or if you can input them manually if they do not.

Thanks!

14
Mod Releases / Re: [43.05] Rhenaya's Drow, updated
« on: December 21, 2017, 01:19:34 pm »
Hello there, I'm glad someone has decided to try and update Rhen's drows for the latest version of DF.
I was trying to update things myself at the weekend, using elements from the elf profile to fill in the blanks that were needed, and had some success, after reading some of your posts.
I couldn't get the drow outcasts entity to work though, it crashed for some reason, so I had to cut them from the modded raws that I am using, to regain familiarity with DF after not playing it for a couple years.
Something that I've noticed, but which I've read seems to be an issue with the latest version of DF in general, was that I can't butcher goblins, or other sapient creatures? That was a bit of a surprise - in previous versions of Rhen's drow mod, I had a tendency to build quite the goblin leather industry and goblin bone craft industry.
Still getting used to things, but will keep an eye on this, to see how it develops.


by the way, you haven't included your latest link to your work, this one: http://dffd.bay12games.com/file.php?id=12819
I think version 0.40 accidentally broke butchering intelligent creatures in fortress mode. Toady knows of the problem, but doesn't even know how he caused it and since it's not something you can do in vanilla he hasn't put much effort into figuring out how to fix it.

I know this mod is established to be used without the use of dfhack, but if anyone is interested I wrote a script to get around the butchering issue. Link in my sig

Thanks guys! I love seeing this mod come back!

15
Mod Releases / Re: [44.02] Dwarfest Dungeon - A Darkest Dungeon Mod
« on: December 20, 2017, 05:37:46 pm »
PTW

Pages: [1] 2 3 4