Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Is there a utility that allows you to view the raws of generated creatures?  (Read 2637 times)

Asin

  • Bay Watcher
  • A short and sturdy creature fond of modding.
    • View Profile

Is there a utility that allows you to view the raws of generated creatures, like generated demons, forgotten beasts, or perhaps the new experiment beasts/humanoids made by necromancers or demons?

Atomic Chicken

  • Bay Watcher
    • View Profile

I recall people cleanly extracting generated raws from the world.dat file, but I don't know the specifics. If you're willing to wait for DFHack to be updated for the new version (or you want to mess around with 0.44.12 in the meantime), I've written a quick script which gives you a list of generated creatures and prints the raws of the selected one to the DFHack console. Not particularly convenient if you wish to copy the entire thing, but it gets the job done.

Code: [Select]
function printCreatureRaws(race)
  for _, raw in ipairs(race.raws) do
    print(raw.value)
  end
end

local dialogs = require 'gui.dialogs'
local generatedCreatureBox = defclass(generatedCreatureBox,dialogs.ListBox)
generatedCreatureBox.focus_path = 'generatedCreatureBox'
generatedCreatureBox.ATTRS{
  with_filter = true
}

function generatedCreatureBox:preinit(info)
  local choices = {}
  for _, race in ipairs(df.global.world.raws.creatures.all) do
    if race.flags.GENERATED then
      local name = race.creature_id .. ' - ' .. race.name[0]
      table.insert(choices,{text = name, race = race, search_key = name:lower()})
    end
  end
  info.choices = choices
end

function showCreaturePrompt()
  generatedCreatureBox{
    frame_title = "Obtain Generated Creature Raws",
    text = "Select a creature:",
    on_select = function(id, choice)
      printCreatureRaws(choice.race)
    end,
  }:show()
end

showCreaturePrompt()
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. 

Andux

  • Bay Watcher
  • [PREFSTRING:semicolons]
    • View Profile
    • Andux's DFWiki page

I put together a new generated raws extractor thing that works with 0.47.
Logged
(Do not sign anything.) -- Fell, Planescape: Torment

MADMAN · Save Tools · WTF Tools · Generated Raws Extractor · Tweak for 0.31–34.xx

hertggf

  • Bay Watcher
    • View Profile

Not to take anything away from Andux's work but in a pinch you can also just set [COMPRESSED_SAVES:NO] in init.txt and open world.dat in a notepad++.  You can mod it too if you like (in a hex editor of course..).  Lines in the raws are separated by a 16-bit word that reflects the length of the succeeding line.
Logged

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile

You can mod it too if you like (in a hex editor of course..).

Conveniently, there's the HEX-Editor plugin for Notepad++.
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

Deus_Vult

  • Bay Watcher
    • View Profile

I put together a new generated raws extractor thing that works with 0.47.
Hi, I'm very new to all this, sorry
How do I use it?
Where do I save it?
If i just unpack it in my save folder and then try running grex.exe it appears and collapses in a moment
Logged

Andux

  • Bay Watcher
  • [PREFSTRING:semicolons]
    • View Profile
    • Andux's DFWiki page

It should work if you drag & drop your world.sav/world.dat file onto the exe/shortcut.
Logged
(Do not sign anything.) -- Fell, Planescape: Torment

MADMAN · Save Tools · WTF Tools · Generated Raws Extractor · Tweak for 0.31–34.xx

ragundo

  • Bay Watcher
    • View Profile

IDK if it would be useful to you. but you can also view the raws that DF uses while in-game

Logged