Lua

This is a namespace article for Lua scripts and Scribunto modules. All Lua scripts must be stored as subpages of this article. A proper folder structure is recommended (subpages within subpages) to keep things well organized.

## Instructions and conventions

The namespace *Module:* must always come before script pages as in *Module:Lua/test* and not *Lua/Module:test* since the latter does not work. This is true for all wikimedia namespaces; namespace must come first.

Standard MediaWiki and Fandom Lua script conventions apply. Additionally, the script pages must not have file extensions. This is to keep offline development of the scripts and Scribunto more similar. Further more, this helps maintaining the scripts as for the WikiMedia engine, a page with same name but with a file extension are two different pages. This does not apply to Lua's require function, which only accepts paths without extension as it adds it automatically when needed. The script pages should prefer all lowercase names to avoid issues with case sensitive file systems.

Lua scripts that are meant to be invoked by templates must have a main function. Lua scripts that are intended to be used as libraries must not have main function. Each of the template invokable scripts should have a corresponding wrapper template that invokes the Lua module.

Lua scripts that contain game data must be direct subpages called "data" of the article page itself. For instance, a page for *Shovel* would have *Module:Shovel/data* script that contains all the item's data. For collective information pages, such clue scrolls, all the data can be stored in a data script as well. However, such large pages are likely to be broken into more pages eventually and the data scripts must follow such break ups.

Return values of prototype or type defining scripts are expected to be assigned to script global variables of the same name as the type itself.

## Lua contents

### Folders

* gamelib
* gamelib/components
* gamelib/enums
* gamelib/models
* lib

### Scripts

* gamelib/accessors/components/defensiveaccessor
* gamelib/accessors/components/mobaccessor
* gamelib/armourtype
* gamelib/components/accessible
* gamelib/components/craftable
* gamelib/components/damaging
* gamelib/components/defensive
* gamelib/components/describing
* gamelib/components/dragonfireprotective
* gamelib/components/facilityhousing
* gamelib/components/harvestable
* gamelib/components/item
* gamelib/components/location
* gamelib/components/locations
* gamelib/components/lootable
* gamelib/components/magicdamaging
* gamelib/components/meleedamaging
* gamelib/components/mob
* gamelib/components/mobhousing
* gamelib/components/npchousing
* gamelib/components/offensive
* gamelib/components/pious
* gamelib/components/questcheck
* gamelib/components/rangeddamaging
* gamelib/components/resourcedeposit
* gamelib/components/skillcheck
* gamelib/components/slayable
* gamelib/components/teleporting
* gamelib/components/thievable
* gamelib/components/trading
* gamelib/entities/mobentityutil
* gamelib/enums/armourtype
* gamelib/enums/combatstyle
* gamelib/enums/projectiletype
* gamelib/enums/projecttiletype
* gamelib/enums/rarity
* gamelib/enums/skill
* gamelib/enums/strengthclass
* gamelib/lib/money
* gamelib/links/worldmap
* gamelib/models/entrance
* gamelib/models/ingredient
* gamelib/models/lootentry
* gamelib/models/point
* gamelib/models/skilllevel
* gamelib/models/stockitem
* gamelib/models/teleport
* gamelib/money
* gamelib/renderers/html/infoboxes/armour
* gamelib/renderers/html/infoboxes/mob
* gamelib/renderers/html/rarity
* gamelib/renderers/html/tables/loottable
* gamelib/renderers/html/util
* lib/bitwise
* lib/component
* lib/entity
* lib/enum
* lib/prototypal
* lib/requireutil
* test/hw
* test/hw.lua
* v2/lib/entity

## Tests

ipsum

lorem