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/10/04 11:18] maximemod-management-functions [2022/09/12 15:42] maxime
Line 17: Line 17:
 ---- ----
  
-===== register =====+===== registerAsset ===== 
 + 
 +Deprecated name: ''register''
  
 Register a new game asset Register a new game asset
  
-''void **myMod:register**(//assetData//)''+''void **myMod:registerAsset**(//assetData//)''
  
 ^ Name ^ Type ^ Description ^ ^ Name ^ Type ^ Description ^
Line 34: Line 36:
     ...     ...
 } }
-myMod:register(assetData)+myMod:registerAsset(assetData)
 </code> </code>
  
 ---- ----
  
-===== override =====+===== overrideAsset ===== 
 + 
 +Deprecated name: ''override''
  
 Override an existing game asset (see [[:asset-override|Asset Override]] for a complete explanation) Override an existing game asset (see [[:asset-override|Asset Override]] for a complete explanation)
  
-''void **myMod:override**(//assetData//)''+''void **myMod:overrideAsset**(//assetData//)''
  
 ^ Name ^ Type ^ Description ^ ^ Name ^ Type ^ Description ^
Line 55: Line 59:
     ...     ...
 } }
-myMod:override(assetData)+myMod:overrideAsset(assetData)
 </code> </code>
  
Line 70: 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>
  
 ---- ----
mod-management-functions.txt · Last modified: 2022/10/07 11:18 by maxime

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki