[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.4.4 Behaviour Tree Load Addon

With the ‘cel.addons.questdef’ addon you can define behaviour trees (see section Behaviour Tree) directly in a world file. Here is an example:

 
<behaviour_tree name="testXML-BT">
  <selector type="sequential" name="sequential_root">
    <leaf_node type="action" name="StartupMessage">
      <reward type="debugprint" message="Welcome! This behaviour has been loaded from XML!" />
    </leaf_node>
    <selector type="random" name="random_example">
      <leaf_node type="action" name="Working_Action_Example">
        <reward type="debugprint" message="Now with functioning actions!" />
      </leaf_node>
      <decorator type="negatereturn">
        <leaf_node type="parametercheck" name="Param Check" parameter="2" value="2"></leaf_node>
      </decorator>
    </selector>
    <selector type="default" name="example_default_selector">
      <decorator type="loop" name="loop_limit" limit="2">
        <decorator type="executionlimit" limit="1">
          <leaf_node type="parametercheck" name="Param Check" parameter="2" value="2" />
        </decorator>
      </decorator>
      <leaf_node type="parametercheck" name="Param Check" parameter="2" value="3" />
      <leaf_node type="triggerfired" name="Untested Trigger Example">
        <trigger type="message">
          <fireon entity="player" mask="activate" />
        </trigger>
      </leaf_node>
    </selector>
  </selector>
</behaviour_tree>

This document was generated using texi2html 1.76.