User Tools

Site Tools


mod-management-functions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
mod-management-functions [2021/10/22 18:00] maximemod-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>
  
mod-management-functions.txt · Last modified: 2022/10/07 11:18 by maxime

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki