User Tools

Site Tools



behaviortree

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
behaviortree [2017/01/07 10:45] mmoaltbehaviortree [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" and there are still improvements coming in the future.  +Behavior Trees are a wonderful thing when it comes to writing any kind of AI logic. It is currently in its "first working version" and there are still improvements coming in the future. 
-GW2Minion is completely written with this framework. FFXIVMinion is not making use of this, but it *could* be used as well.+  
 +**FFXIVMinion** is not making use of this, but it *could* be used as well. Instead, it uses the 'older' Cause&Effect framework. Example Code how to build your own addon : {{ ::newaddon.zip |}}
  
 **BT Basics, How they work:** [[http://www.gamasutra.com/blogs/ChrisSimpson/20140717/221339/Behavior_trees_for_AI_How_they_work.php|Behavior trees for AI]] **BT Basics, How they work:** [[http://www.gamasutra.com/blogs/ChrisSimpson/20140717/221339/Behavior_trees_for_AI_How_they_work.php|Behavior trees for AI]]
Line 41: Line 42:
   
  -- Load all our local "bot/addon" BTree files  -- Load all our local "bot/addon" BTree files
- BehaviorManager:LoadBehaviorFromFolder(GetLuaModsPath()  .. "\\\GW2Minion\\\SillyJumper")+ BehaviorManager:LoadBehaviorFromFolder(GetLuaModsPath()  .. "\\\SillyJumper")
   
 end end
Line 69: Line 70:
 {{youtube>MMASYe_FEuU?medium}} {{youtube>MMASYe_FEuU?medium}}
  
 +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 
 +</code>
 \\ \\
  
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 "context" table to the BTree:                         -- (optional) Callback function, is called by the BTree Framework when the BTree is started. Allows us to supply a custom "context" table to the BTree:
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 "context" table to the BTree:  -- (optional) Callback function, is called by the BTree Framework when the BTree is started. Allows us to supply a custom "context" table to the BTree:
  LoadContext = function() return sillyjumper.GetContext() end,  LoadContext = function() return sillyjumper.GetContext() end,
Line 324: Line 328:
   
  -- 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,
   
  -- if set, the btree will not appear in the botmode dropdown  -- if set, the btree will not appear in the botmode dropdown
         internal = false,         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 "context" table to the BTree:  -- (optional) Callback function, is called by the BTree Framework when the BTree is started. Allows us to supply a custom "context" table to the BTree:
Line 345: Line 352:
  -- Required for private addons with additional private sub-behavior trees  -- Required for private addons with additional private sub-behavior trees
  LoadSubTree = function(filename) end,  LoadSubTree = function(filename) end,
 +
 } }
 </code> </code>
Line 355: Line 363:
 BehaviorManager:Start() BehaviorManager:Start()
 BehaviorManager:Stop() BehaviorManager:Stop()
-BehaviorManager:GetTicksThreshold()+BehaviorManager:GetTicksThreshold()  -- How often (in ms) the BTree is being called. 
 +BehaviorManager:SetTicksThreshold(milliseconds)
 BehaviorManager:GetLastTick() BehaviorManager:GetLastTick()
 BehaviorManager:SetLastTick(ticks) BehaviorManager:SetLastTick(ticks)
Line 363: Line 372:
 BehaviorManager:Paused(p) BehaviorManager:Paused(p)
 BehaviorManager:CurrentBTreeName() BehaviorManager:CurrentBTreeName()
 +BehaviorManager:SetBtreeFile(botmode_name)
 </code> </code>
behaviortree.1483785928.txt.gz · Last modified: 2017/01/07 10:45 by mmoalt