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 [2020/05/22 12:18] – created maximefoundation-library-functions [2023/09/14 11:32] (current) – [findGameObject] mathieu
Line 16: Line 16:
  
 ''boolean **foundation.isModEnabled**(//modId//)'' ''boolean **foundation.isModEnabled**(//modId//)''
 +
 +^ Name ^ Type ^ Description ^
 +| //''modId''// | ''string'' | the ID of the target mod. This ID is automatically generated and can be found in the mod's folder, in the file ''generated_ids.lua'', in the field ''ModId'' |
 +
 +----
 +
 +===== isModLoaded =====
 +
 +Checks if a mod is already loaded, for soft dependencies purposes
 +
 +Returns ''true'' if the mod is found and it is loaded, ''false'' otherwise
 +
 +''boolean **foundation.isModLoaded**(//modId//)''
  
 ^ Name ^ Type ^ Description ^ ^ Name ^ Type ^ Description ^
Line 42: Line 55:
  
 ''string **foundation.getGameVersion**()'' ''string **foundation.getGameVersion**()''
 +
 +----
 +
 +===== 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",
 +    ...
 +}
 +foundation.createData(instanceData )
 +</code>
 +
 +----
 +
 +===== findAsset =====
 +
 +Finds an asset by its name
 +
 +''[[api:ASSET|ASSET]] **foundation.findAsset**(//assetName//)''
 +
 +^ Name ^ Type ^ Description ^
 +| //''assetName''// | ''string'' | the name of the wanted asset. |
 +
 +----
 +
 +===== findGameObject =====
 +
 +Finds a GameObject by its name
 +
 +''[[api:GAME_OBJECT|GAME_OBJECT]] **foundation.findGameObject**(//objectName//)''
 +
 +^ Name ^ Type ^ Description ^
 +| //''objectName''// | ''string'' | the name of the wanted object. |
foundation-library-functions.1590164284.txt.gz · Last modified: 2020/05/22 12:18 by maxime

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki