Is there a guide to editing the rcfile?


Ask fellow adventurers how to stay alive in the deep, dark, dangerous dungeon below, or share your own accumulated wisdom.

Abyss Ambulator

Posts: 1184

Joined: Wednesday, 23rd April 2014, 21:57

Post Friday, 19th May 2017, 22:03

Is there a guide to editing the rcfile?

As the topic says. I've never bothered looking into it, but maybe it's time I made my life a bit easier.

Is there a comprehensive guide / documentation for rcfile editing?

Or a collection of useful lines?
User avatar

Snake Sneak

Posts: 96

Joined: Monday, 20th February 2012, 17:33

Post Friday, 19th May 2017, 22:53

Re: Is there a guide to editing the rcfile?

Options guide at github is a good place to start.

For this message the author Wark has received thanks: 2
4Hooves2Appendages, nago

Spider Stomper

Posts: 202

Joined: Thursday, 11th April 2013, 21:07

Post Saturday, 20th May 2017, 00:16

Re: Is there a guide to editing the rcfile?

4Hooves2Appendages wrote:Is there a comprehensive guide / documentation for rcfile editing?

options_guide.txt, although it barely touches on the information needed to use rcfile Lua. That link is only accurate for trunk, since the devteam has been known to add and remove options at will. For any older version, reference the options_guide.txt contained within that distribution.

Regarding the Lua bindings and hooks made available, no real documentation exists. You can write custom Lua in your rcfile and call it within the game, from any of several exposed hooks, using the gamestate information that's exposed to the (c)Lua interpreter. There was an attempt at documentation of the hooks, located here: https://github.com/paulcdejean/crawl-lu ... /README.md, but it's incomplete and probably unreliable.

The best way to see what the DCSS Lua bindings do is to grep the source.
  Code:
git grep -n luaL_reg
from within a clone of the repo will show you the file locations of the libraries containing most of the game's Lua binds, you can browse or grep further from there to find the exposed functions. The functions inside of libraries named _clib[] are typically available for the player to call (these are referenced in the code as clua), the ones registered under _dlib[] are used internally for the game's dungeon generation (dlua) and are typically locked out for player use unless you've activated wizmode.
There are some hooks that do nothing by default, but are exposed so that players can override them with custom behavior. These can mostly be found by grepping for CLua::call , which after a bit further down the rabbit hole will let you locate the actual function names available to override.

Autofight, automagic, and a few other things also run through Lua. The default behaviors there can be replaced or augmented as above.

4Hooves2Appendages wrote:Or a collection of useful lines?

Browsing experienced players' rcfiles is a good place to start, you can also look at qw.rc for ideas.
http://crawl.akrasiac.org/rcfiles/crawl-git/crate.rc
https://github.com/MarvinPA/MarvinPA.rc
https://github.com/HilariousDeathArtist/DCSSConfigFile
https://github.com/gammafunk/dcss-rc
https://github.com/elliptic/qw/blob/master/qw.rc

And if you want one full of outdated options originally intended to slow down sloppy play:
http://crawl.berotato.org/crawl/rcfiles ... mplojin.rc

For this message the author Implojin has received thanks: 4
4Hooves2Appendages, nago, stickyfingers, ThreeInvisibleDucks

Halls Hopper

Posts: 62

Joined: Friday, 17th April 2015, 23:46

Post Monday, 22nd May 2017, 09:39

Re: Is there a guide to editing the rcfile?

Check out my RC file: http://crawl.xtahua.com/crawl/rcfiles/c ... 19/quik.rc

Most of it is taken from other players' RCs, but it has lots of stuff and it is mostly commented.

For this message the author quik has received thanks:
4Hooves2Appendages

Spider Stomper

Posts: 202

Joined: Thursday, 11th April 2013, 21:07

Post Tuesday, 23rd May 2017, 21:28

Re: Is there a guide to editing the rcfile?

quik wrote:Check out my RC file: http://crawl.xtahua.com/crawl/rcfiles/c ... 19/quik.rc

Most of it is taken from other players' RCs, but it has lots of stuff and it is mostly commented.

You have a bunch of stop += lines in your rcfile that look like they were taken from HDA's rcfile, but stop within that rcfile is just an alias for runrest_stop_message, and your rcfile doesn't seem to have any includes or aliases that would define stop to do anything. If you want those stop+= lines to behave as they do in HDA's rc, you should add this near the top of your rc:
  Code:
stop := runrest_stop_message

If you've done this intentionally for some reason, feel free to ignore this post, but I thought you might like to know.

For this message the author Implojin has received thanks:
quik

Halls Hopper

Posts: 62

Joined: Friday, 17th April 2015, 23:46

Post Tuesday, 23rd May 2017, 22:28

Re: Is there a guide to editing the rcfile?

Implojin wrote:You have a bunch of stop += lines in your rcfile that look like they were taken from HDA's rcfile, but stop within that rcfile is just an alias for runrest_stop_message, and your rcfile doesn't seem to have any includes or aliases that would define stop to do anything.


Thank you for pointing it out. It's a mistake. That part of my file was taken from http://crawl.xtahua.com/crawl/rcfiles/c ... rceMore.rc and it seems that alias isn't defined in there either. I guess it also doesn't work in the original file, if I'm not missing anything.

Anyway, it's fixed in my file now. Thanks again.

Return to Dungeon Crawling Advice

Who is online

Users browsing this forum: Bing [Bot] and 8 guests

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