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 [2021/11/12 13:33] – maxime | mod-management-functions [2022/10/07 11:18] (current) – maxime | ||
---|---|---|---|
Line 64: | Line 64: | ||
---- | ---- | ||
- | ===== registerAssetId | + | ===== registerBehaviorTree |
- | Assign an asset ID to an asset in the mod's directory | + | Registers a new behavior tree (see [[: |
- | '' | + | '' |
^ Name ^ Type ^ Description ^ | ^ Name ^ Type ^ Description ^ | ||
- | | //'' | + | | //'' |
- | | //'' | + | |
- | | //'' | + | ==== Example ==== |
+ | |||
+ | <code lua> | ||
+ | myMod: | ||
+ | Id = " | ||
+ | VariableList = { | ||
+ | ... | ||
+ | }, | ||
+ | Root = { | ||
+ | ... | ||
+ | } | ||
+ | }) | ||
+ | </code> | ||
---- | ---- | ||
- | ===== registerPrefabComponent | + | ===== registerBehaviorTreeNode |
- | Registers a component to a prefab | + | Registers a new behavior tree node (see [[:behavior-trees|Behavior Trees]] for a complete explanation) |
- | '' | + | '' |
^ Name ^ Type ^ Description ^ | ^ Name ^ Type ^ Description ^ | ||
- | | //'' | + | | //'' |
- | | //'' | + | |
==== Example ==== | ==== Example ==== | ||
<code lua> | <code lua> | ||
- | local componentData = { | + | myMod: |
- | | + | |
- | ... | + | |
- | } | + | |
- | myMod: | + | }, |
+ | Init = function(self, instance) | ||
+ | ... | ||
+ | end, | ||
+ | Update = function(self, | ||
+ | ... | ||
+ | return BEHAVIOR_TREE_NODE_RESULT.TRUE | ||
+ | end, | ||
+ | Finish = function(self, | ||
+ | ... | ||
+ | end | ||
+ | }) | ||
</ | </ | ||
---- | ---- | ||
- | ===== registerBehaviorTree | + | ===== registerClass |
- | Registers a new behavior tree (see [[: | + | Registers a new data type, or a new type extending an existing one |
- | '' | + | '' |
^ Name ^ Type ^ Description ^ | ^ Name ^ Type ^ Description ^ | ||
- | | //'' | + | | //'' |
==== Example ==== | ==== Example ==== | ||
+ | |||
+ | Definition of a new component type with two properties, and an init function | ||
<code lua> | <code lua> | ||
- | myMod: | + | local newClassInfo = { |
- | | + | |
- | | + | |
- | ... | + | Properties |
- | }, | + | |
- | Root = { | + | |
- | | + | |
} | } | ||
- | }) | + | } |
+ | |||
+ | function newClassInfo: | ||
+ | self.CurrentPosition = self: | ||
+ | end | ||
+ | |||
+ | myMod: | ||
</ | </ | ||
---- | ---- | ||
- | ===== registerAssetProcessor | + | ===== registerAssetId |
- | Registers | + | Assign |
- | '' | + | '' |
^ Name ^ Type ^ Description ^ | ^ Name ^ Type ^ Description ^ | ||
- | | //'' | + | | //'' |
- | | //'' | + | | //'' |
+ | | //'' | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== registerPrefabChild ===== | ||
+ | |||
+ | Registers a new child for a prefab | ||
+ | |||
+ | '' | ||
+ | |||
+ | ^ Name ^ Type ^ Description ^ | ||
+ | | //'' | ||
+ | | //'' | ||
+ | | //'' | ||
+ | | //'' | ||
==== Example ==== | ==== Example ==== | ||
<code lua> | <code lua> | ||
- | local processorData= { | + | local newChildTransform |
- | | + | |
- | | + | |
} | } | ||
- | myMod:registerPrefabComponent(filePath, processorData) | + | |
+ | myMod:registerPrefabChild(prefabPath, " | ||
</ | </ | ||
---- | ---- | ||
- | ===== configurePrefabFlagList | + | ===== registerPrefabComponent |
- | Configure | + | Registers a component to a prefab |
- | '' | + | '' |
^ Name ^ Type ^ Description ^ | ^ Name ^ Type ^ Description ^ | ||
- | | //'' | + | | //'' |
- | | //'' | + | | //'' |
==== Example ==== | ==== Example ==== | ||
<code lua> | <code lua> | ||
- | local flagArray | + | local componentData |
- | myMod:configurePrefabFlagList(prefabPath, | + | DataType = "COMPONENT_TYPE", |
+ | ... | ||
+ | } | ||
+ | myMod:registerPrefabComponent(prefabPath, | ||
</ | </ | ||
---- | ---- | ||
- | ===== registerClass | + | ===== registerAssetProcessor |
- | Registers a new data type, or a new type extending an existing one | + | Registers |
- | '' | + | '' |
^ Name ^ Type ^ Description ^ | ^ Name ^ Type ^ Description ^ | ||
- | | //'' | + | | //'' |
+ | | //'' | ||
==== Example ==== | ==== Example ==== | ||
- | |||
- | Definition of a new component type with two properties, and an init function | ||
<code lua> | <code lua> | ||
- | local newClassInfo | + | local processorData= { |
- | | + | |
- | | + | ... |
- | Properties = { | + | |
- | { Name = " | + | |
- | { Name = " | + | |
- | } | + | |
} | } | ||
- | + | myMod:registerPrefabComponent(filePath, processorData) | |
- | function newClassInfo: | + | |
- | self.CurrentPosition = self: | + | |
- | end | + | |
- | + | ||
- | myMod:registerClass(newClassInfo) | + | |
</ | </ | ||
Line 215: | Line 253: | ||
---- | ---- | ||
- | ===== createData | + | ===== configurePrefabFlagList |
- | Creates | + | Configure |
- | '' | + | '' |
^ Name ^ Type ^ Description ^ | ^ Name ^ Type ^ Description ^ | ||
- | | //'' | + | | //'' |
+ | | //'' | ||
==== Example ==== | ==== Example ==== | ||
<code lua> | <code lua> | ||
- | local instanceData | + | local flagArray |
- | DataType = "DATA_TYPE", | + | myMod:configurePrefabFlagList(prefabPath, flagArray) |
- | ... | + | |
- | } | + | |
- | myMod:createData(instanceData | + | |
</ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== overrideTexture ===== | ||
+ | |||
+ | Overrides an existing core texture with another one | ||
+ | |||
+ | '' | ||
+ | |||
+ | ^ Name ^ Type ^ Description ^ | ||
+ | | //'' | ||
+ | | //'' | ||
+ | | //'' | ||
mod-management-functions.1636742009.txt.gz · Last modified: 2021/11/12 13:33 by maxime