ACRs

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

An empty group. opts can turn on debug output for every node in it: {dbg = true}, or dbg_condition / dbg_execute.
Adds the builder's nodes with this priority, and returns the group. Among nodes that can run, the highest priority wins; on a tie, the one pushed last.
A condition the whole group needs. Returns the group.
A condition of which at least one must hold. Returns the group.
Whether the group's conditions hold and any of its nodes can run.
Runs the group: see below.

NodeTree

NodeTree()NodeTree
An empty tree.
Adds a NodeGroup or another NodeTree with this priority, and returns the tree.
A condition the whole tree needs. Returns the tree.
A condition of which at least one must hold. Returns the tree.
Whether anything in the tree can run.
Runs the tree: see below.

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_cast node that can run;
  • every instant cast that can run;
  • one pet order: the highest priority Kennel node 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.