- type: htnCompound
  id: WeldbotCompound
  branches:
    - tasks:
        - !type:HTNCompoundTask
          task: WeldNearbyCompound
    - tasks:
        - !type:HTNCompoundTask
          task: IdleCompound

- type: htnCompound
  id: WeldNearbyCompound
  branches:
    - tasks:
        - !type:HTNPrimitiveTask
          operator: !type:PickNearbyWeldableOperator
            targetKey: WeldTarget
            targetMoveKey: TargetCoordinates

        - !type:HTNPrimitiveTask
          operator: !type:SpeakOperator
            speech: weldbot-start-weld
            hidden: true

        - !type:HTNPrimitiveTask
          operator: !type:MoveToOperator
            pathfindInPlanning: false

        - !type:HTNPrimitiveTask
          operator: !type:SetFloatOperator
            targetKey: IdleTime
            amount: 3

        - !type:HTNPrimitiveTask
          operator: !type:WaitOperator
            key: IdleTime
          preconditions:
            - !type:KeyExistsPrecondition
              key: IdleTime

        - !type:HTNPrimitiveTask
          operator: !type:WeldbotWeldOperator
            targetKey: WeldTarget
