User Tools

Site Tools


foundation-library-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
foundation-library-functions [2026/08/03 17:03] – maximefoundation-library-functions [2026/10/05 16:19] (current) – maxime
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> </code>
  
Line 81: Line 98:
 ===== createAsset ===== ===== createAsset =====
  
-Creates a new instance of an asset type+Creates a new runtime instance of an asset type
  
-''void **myMod:createAsset**(//assetData//)''+''[[api:ASSET|ASSET]] **foundation.createAsset**(//instanceAssetData//)''
  
 ^ Name ^ Type ^ Description ^ ^ Name ^ Type ^ Description ^
-| //''assetData''// | ''table'' or ''nil'' | the data defining the new asset. If not ''nil'', the table must contain at least the instance's type (''DataType'', see [[api|API]] for the complete list) |+| //''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 ==== ==== Example ====
Line 95: Line 112:
     ...     ...
 } }
-foundation.createAsset(assetData)+local newAsset = foundation.createAsset(assetData)
 </code> </code>
  
foundation-library-functions.1785790993.txt.gz · Last modified: 2026/08/03 17:03 by maxime

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki