1
Masterwork DF / Re: Interest in Orc Fortress for vanilla 44.xx?
« on: June 08, 2018, 09:28:36 pm »Quote from: burrito25manfix-sentient-butcher
Looks like meat's back on the menu, boys!
Best. Reference. Ever.
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
Quote from: burrito25manfix-sentient-butcher
Looks like meat's back on the menu, boys!
sorry if i was unclear, i meant would a civ with EAT_SAPIENT_OTHER:ACCEPTABLE eat corpses of their own species with this script
If a modded civ has different ethics, would they be ok eating any corpse with this script?
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
[IT_IMMUNE_CREATURE:CREATURE:CASTE]
[I_TARGET:A:CREATURE]
Tested it out. I can't enable the script at all. The errors are saying something about it having no enable/disable commands.
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'm seeming to have a problem with the script on the dfhack 44.05 version. The script you posted is refusing to load.
--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!')
--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 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
Hello there, I'm glad someone has decided to try and update Rhen's drows for the latest version of DF.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 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