Groups and trees
NodeGroup and NodeTree: priorities, conditions and what runs each tick.
Nodes go in a NodeGroup, each with a priority: higher runs first. Groups can have conditions of their own, and go in a NodeTree with priorities too, so a rotation can switch between whole sets of skills: one per weapon set, an opener and the rest of the fight, a burst phase.
local rifle = NodeGroup()
:when(function() return util.on_bar(RIFLE_2) end)
:push(10, rifle_4)
:push(9, rifle_2)
:push(1, rifle_1)
local grenades = NodeGroup()
:when(function() return util.on_bar(GRENADE_KIT_1) end)
:push(10, grenade_2)
:push(1, grenade_1)
self.root = NodeTree()
:push(10, rifle)
:push(9, grenades)NodeGroup
opts can turn on debug output for every node in it: {dbg = true}, or dbg_condition / dbg_execute.NodeTree
What runs
Each execute runs, in this order:
- one normal skill: the highest priority node that can run and isn't an instant cast or pet order;
- one single instant cast: the highest priority
single_insta_castnode that can run; - every instant cast that can run;
- one pet order: the highest priority
Kennelnode that can run.
Nothing runs while the group's (or tree's) own conditions don't hold. In a tree, the one normal skill, single instant cast and pet order each come from the highest priority child that has one, going down the tree until a group. Instant casts come from every group in the tree whose conditions hold.
So priorities only compare nodes of one kind: an instant cast never stops a normal skill, and a normal skill is never held back by a higher priority instant cast.