Elements
A module
Last updated
A module
Last updated
A module used to inject custom mission elements into the game.
<Elements directory>
Parameter | Type | Description |
---|---|---|
<element name file/>
Parameter | Type | Description |
---|---|---|
The editor integrates into this module using a hook, the editor will attempt to load an editor class named <name>ElementEditor.lua, place it in the same directory you'd place your regular element class.
This guide doesn't cover how to make your own elements (the classes themselves) in depth, this is just a convenient way of injecting them into BeardLib (and the editor) without having to go through the hassle of making hooks and injecting them into BeardLib or the editor.
The naming convention differs from the game, instead of ElementFood we force the name to be FoodElement. The reason is to avoid clashing with future or existing element names. This happened before to BeardLib itself. So to avoid this situation this element will work best with this naming convention. This includes the editor's integration.
directory
String
Sets the directory to load the elements from
name
String
The name of the element, without the "Element" part. If the file parameter isn't define, the assumed file will be <name>Element.lua
file
String
Let's you choose a specific name for the file of the element's code.