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 revision
Previous revision
Last revisionBoth sides next revision
mod-management-functions [2021/11/12 13:33] maximemod-management-functions [2022/09/12 15:42] maxime
Line 74: Line 74:
 | //''assetId''// | ''string'' | the ID to assign to the asset | | //''assetId''// | ''string'' | the ID to assign to the asset |
 | //''assetType''// | ''string'' | optional, type of the asset | | //''assetType''// | ''string'' | optional, type of the asset |
 +
 +----
 +
 +===== registerPrefabChild =====
 +
 +Registers a new child for a prefab
 +
 +''void **myMod:registerPrefabChild**(//parentPrefabIdOrPath//, //id// [, //name//] [, //transform//])''
 +
 +^ Name ^ Type ^ Description ^
 +| //''parentPrefabIdOrPath''// | ''string'' | the ID or path to the new child's parent prefab |
 +| //''id''// | ''string'' | the ID of the newly created prefab |
 +| //''name''// | ''string'' | optional, the name of the new prefab, ''id'' will be used if no ''name'' is provided |
 +| //''transform''// | ''matrix'' | optional, the transform matrix of the new prefab |
 +
 +==== Example ====
 +
 +<code lua>
 +local newChildTransform = {
 +    Position = { 0, 0, 1 },
 +    Rotation = { 0, -180, 0 }
 +}
 +
 +myMod:registerPrefabChild(prefabPath, "MY_NEW_PREFAB_CHILD_ID", "MyNewChildName", newChildTransform)
 +</code>
  
 ---- ----
Line 211: Line 236:
 <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