User Tools

Site Tools


mod-management-functions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
mod-management-functions [2020/07/08 10:37] maximemod-management-functions [2020/12/14 09:49] – [registerPrefabComponent] maxime
Line 76: Line 76:
 Registers a component to a prefab (see [[:components|Components]] for a complete explanation) Registers a component to a prefab (see [[:components|Components]] for a complete explanation)
  
-''void **myMod:registerPrefabComponent**(//prefabPath//, //componentData//)''+''void **myMod:registerPrefabComponent**(//prefabIdOrPath//, //componentData//)''
  
 ^ Name ^ Type ^ Description ^ ^ Name ^ Type ^ Description ^
-| //''prefabPath''// | ''string'' | the path to the prefab |+| //''prefabIdOrPath''// | ''string'' | the ID or path to the prefab |
 | //''componentData''// | ''table'' | the data defining the component. The table must contain at least the component's type (''DataType'', see [[api#component_classes|API]] for the complete list) | | //''componentData''// | ''table'' | the data defining the component. The table must contain at least the component's type (''DataType'', see [[api#component_classes|API]] for the complete list) |
  
Line 90: Line 90:
 } }
 myMod:registerPrefabComponent(prefabPath, componentData) myMod:registerPrefabComponent(prefabPath, componentData)
 +</code>
 +
 +----
 +
 +===== registerBehaviorTree =====
 +
 +Registers a new behavior tree (see [[:behavior-trees|Behavior Trees]] for a complete explanation)
 +
 +''void **myMod:registerBehaviorTree**(//behaviorTree//)''
 +
 +^ Name ^ Type ^ Description ^
 +| //''behaviorTree''// | ''table'' | the table defining the behavior tree's variables and node tree |
 +
 +==== Example ====
 +
 +<code lua>
 +myMod:registerBehaviorTree({
 +    Id = "MY_CUSTOM_BEHAVIOR_TREE",
 +    VariableList = {
 +        ...
 +    },
 +    Root = {
 +        ...
 +    }
 +})
 </code> </code>
  
mod-management-functions.txt · Last modified: 2022/10/07 11:18 by maxime

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki