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.rchttps://github.com/MarvinPA/MarvinPA.rchttps://github.com/HilariousDeathArtist/DCSSConfigFilehttps://github.com/gammafunk/dcss-rchttps://github.com/elliptic/qw/blob/master/qw.rcAnd if you want one full of outdated options originally intended to slow down sloppy play:
http://crawl.berotato.org/crawl/rcfiles ... mplojin.rc