Action Registration

From ABL
Revision as of 12:29, 23 August 2006 by Sooraj (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

ABL act signatures are registered with concrete action classes. The ABL action registration syntax is:

register act action with PrimitiveAct;
register act walkto(double, double, double) with WalkTo;

In Context

In the context of a full ABL file, the action registration is near the top:

behaving_entity Jack

     Setup sensor-action stuff.
    conflict jump jump; ...

    register act jump() with Jump;
    register act walkto(double, double, double) with WalkTo;

    register wme ObjectPositionWME with ObjectPositionSensor;

    java.lang.String PLAYER_REALNAME = "Player";

Now when the act walkto appears as a step in a behavior, ABL automatically type checks the argument(s) at compile time, and at runtime makes use of the methods defined on WalkTo to execute the action, wait for a callback, and abort the action if the act step is removed from the ABT before completion (see ABL Decision Cycle and Active Behavior Tree). Both the name of the action and the types of the arguments in an act step are used to determine which registered concrete action instance to use, so actions can be overloaded as long as they are distinguishable by type signature.