Creates and returns a new mod
void foundation.createMod()
Checks if a mod is enabled
Returns true if the mod is found and it is enabled, false otherwise
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 |
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 |
|---|---|---|
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 |
Retrieves the version of a mod
Returns the version as set by the mod's creator. This version can, or not, respect any versioning standard.
string foundation.getModVersion(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 |
Retrieves the game's version
Returns a string corresponding to the version of the game
string foundation.getGameVersion()
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 for the complete list) |
local instanceData = { DataType = "DATA_TYPE", ... } foundation.createData(instanceData )
Finds an asset by its name
ASSET foundation.findAsset(assetName)
| Name | Type | Description |
|---|---|---|
assetName | string | the name of the wanted asset. |
Finds a GameObject by its name
GAME_OBJECT foundation.findGameObject(objectName)
| Name | Type | Description |
|---|---|---|
objectName | string | the name of the wanted object. |