Reader small image

You're reading from  Learning Game AI Programming with Lua

Product typeBook
Published inNov 2014
Reading LevelBeginner
PublisherPackt
ISBN-139781783281336
Edition1st Edition
Languages
Right arrow
Author (1)
David Young
David Young
Right arrow

Conditions


Conditions are similar to actions and are also leaves in a behavior tree. Condition nodes will execute the evaluator assigned to them and return the result to the caller to determine how they should be processed.

SoldierLogic.lua:

local function CreateCondition(name, evaluator)
    local condition = BehaviorTreeNode.new(
        name, BehaviorTreeNode.Type.CONDITION);
    condition:SetEvaluator(evaluator);
    return condition;
end
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Learning Game AI Programming with Lua
Published in: Nov 2014Publisher: PacktISBN-13: 9781783281336

Author (1)