Game Development Reference
In-Depth Information
The random move behavior
Randomly moving is one of the least prioritized behaviors and is a tossup between ran-
domly choosing a spot to move to and just idling at a place:
function SoldierLogic_BehaviorTree(userData)
...
-- random action
node = node:GetParent();
node = node:GetParent();
child = CreateSequence();
node:AddChild(child);
node = child;
child = CreateCondition(
"50/50 chance", SoldierEvaluators_Random);
node:AddChild(child);
node = child;
node = node:GetParent();
child = CreateAction(
"random move", RandomMoveAction(userData));
node:AddChild(child);
node = child;
return tree;
end
Search WWH ::




Custom Search