This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| behaviortree [2017/01/07 10:42] – mmoalt | behaviortree [2022/07/18 09:27] (current) – fxfire | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| =====Behavior Tree Framwork===== | =====Behavior Tree Framwork===== | ||
| - | Behavior Trees are a wonderful thing when it comes to writing any kind of AI logic. It is currently in its "first working version" | + | Behavior Trees are a wonderful thing when it comes to writing any kind of AI logic. It is currently in its "first working version" |
| - | GW2Minion is completely written with this framework. | + | |
| + | **FFXIVMinion** is not making use of this, but it *could* be used as well. Instead, it uses the ' | ||
| **BT Basics, How they work:** [[http:// | **BT Basics, How they work:** [[http:// | ||
| Line 41: | Line 42: | ||
| -- Load all our local " | -- Load all our local " | ||
| - | BehaviorManager: | + | BehaviorManager: |
| end | end | ||
| Line 69: | Line 70: | ||
| {{youtube> | {{youtube> | ||
| + | EDIT: Above the lines where you add the Checkbox, you need to make sure the used variable is NOT nil, so put this above: | ||
| + | <code lua> | ||
| + | if (not Settings.sillyjumper.jump ) then Settings.sillyjumper.jump = false end | ||
| + | </ | ||
| \\ | \\ | ||
| Line 112: | Line 116: | ||
| Reload = function() sillyjumper.LoadBehaviorFiles() end, | Reload = function() sillyjumper.LoadBehaviorFiles() end, | ||
| -- if set, it will be treated as a private addon, loadable from the addon store | -- if set, it will be treated as a private addon, loadable from the addon store | ||
| - | private = true, | + | private = false, |
| } | } | ||
| Line 201: | Line 205: | ||
| Reload = function() sillyjumper.LoadBehaviorFiles() end, | Reload = function() sillyjumper.LoadBehaviorFiles() end, | ||
| -- if set, it will be treated as a private addon, loadable from the addon store | -- if set, it will be treated as a private addon, loadable from the addon store | ||
| - | private = true, | + | private = false, |
| | | ||
| -- (optional) Callback function, is called by the BTree Framework when the BTree is started. Allows us to supply a custom " | -- (optional) Callback function, is called by the BTree Framework when the BTree is started. Allows us to supply a custom " | ||
| Line 256: | Line 260: | ||
| Reload = function() sillyjumper.LoadBehaviorFiles() end, | Reload = function() sillyjumper.LoadBehaviorFiles() end, | ||
| -- if set, it will be treated as a private addon, loadable from the addon store | -- if set, it will be treated as a private addon, loadable from the addon store | ||
| - | private = true, | + | private = false, |
| -- (optional) Callback function, is called by the BTree Framework when the BTree is started. Allows us to supply a custom " | -- (optional) Callback function, is called by the BTree Framework when the BTree is started. Allows us to supply a custom " | ||
| LoadContext = function() return sillyjumper.GetContext() end, | LoadContext = function() return sillyjumper.GetContext() end, | ||
| Line 315: | Line 319: | ||
| local btreeinfo = { | local btreeinfo = { | ||
| -- Our Main Behaviortree filename: | -- Our Main Behaviortree filename: | ||
| - | filename = " | + | filename = string, |
| - | -- Our Foldername and a mandatory subfolder where our " | + | |
| - | filepath = GetLuaModsPath() | + | -- Our Foldername and a mandatory subfolder where our btree will be loaded from: |
| + | filepath = string, | ||
| + | |||
| -- Callback function, when the BTree was changed and saved in the BT-Editor. Reload all addon bt files here, including private subtrees. | -- Callback function, when the BTree was changed and saved in the BT-Editor. Reload all addon bt files here, including private subtrees. | ||
| - | Reload = function() sillyjumper.LoadBehaviorFiles() end, | + | Reload = function() end, |
| + | |||
| -- if set, it will be treated as a private addon, loadable from the addon store | -- if set, it will be treated as a private addon, loadable from the addon store | ||
| - | private = true, | + | private = false, |
| - | + | ||
| - | -- (optional) Callback function, is called by the BTree Framework when the BTree is started. Allows us to supply a custom " | + | -- if set, the btree will not appear in the botmode dropdown |
| - | LoadContext = function() return sillyjumper.GetContext() end, | + | internal = false, |
| + | |||
| + | -- Preloaded task data. Important when using a private addon. | ||
| + | data = table, | ||
| + | |||
| + | -- (optional) Callback function, is called by the BTree Framework when the BTree is started. Allows us to supply a custom " | ||
| + | LoadContext = function() end, | ||
| - | -- (optional) Function to draw the menu elements that always appears on the "Main menu" interface. | + | -- (optional) Function to draw the menu elements that always appears on the "Main menu" interface. |
| DrawMenuCode = function(btree) end, | DrawMenuCode = function(btree) end, | ||
| | | ||
| Line 335: | Line 348: | ||
| -- (optional) Function to draw the menu elements that appears on the subtree node. This is also used for drawing custom properties in the taskmanager. | -- (optional) Function to draw the menu elements that appears on the subtree node. This is also used for drawing custom properties in the taskmanager. | ||
| -- This locks the edit field inside the btree editor. | -- This locks the edit field inside the btree editor. | ||
| - | DrawSubMenuCode = function(btree) end | + | DrawSubMenuCode = function(btree) end, |
| + | |||
| + | -- Required for private addons with additional private sub-behavior trees | ||
| + | LoadSubTree = function(filename) end, | ||
| } | } | ||
| </ | </ | ||
| Line 346: | Line 363: | ||
| BehaviorManager: | BehaviorManager: | ||
| BehaviorManager: | BehaviorManager: | ||
| - | BehaviorManager: | + | BehaviorManager: |
| + | BehaviorManager: | ||
| BehaviorManager: | BehaviorManager: | ||
| BehaviorManager: | BehaviorManager: | ||
| Line 354: | Line 372: | ||
| BehaviorManager: | BehaviorManager: | ||
| BehaviorManager: | BehaviorManager: | ||
| + | BehaviorManager: | ||
| </ | </ | ||