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
Next revisionBoth sides next revision
mod-management-functions [2020/12/14 09:49] – [registerPrefabComponent] maximemod-management-functions [2021/12/09 10:45] maxime
Line 7: Line 7:
 Loads and runs a Lua script Loads and runs a Lua script
  
-Returns ''true'' if the file is inside the mod directory and exists, ''false'otherwise+Returns the file's return values
  
-''boolean **myMod:dofile**(//scriptPath// [, //args...//])''+''[...] **myMod:dofile**(//scriptPath// [, //args...//])''
  
 ^ Name ^ Type ^ Description ^ ^ Name ^ Type ^ Description ^
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 ^
-| //''assetData''// | ''table'' | the data defining the overridden asset. The table must contain at least the existing asset's type (''Id'', see [assets|Assets]] for the complete list) |+| //''assetData''// | ''table'' | the data defining the overridden asset. The table must contain at least the existing asset's type (''Id'', see [[assets|Assets]] for the complete list) |
  
 ==== Example ==== ==== Example ====
Line 55: Line 59:
     ...     ...
 } }
-myMod:override(assetData)+myMod:overrideAsset(assetData)
 </code> </code>
  
Line 64: Line 68:
 Assign an asset ID to an asset in the mod's directory Assign an asset ID to an asset in the mod's directory
  
-''void **myMod:registerAssetId**(//assetPath//, //assetId//)''+''void **myMod:registerAssetId**(//assetPath//, //assetId// [, //assetType//])''
  
 ^ Name ^ Type ^ Description ^ ^ Name ^ Type ^ Description ^
 | //''assetPath''// | ''string'' | the path to the asset | | //''assetPath''// | ''string'' | the path to the asset |
 | //''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 |
  
 ---- ----
mod-management-functions.txt · Last modified: 2022/10/07 11:18 by maxime

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki