Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3

Author Topic: Spawning in Necromancy Books/Adding Secrets etc. in DFHack?-  (Read 12878 times)

comicraider

  • Bay Watcher
  • The only person who cares about Tales from Entar
    • View Profile
Spawning in Necromancy Books/Adding Secrets etc. in DFHack?-
« on: October 20, 2017, 08:16:14 pm »

Alrighty, I fancy playing as a necromancer adventurer in my favourite world (which I spam about in the stories section) but sadly despite the political instability and endless wars that seem to plague said world, secrets seem to be like fairy dust. Beyond the standard vampires (rare as is) and SO MANY WEREBEASTS there seems to be nothing else, no necromancy towers or anything, and I can't seem to track down any necromancers in legends.

I've spent a good in-game year as an adventurer searching for a slab or book, the plan being to give it to the Dwarven king if the lazy bastard doesn't take a wife and have heirs, seeing as he's obsessed with his own mortality, and have him rule the Banner of Souls for all eternity. But now the wars are at a stalemate, I've taken to playing as an Outsider warlord, going from town to hamlet to forest retreat etc. basically doing general murderhobo stuff, seeing as I can't claim sites as an Outsider. What I thought would be amazing would be if I could become a necromancer and introduce the world to the undead, adding another additional threat beyond the constant wars and the hundreds of demons I keep locked inside an evacuated fort. And the frickin' werebeasts, anyway.

Is there any way to spawn in a book/slab with the secrets of life and death on it into the world with DFHack, or alter the world's files to add more secrets so I can eventually find one? This world needs more fun, like medically needs it.
Logged

EPM

  • Bay Watcher
    • View Profile
Re: Spawning in Necromancy Books/Adding Secrets etc. in DFHack?-
« Reply #1 on: October 24, 2017, 10:59:28 am »

The easiest way I've found to crank up the amount of necromancers in a world is to add the DEATH sphere to the dwarven civ's pantheon options. Given DF, Dwarves having a dedicated god of death is quite reasonable, as every mythology around the world had theirs after all. That way it's not just reliant on human civs warring to generate necromancy.
Logged

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: Spawning in Necromancy Books/Adding Secrets etc. in DFHack?-
« Reply #2 on: October 25, 2017, 02:03:22 am »

It is not. You can get necros in dwarven/gobbo/elf only world as well.

PlumpHelmetMan

  • Bay Watcher
  • Try me with sauce...
    • View Profile
Re: Spawning in Necromancy Books/Adding Secrets etc. in DFHack?-
« Reply #3 on: October 25, 2017, 05:02:04 pm »

Wait, really? Because goblins and elves are already biologically immortal, what reason would they have to seek immortality (unless all they want is the ability to raise dead things)?
Logged
It's actually pretty terrifying to think about having all of your fat melt off into grease because you started sweating too much.

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: Spawning in Necromancy Books/Adding Secrets etc. in DFHack?-
« Reply #4 on: October 26, 2017, 12:06:32 am »

It's the dwarves seeking immortality. Goblins and elves can't ever become a necromancers. (Though vampire dwarves can.)

Pretty simple to test with quick all mountain/forest world.

PlumpHelmetMan

  • Bay Watcher
  • Try me with sauce...
    • View Profile
Re: Spawning in Necromancy Books/Adding Secrets etc. in DFHack?-
« Reply #5 on: October 26, 2017, 12:39:40 am »

Ohhh sorry, I got confused and thought you meant worlds where only one of those three races existed. Guess you just meant worlds without humans.
Logged
It's actually pretty terrifying to think about having all of your fat melt off into grease because you started sweating too much.

Atomic Chicken

  • Bay Watcher
    • View Profile
Re: Spawning in Necromancy Books/Adding Secrets etc. in DFHack?-
« Reply #6 on: October 30, 2017, 03:44:00 pm »

For future reference, questions regarding DFHack tend to receive far greater notice if asked in the Utilities subsection of the Modding board.

I've written you a simple script for spawning necromancy slabs as requested:
Code: [Select]
local material = 'INORGANIC:SILVER'

function getSecretId()
  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 == 'the secrets of life and death' then
          return i.id
        end
      end
    end
  end
end

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)
if not m then
  error('Invalid material.')
end

local slab = df.item_slabst:new()
slab.id = df.global.item_next_id
df.global.world.items.all:insert('#',slab)
df.global.item_next_id = df.global.item_next_id+1
slab:setMaterial(m['type'])
slab:setMaterialIndex(m['index'])
slab:categorize(true)
slab.flags.removed = true
slab:setSharpness(0,0)
slab:setQuality(0)
slab.engraving_type = 6
slab.topic = getSecretId()
slab.description = 'The secrets of life and death'
dfhack.items.moveToGround(slab,{x=pos.x,y=pos.y,z=pos.z})

Just paste the code into a text editor, save it as a .lua file and place the file in the hack\scripts folder.
To use, place the cursor anywhere and enter the script's name (i.e. whatever you called the file when saving it) into the DFHack console.
Note that the script spawns silver slabs by default. The material can be changed by editing the first line of code as desired.

Enjoy!
« Last Edit: October 30, 2017, 03:47:00 pm by Atomic Chicken »
Logged
As mentioned in the previous turn, the most exciting field of battle this year will be in the Arstotzkan capitol, with plenty of close-quarter fighting and siege warfare.  Arstotzka, accordingly, spent their design phase developing a high-altitude tactical bomber. 

comicraider

  • Bay Watcher
  • The only person who cares about Tales from Entar
    • View Profile
Re: Spawning in Necromancy Books/Adding Secrets etc. in DFHack?-
« Reply #7 on: November 06, 2017, 08:47:01 pm »

You, sir, deserve a cookie and a mug of sunshine. Looks like the undead apocalypse will happen after all :D bonus points for my character writing books with this new information so even if he, the world's only necromancer dies, people will eventually pick them up and it'll spread like a disease :3
Logged

Purdurabo

  • Bay Watcher
    • View Profile
Re: Spawning in Necromancy Books/Adding Secrets etc. in DFHack?-
« Reply #8 on: November 09, 2017, 07:12:53 am »

For future reference, questions regarding DFHack tend to receive far greater notice if asked in the Utilities subsection of the Modding board.

I've written you a simple script for spawning necromancy slabs as requested:
Code: [Select]
local material = 'INORGANIC:SILVER'

function getSecretId()
  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 == 'the secrets of life and death' then
          return i.id
        end
      end
    end
  end
end

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)
if not m then
  error('Invalid material.')
end

local slab = df.item_slabst:new()
slab.id = df.global.item_next_id
df.global.world.items.all:insert('#',slab)
df.global.item_next_id = df.global.item_next_id+1
slab:setMaterial(m['type'])
slab:setMaterialIndex(m['index'])
slab:categorize(true)
slab.flags.removed = true
slab:setSharpness(0,0)
slab:setQuality(0)
slab.engraving_type = 6
slab.topic = getSecretId()
slab.description = 'The secrets of life and death'
dfhack.items.moveToGround(slab,{x=pos.x,y=pos.y,z=pos.z})

Just paste the code into a text editor, save it as a .lua file and place the file in the hack\scripts folder.
To use, place the cursor anywhere and enter the script's name (i.e. whatever you called the file when saving it) into the DFHack console.
Note that the script spawns silver slabs by default. The material can be changed by editing the first line of code as desired.

Enjoy!

Anychance you could give us the script for a book instead of a slab please?
Just no one will read a slab in fort mode.
Logged

Eschar

  • Bay Watcher
  • hello
    • View Profile
Re: Spawning in Necromancy Books/Adding Secrets etc. in DFHack?-
« Reply #9 on: November 22, 2017, 06:15:21 pm »


Just no one will read a slab in fort mode.

Wait, can mortality-obsessed citizens in fort mode become necromancers if they read a secret?
Logged

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: Spawning in Necromancy Books/Adding Secrets etc. in DFHack?-
« Reply #10 on: November 22, 2017, 06:35:27 pm »

All mortals can.

Less glamorous than it sounds. You can make everyone in your fort a necromancer via a single book, but unlife goes on.

Eschar

  • Bay Watcher
  • hello
    • View Profile
Re: Spawning in Necromancy Books/Adding Secrets etc. in DFHack?-
« Reply #11 on: November 22, 2017, 07:07:09 pm »

All mortals can.

Less glamorous than it sounds. You can make everyone in your fort a necromancer via a single book, but unlife goes on.

What do they do after reading it?
Logged

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: Spawning in Necromancy Books/Adding Secrets etc. in DFHack?-
« Reply #12 on: November 23, 2017, 02:52:04 am »

Read another book, joke with friends, maybe perform a dance...The usual.

Not drink though, and only reanimate in combat.

Dozebôm Lolumzalěs

  • Bay Watcher
  • what even is truth
    • View Profile
    • test
Re: Spawning in Necromancy Books/Adding Secrets etc. in DFHack?-
« Reply #13 on: November 24, 2017, 08:35:29 pm »

No more eating/drinking, and reanimation? It doesn't seem like the transition would be that good, but that sounds like a huge boost to fortress-power when all is said and done. (At the expense of reproduction though, and migrants will be threatened by zombies...)
Logged
Quote from: King James Programming
...Simplification leaves us with the black extra-cosmic gulfs it throws open before our frenzied eyes...
Quote from: Salvané Descocrates
The only difference between me and a fool is that I know that I know only that I think, therefore I am.
Sigtext!

Fleeting Frames

  • Bay Watcher
  • Spooky cart at distance
    • View Profile
Re: Spawning in Necromancy Books/Adding Secrets etc. in DFHack?-
« Reply #14 on: November 24, 2017, 09:06:11 pm »

No sleep either, and no tiring - expect training can still tire them, which will then get stuck at that level, and zombies may attack necromancers anyway.

It has its uses, but it is overall simpler to just keep using the automated food and drink production you already have set up.
Pages: [1] 2 3