custom-building-function
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
custom-building-function [2022/03/30 16:44] – [Step 1: Defining an BUILDING_FUNCTION Class using a Lua Table] minotorious | custom-building-function [2022/04/30 19:23] (current) – minotorious | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | [[api/ | + | [[api/ |
For reference all available [[api/ | For reference all available [[api/ | ||
- | ===== Creating & Using a Custom | + | ===== Creating & Using a Custom |
==== Step 1: Defining a BUILDING_FUNCTION Class using a Lua Table ==== | ==== Step 1: Defining a BUILDING_FUNCTION Class using a Lua Table ==== | ||
To create a custom [[api/ | To create a custom [[api/ | ||
Line 20: | Line 20: | ||
</ | </ | ||
Now that the base [[api/ | Now that the base [[api/ | ||
+ | |||
+ | All [[api/ | ||
+ | |||
+ | '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | For example below we set up a function that upon activation logs its properties and upon reload executes a back-call to its activation function. | ||
<code lua> | <code lua> | ||
+ | function MY_BUILDING_FUNCTION: | ||
+ | mod: | ||
+ | mod: | ||
+ | mod: | ||
+ | | ||
+ | return true | ||
+ | end | ||
+ | function MY_BUILDING_FUNCTION: | ||
+ | self: | ||
+ | end | ||
</ | </ | ||
- | And finally we register | + | And finally we register |
<code lua> | <code lua> | ||
mod: | mod: |
custom-building-function.txt · Last modified: 2022/04/30 19:23 by minotorious