mod-management-functions
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
mod-management-functions [2020/05/06 16:52] – maxime | mod-management-functions [2022/10/07 11:18] (current) – 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) |
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== registerBehaviorTree ===== | ||
+ | |||
+ | Registers a new behavior tree (see [[: | ||
+ | |||
+ | '' | ||
+ | |||
+ | ^ Name ^ Type ^ Description ^ | ||
+ | | //'' | ||
+ | |||
+ | ==== Example ==== | ||
+ | |||
+ | <code lua> | ||
+ | myMod: | ||
+ | Id = " | ||
+ | VariableList = { | ||
+ | ... | ||
+ | }, | ||
+ | Root = { | ||
+ | ... | ||
+ | } | ||
+ | }) | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== registerBehaviorTreeNode ===== | ||
+ | |||
+ | Registers a new behavior tree node (see [[: | ||
+ | |||
+ | '' | ||
+ | |||
+ | ^ Name ^ Type ^ Description ^ | ||
+ | | //'' | ||
+ | |||
+ | ==== Example ==== | ||
+ | |||
+ | <code lua> | ||
+ | myMod: | ||
+ | Id = " | ||
+ | VariableList = { | ||
+ | ... | ||
+ | }, | ||
+ | Init = function(self, | ||
+ | ... | ||
+ | end, | ||
+ | Update = function(self, | ||
+ | ... | ||
+ | return BEHAVIOR_TREE_NODE_RESULT.TRUE | ||
+ | end, | ||
+ | Finish = function(self, | ||
+ | ... | ||
+ | end | ||
+ | }) | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== 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: | ||
</ | </ | ||
Line 64: | Line 157: | ||
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 ^ | ||
| //'' | | //'' | ||
| //'' | | //'' | ||
+ | | //'' | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== registerPrefabChild ===== | ||
+ | |||
+ | Registers a new child for a prefab | ||
+ | |||
+ | '' | ||
+ | |||
+ | ^ Name ^ Type ^ Description ^ | ||
+ | | //'' | ||
+ | | //'' | ||
+ | | //'' | ||
+ | | //'' | ||
+ | |||
+ | ==== Example ==== | ||
+ | |||
+ | <code lua> | ||
+ | local newChildTransform = { | ||
+ | Position = { 0, 0, 1 }, | ||
+ | Rotation = { 0, -180, 0 } | ||
+ | } | ||
+ | |||
+ | myMod: | ||
+ | </ | ||
---- | ---- | ||
Line 76: | Line 195: | ||
Registers a component to a prefab (see [[: | Registers a component to a prefab (see [[: | ||
- | '' | + | '' |
^ Name ^ Type ^ Description ^ | ^ Name ^ Type ^ Description ^ | ||
- | | //'' | + | | //'' |
| //'' | | //'' | ||
Line 98: | Line 217: | ||
Registers an asset processor to a file (see [[: | Registers an asset processor to a file (see [[: | ||
- | '' | + | '' |
^ Name ^ Type ^ Description ^ | ^ Name ^ Type ^ Description ^ | ||
Line 112: | Line 231: | ||
} | } | ||
myMod: | myMod: | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== registerEnumValue ===== | ||
+ | |||
+ | Registers a new dynamic enumeration value | ||
+ | |||
+ | '' | ||
+ | |||
+ | ^ Name ^ Type ^ Description ^ | ||
+ | | //'' | ||
+ | | //'' | ||
+ | |||
+ | ==== Example ==== | ||
+ | |||
+ | <code lua> | ||
+ | myMod: | ||
</ | </ | ||
Line 120: | Line 257: | ||
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 266: | ||
<code lua> | <code lua> | ||
- | local flagArray = { " | + | local flagArray = { " |
myMod: | myMod: | ||
</ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== overrideTexture ===== | ||
+ | |||
+ | Overrides an existing core texture with another one | ||
+ | |||
+ | '' | ||
+ | |||
+ | ^ Name ^ Type ^ Description ^ | ||
+ | | //'' | ||
+ | | //'' | ||
+ | | //'' | ||
mod-management-functions.1588798326.txt.gz · Last modified: 2020/05/06 16:52 by maxime