Lua


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

bel

Cocytus Succeeder

Posts: 2184

Joined: Tuesday, 3rd February 2015, 22:05

Post Wednesday, 30th September 2015, 10:15

Lua

Can someone tell me how and where it is used in crawl? What source files should I be looking at? I know close to nothing about the language.

Dungeon Master

Posts: 585

Joined: Sunday, 9th June 2013, 17:13

Post Wednesday, 30th September 2015, 12:08

Re: Lua

It's used extensively in level layouts and in des files that define vaults. The dlua interpreter used in crawl has functions to call into most aspects of level generation and player, monster, and item manipulation. There's also a clua interpreter that the player can call into through their rc file which has a more restricted set of functions for interacting with the player character, monsters, and items. The lua functions available are defined in the l_*.cc files in source, and you have to read them to see what all are defined and whether they're clua or dlua.

The lua code itself is in source/dat, with the layout code and many supporting libraries in source/dat/dlua and the des files in source/dat/des. Most vaults don't have embedded lua, but there are many that do and you have to read them to see any lua code blocks. Most of the actual layout lua is in dat/dlua/layouts (n.b. there are layouts that are implemented in Crawl as C++ as well, Labyrinths being a notable example).

For this message the author gammafunk has received thanks:
bel

Return to Technical Support

Who is online

Users browsing this forum: No registered users and 10 guests

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