How to get monsters DB in spreadsheet


Problems running or configuring the software, commands & options, compiling, different platforms, using the interface, documentation, etc.

Halls Hopper

Posts: 80

Joined: Friday, 14th September 2012, 10:22

Post Sunday, 30th September 2012, 01:52

How to get monsters DB in spreadsheet

I'd like to have a monster DB in excel file, to make some calcualtions.
I believe Cheibriados in ##crawl and Grettel in the Knowledge Bots have the data I want, but I can't find the way to get the data with a command. I want the data of whole monsters.
Is there any way to do such query? Or DB available.


  Code:
jackal (h) | Speed: 14 | HD: 1 | Health: 3-8 | AC/EV: 2/12 | Damage: 3 | Resistances: magic(1) | Chunks: contaminated | XP: 1.

komodo dragon (l) | Speed: 10 (swim: 60%) | HD: 8 | Health: 30-58 | AC/EV: 7/8 | Damage: 30(disease) | Flags: amphibious, cold-blooded | Resistances: magic(32), drown | Chunks: contaminated | XP: 313.

Dungeon Master

Posts: 1613

Joined: Thursday, 16th December 2010, 21:54

Post Sunday, 30th September 2012, 02:52

Re: How to get monsters DB in spreadsheet

The bots just calculate everything from mon-data.h I think.

For this message the author Kate has received thanks:
Choko5

Spider Stomper

Posts: 243

Joined: Sunday, 28th August 2011, 14:04

Post Sunday, 30th September 2012, 14:29

Re: How to get monsters DB in spreadsheet

This is what the bots use: http://s-z.org/neil/git/?p=monster-trunk.git;a=summary. To compile it, you will need to copy the source code of crawl under its tree, so you have a monster-trunk/crawl-ref/crawl-ref/source directory, and install python 2.

For this message the author CommanderC has received thanks: 2
Choko5, neil
User avatar

Dungeon Master

Posts: 502

Joined: Wednesday, 7th March 2012, 13:25

Location: Lexington, KY, US

Post Tuesday, 2nd October 2012, 21:19

Re: How to get monsters DB in spreadsheet

Note that 'monster' has a separate branch for each release of crawl: bleeding-edge-crawl for trunk, dcss011 for 0.11, and dcss010 for 0.10. The 'master' branch only handles DCSS 0.8, so you probably want to git checkout one of the more recent branches (and make sure you have checked out the corresponding branch in crawl-ref/).

Currently you have to query each monster individually; you can get a list of basic monsters with:
  Code:
sed -ne 's/^ *MONS_.*"\(.*\)".*/\1/p' crawl-ref/crawl-ref/source/mon-data.h
and vault monsters with
  Code:
sed -ne 's/.*push_back("\(.*\)").*/\1/p' vault_monster_data.cc
(after building 'monster'), but note that some monsters (item mimics, sensed monster, etc.) will cause a crash. If output goes to a terminal, ANSI colour codes will be used, otherwise IRC colour codes.

You can combine the two to get info on all the monsters:
  Code:
(
   sed -ne 's/.*push_back("\(.*\)").*/\1/p' vault_monster_data.cc
   sed -ne 's/^ *MONS_.*"\(.*\)".*/\1/p' crawl-ref/crawl-ref/source/mon-data.h
) | while read -r line
do
    ./monster-trunk "$line"
    echo
done


It is on my to-do list, but not near the top, to support HTML, XML, JSON, and CSV output. A bit lower down the list is a way to allow querying all monsters.

For this message the author neil has received thanks:
Choko5

Return to Technical Support

Who is online

Users browsing this forum: No registered users and 29 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.