User Tools

Site Tools


foundation-library-functions

Differences

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

Link to this comparison view

Next revision
Previous revision
foundation-library-functions [2023/09/14 11:32] – created - external edit 127.0.0.1foundation-library-functions [2026/10/05 16:19] (current) – maxime
Line 1: Line 1:
-====== Foundation library functions ======+====== Foundation Library Functions ======
  
 ===== createMod ===== ===== createMod =====
Line 55: Line 55:
  
 ''string **foundation.getGameVersion**()'' ''string **foundation.getGameVersion**()''
 +
 +----
 +
 +===== isDlcEnabled =====
 +
 +Checks if a DLC is enabled
 +
 +''bool **foundation.isDlcEnabled**(//dlcName//)''
 +
 +^ Name ^ Type ^ Description ^
 +| //''dlcName''// | ''string'' | the codename of the DLC (see [[dlc|DLC]] for the complete list) |
 +
 +==== Example ====
 +
 +<code lua>
 +local isEnabled = foundation.isDlcEnabled("agriculture")
 +</code>
  
 ---- ----
Line 62: Line 79:
 Creates a new instance of a data type Creates a new instance of a data type
  
-''void **myMod:createData**(//instanceData//)''+''data **foundation.createData**(//instanceData//)''
  
 ^ Name ^ Type ^ Description ^ ^ Name ^ Type ^ Description ^
Line 74: Line 91:
     ...     ...
 } }
-foundation.createData(instanceData )+local newData = foundation.createData(instanceData) 
 +</code> 
 + 
 +---- 
 + 
 +===== createAsset ===== 
 + 
 +Creates a new runtime instance of an asset type 
 + 
 +''[[api:ASSET|ASSET]] **foundation.createAsset**(//instanceAssetData//)'' 
 + 
 +^ Name ^ Type ^ Description ^ 
 +| //''instanceAssetData''// | ''table'' | the data defining the new runtime asset instance. The table must contain at least the instance's type (''DataType'', see [[api|API]] for the complete list) | 
 + 
 +==== Example ==== 
 + 
 +<code lua> 
 +local assetData = { 
 +    DataType = "DATA_TYPE", 
 +    ... 
 +} 
 +local newAsset = foundation.createAsset(assetData)
 </code> </code>
  
foundation-library-functions.1694705574.txt.gz · Last modified: 2023/09/14 11:32 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki