Page 1 of 1

Want to Edit Crawl Files

PostPosted: Tuesday, 25th October 2011, 05:55
by File200
I want to edit some files in Crawl locally to try some ideas I have, but I don't even know where to start when it comes to programming. I followed the links provided on this site and the wiki, but I don't really have the technical knowledge to use GIT or the console.

For starters, I can't read the .des or .lua files in the /dat directory (I presume these are what I need to edit). What do I need in order to look at or edit those?

Re: Want to Edit Crawl Files

PostPosted: Tuesday, 25th October 2011, 07:03
by absolutego
if you want to contribute but you can't code, here's some of what you can do:
viewtopic.php?f=19&t=596

there should be a documentation folder packaged with whatever version of the game you have, so check that out.
i assume there are hints to it in the documentation, but lua and des files are plain text, so you can read and edit them with any text editor (notepad, gedit, vi, etc). do not use a word processor, though.

if you're interested in vaults, in particular, here are some examples:
viewtopic.php?f=19&t=499

Re: Want to Edit Crawl Files

PostPosted: Wednesday, 26th October 2011, 02:22
by File200
I feel silly now.

If I want to edit, say, gods, species or weapons, how would I do that? They don't seem to have corresponding files in the Crawl directory.

E: N/M, I was looking through the files that I got with the installer. Everything seems to be available in the Git version.

E2: Holy moly, never mind. The godconduct.o file requires some different type of interpreter and I can't understand anything here. Back to the vaults for me I guess.

Re: Want to Edit Crawl Files

PostPosted: Wednesday, 26th October 2011, 03:03
by edlothiol
They are mostly defined in the (C++) source code. The .o files are object files compiled from that source code; what you want are the .cc and .h, but you'll need to know at least some C++ to modify them. The monster stats are in mon-data.h; most weapon attributes are in itemprop.cc; and unrandarts are in art-data.txt (not a C++ file, but you'll still need to compile to apply changes to it). Gods and species are all over the place.

Re: Want to Edit Crawl Files

PostPosted: Saturday, 29th October 2011, 23:52
by File200
New problem, I tried adding Mountain Dwarf back to the trunk build but when I select it, all the backgrounds are listed as N/A.

What file do I need to change?

If that's too vague, what file determines that demonspawn can't be priests or healers?

Re: Want to Edit Crawl Files

PostPosted: Sunday, 30th October 2011, 09:57
by jpeg
File200 wrote:New problem, I tried adding Mountain Dwarf back to the trunk build but when I select it, all the backgrounds are listed as N/A.

What file do I need to change?

Have a look at the commit in question: http://gitorious.org/crawl/crawl/commit ... 9a3c70d329
You can try to revert the changes using that.

In case you don't know how patches work, lines marked in green have been added in that commit, lines marked in red have been removed, and the lines highlighted in grey just show that the output skips a couple of lines that haven't been modified by the commit. You can also create a "raw patch" (link to the top left) and try to apply the patch to the source code, but a) you might end up getting conflicts that way, and b) you'll learn more about how the code works if you revert the changes manually.

If that's too vague, what file determines that demonspawn can't be priests or healers?

You can change allowed character combinations in ng-restr.cc (which stands for "new game restrictions"). Here, CC_BANNED means that the choice is completely unavailable, CC_UNRESTRICTED means that the choice is recommended (lightgrey) and CC_RESTRICTED that it's not (darkgrey).