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/10/22 18:00] – maxime | mod-management-functions [2022/10/07 11:18] (current) – maxime | ||
---|---|---|---|
Line 60: | Line 60: | ||
} | } | ||
myMod: | myMod: | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== 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 77: | Line 166: | ||
---- | ---- | ||
- | ===== registerPrefabComponent | + | ===== registerPrefabChild |
- | Registers a component to a prefab | + | Registers a new child for a prefab |
- | '' | + | '' |
^ Name ^ Type ^ Description ^ | ^ Name ^ Type ^ Description ^ | ||
- | | //'' | + | | //'' |
- | | //'' | + | | //'' |
+ | | //'' | ||
+ | | //'' | ||
==== Example ==== | ==== Example ==== | ||
<code lua> | <code lua> | ||
- | local componentData | + | local newChildTransform |
- | | + | |
- | | + | |
} | } | ||
- | myMod:registerPrefabComponent(prefabPath, | + | |
+ | myMod:registerPrefabChild(prefabPath, | ||
</ | </ | ||
---- | ---- | ||
- | ===== registerBehaviorTree | + | ===== registerPrefabComponent |
- | Registers a new behavior tree (see [[:behavior-trees|Behavior Trees]] for a complete explanation) | + | Registers a component to a prefab |
- | '' | + | '' |
^ Name ^ Type ^ Description ^ | ^ Name ^ Type ^ Description ^ | ||
- | | //'' | + | | //'' |
+ | | //'' | ||
==== Example ==== | ==== Example ==== | ||
<code lua> | <code lua> | ||
- | myMod: | + | local componentData = { |
- | | + | |
- | | + | ... |
- | | + | } |
- | }, | + | myMod: |
- | Root = { | + | |
- | ... | + | |
- | } | + | |
- | }) | + | |
</ | </ | ||
Line 146: | Line 235: | ||
---- | ---- | ||
- | ===== configurePrefabFlagList | + | ===== registerEnumValue |
- | Configure | + | Registers |
- | '' | + | '' |
^ Name ^ Type ^ Description ^ | ^ Name ^ Type ^ Description ^ | ||
- | | //'' | + | | //'' |
- | | //'' | + | | //'' |
==== Example ==== | ==== Example ==== | ||
<code lua> | <code lua> | ||
- | local flagArray = { "BRIDGE", "PLATFORM" | + | myMod: |
- | myMod: | + | |
</ | </ | ||
---- | ---- | ||
- | ===== registerClass | + | ===== configurePrefabFlagList |
- | Registers | + | Configure |
- | '' | + | '' |
^ 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 flagArray |
- | TypeName = "MY_CUSTOM_COMPONENT", | + | myMod:configurePrefabFlagList(prefabPath, flagArray) |
- | ParentType = "COMPONENT", | + | |
- | Properties = { | + | |
- | { Name = " | + | |
- | { Name = " | + | |
- | } | + | |
- | } | + | |
- | + | ||
- | function newClassInfo: | + | |
- | self.CurrentPosition = self: | + | |
- | end | + | |
- | + | ||
- | myMod:registerClass(newClassInfo) | + | |
</ | </ | ||
---- | ---- | ||
- | ===== registerEnumValue | + | ===== overrideTexture |
- | Registers a new dynamic enumeration value | + | Overrides an existing core texture with another one |
- | '' | + | '' |
^ Name ^ Type ^ Description ^ | ^ Name ^ Type ^ Description ^ | ||
- | | //'' | + | | //'' |
- | | //'' | + | | //'' |
- | + | | //'' | |
- | ==== Example ==== | + | |
- | + | ||
- | <code lua> | + | |
- | myMod: | + | |
- | </ | + | |
mod-management-functions.1634940022.txt.gz · Last modified: 2021/10/22 18:00 by maxime