mod-management-functions
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
mod-management-functions [2020/05/06 16:52] – maxime | mod-management-functions [2021/11/12 13:33] – maxime | ||
---|---|---|---|
Line 7: | Line 7: | ||
Loads and runs a Lua script | Loads and runs a Lua script | ||
- | Returns | + | Returns the file's return values |
- | '' | + | '' |
^ Name ^ Type ^ Description ^ | ^ Name ^ Type ^ Description ^ | ||
Line 17: | Line 17: | ||
---- | ---- | ||
- | ===== register | + | ===== registerAsset |
+ | |||
+ | Deprecated name: '' | ||
Register a new game asset | Register a new game asset | ||
- | '' | + | '' |
^ Name ^ Type ^ Description ^ | ^ Name ^ Type ^ Description ^ | ||
Line 34: | Line 36: | ||
... | ... | ||
} | } | ||
- | myMod:register(assetData) | + | myMod:registerAsset(assetData) |
</ | </ | ||
---- | ---- | ||
- | ===== override | + | ===== overrideAsset |
+ | |||
+ | Deprecated name: '' | ||
Override an existing game asset (see [[: | Override an existing game asset (see [[: | ||
- | '' | + | '' |
^ Name ^ Type ^ Description ^ | ^ Name ^ Type ^ Description ^ | ||
- | | //'' | + | | //'' |
==== Example ==== | ==== Example ==== | ||
Line 55: | Line 59: | ||
... | ... | ||
} | } | ||
- | myMod:override(assetData) | + | myMod:overrideAsset(assetData) |
</ | </ | ||
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 | ||
- | '' | + | '' |
^ Name ^ Type ^ Description ^ | ^ Name ^ Type ^ Description ^ | ||
| //'' | | //'' | ||
| //'' | | //'' | ||
+ | | //'' | ||
---- | ---- | ||
Line 76: | Line 81: | ||
Registers a component to a prefab (see [[: | Registers a component to a prefab (see [[: | ||
- | '' | + | '' |
^ Name ^ Type ^ Description ^ | ^ Name ^ Type ^ Description ^ | ||
- | | //'' | + | | //'' |
| //'' | | //'' | ||
Line 90: | Line 95: | ||
} | } | ||
myMod: | myMod: | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== registerBehaviorTree ===== | ||
+ | |||
+ | Registers a new behavior tree (see [[: | ||
+ | |||
+ | '' | ||
+ | |||
+ | ^ Name ^ Type ^ Description ^ | ||
+ | | //'' | ||
+ | |||
+ | ==== Example ==== | ||
+ | |||
+ | <code lua> | ||
+ | myMod: | ||
+ | Id = " | ||
+ | VariableList = { | ||
+ | ... | ||
+ | }, | ||
+ | Root = { | ||
+ | ... | ||
+ | } | ||
+ | }) | ||
</ | </ | ||
Line 98: | Line 128: | ||
Registers an asset processor to a file (see [[: | Registers an asset processor to a file (see [[: | ||
- | '' | + | '' |
^ Name ^ Type ^ Description ^ | ^ Name ^ Type ^ Description ^ | ||
Line 120: | Line 150: | ||
Configure a prefab with a list of flags | Configure a prefab with a list of flags | ||
- | '' | + | '' |
^ Name ^ Type ^ Description ^ | ^ Name ^ Type ^ Description ^ | ||
Line 129: | Line 159: | ||
<code lua> | <code lua> | ||
- | local flagArray = { " | + | local flagArray = { " |
myMod: | myMod: | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== registerClass ===== | ||
+ | |||
+ | Registers a new data type, or a new type extending an existing one | ||
+ | |||
+ | '' | ||
+ | |||
+ | ^ Name ^ Type ^ Description ^ | ||
+ | | //'' | ||
+ | |||
+ | ==== Example ==== | ||
+ | |||
+ | Definition of a new component type with two properties, and an init function | ||
+ | |||
+ | <code lua> | ||
+ | local newClassInfo = { | ||
+ | TypeName = " | ||
+ | ParentType = " | ||
+ | Properties = { | ||
+ | { Name = " | ||
+ | { Name = " | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function newClassInfo: | ||
+ | self.CurrentPosition = self: | ||
+ | end | ||
+ | |||
+ | myMod: | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== registerEnumValue ===== | ||
+ | |||
+ | Registers a new dynamic enumeration value | ||
+ | |||
+ | '' | ||
+ | |||
+ | ^ Name ^ Type ^ Description ^ | ||
+ | | //'' | ||
+ | | //'' | ||
+ | |||
+ | ==== Example ==== | ||
+ | |||
+ | <code lua> | ||
+ | myMod: | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== createData ===== | ||
+ | |||
+ | Creates a new instance of a data type | ||
+ | |||
+ | '' | ||
+ | |||
+ | ^ Name ^ Type ^ Description ^ | ||
+ | | //'' | ||
+ | |||
+ | ==== Example ==== | ||
+ | |||
+ | <code lua> | ||
+ | local instanceData = { | ||
+ | DataType = " | ||
+ | ... | ||
+ | } | ||
+ | myMod: | ||
</ | </ | ||
mod-management-functions.txt · Last modified: 2022/10/07 11:18 by maxime