This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Last revision Both sides next revision | ||
mod-management-functions [2021/10/22 18:00] maxime |
mod-management-functions [2021/11/12 13:33] maxime |
||
---|---|---|---|
Line 211: | Line 211: | ||
<code lua> | <code lua> | ||
myMod:registerEnumValue ("BUILDING_PART_TYPE", "DECORATION") | myMod:registerEnumValue ("BUILDING_PART_TYPE", "DECORATION") | ||
+ | </code> | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== createData ===== | ||
+ | |||
+ | Creates a new instance of a data type | ||
+ | |||
+ | ''void **myMod:createData**(//instanceData//)'' | ||
+ | |||
+ | ^ Name ^ Type ^ Description ^ | ||
+ | | //''instanceData''// | ''table'' or ''nil'' | the data defining the new instance. If not ''nil'', the table must contain at least the instance's type (''DataType'', see [[api|API]] for the complete list) | | ||
+ | |||
+ | ==== Example ==== | ||
+ | |||
+ | <code lua> | ||
+ | local instanceData = { | ||
+ | DataType = "DATA_TYPE", | ||
+ | ... | ||
+ | } | ||
+ | myMod:createData(instanceData ) | ||
</code> | </code> | ||