This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
behaviortree [2017/01/07 10:37] – mmoalt | behaviortree [2021/02/16 09:44] – frenkey | ||
---|---|---|---|
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. | + | |
+ | **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 44: | ||
-- Load all our local " | -- Load all our local " | ||
- | BehaviorManager: | + | BehaviorManager: |
end | end | ||
Line 69: | Line 72: | ||
{{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 118: | ||
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 207: | ||
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, | ||
- | | + | |
- | -- (optional) Function to draw the menu elements that appears on the "Main menu" interface. | + | -- (optional) Function to draw the menu elements that always |
+ | DrawMenuCode = function(btree) end, | ||
+ | |||
+ | -- (optional) Function to draw the menu elements that appears on the "Main menu" interface when the btree is selected. | ||
-- This locks the edit field inside the btree editor. | -- This locks the edit field inside the btree editor. | ||
DrawMainMenuCode = function(btree) end, | DrawMainMenuCode = function(btree) end, | ||
Line 253: | Line 262: | ||
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 308: | Line 317: | ||
* There are additional BehaviorManager functions that might be helpful to you: | * There are additional BehaviorManager functions that might be helpful to you: | ||
+ | === 11. BTreeinfo === | ||
+ | <code lua> | ||
+ | local btreeinfo = { | ||
+ | -- Our Main Behaviortree filename: | ||
+ | filename = string, | ||
+ | |||
+ | -- 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. | ||
+ | Reload = function() end, | ||
+ | |||
+ | -- if set, it will be treated as a private addon, loadable from the addon store | ||
+ | private = false, | ||
+ | |||
+ | -- if set, the btree will not appear in the botmode dropdown | ||
+ | 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. (Requires internal) | ||
+ | DrawMenuCode = function(btree) end, | ||
+ | | ||
+ | -- (optional) Function to draw the menu elements that appears on the "Main menu" interface when the btree is selected. | ||
+ | -- This locks the edit field inside the btree editor. | ||
+ | DrawMainMenuCode = function(btree) end, | ||
+ | |||
+ | -- (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. | ||
+ | DrawSubMenuCode = function(btree) end, | ||
+ | |||
+ | -- Required for private addons with additional private sub-behavior trees | ||
+ | LoadSubTree = function(filename) end, | ||
+ | |||
+ | } | ||
+ | </ | ||
+ | |||
+ | === 12. BehaviorManager functions === | ||
<code lua> | <code lua> | ||
BehaviorManager: | BehaviorManager: | ||
Line 314: | Line 365: | ||
BehaviorManager: | BehaviorManager: | ||
BehaviorManager: | BehaviorManager: | ||
- | BehaviorManager: | + | BehaviorManager: |
+ | BehaviorManager: | ||
BehaviorManager: | BehaviorManager: | ||
BehaviorManager: | BehaviorManager: | ||
Line 322: | Line 374: | ||
BehaviorManager: | BehaviorManager: | ||
BehaviorManager: | BehaviorManager: | ||
+ | BehaviorManager: | ||
</ | </ | ||
- |