DI-Guy SDK Documentation  13.2
DI-Guy

The portion of the API focused on adding entities to your world. More...

Classes

class  diguyApp
 An Singleton class representing the DI-Guy Application. More...
 
class  diguyChainSettings
 chain settings.. Rarely used More...
 
class  diguyChainSimulation
 wrapper around a chain simulation More...
 
class  diguyCharacter
 The class that represents a DI-Guy Entity in the world. More...
 
class  diguyCharacterFaceExpression
 A class representing a facial pose. More...
 
class  diguyCharacterGesture
 A class representing a overlaid performance on a character's base animation. More...
 
class  diguyCharacterGroup
 A group of DI-Guy characters, useful for organizing your scenarios. More...
 
class  diguyCharacterPath
 An interface for manipulating a character's spline path. A path is typically authored in DI-Guy Scenario, but can be manipulated via the sdk. More...
 
class  diguyCharacterPathActionBead
 A bead that sits on a character's spline path and triggers a new action. More...
 
class  diguyCharacterPathAimBead
 A bead that sits on a character's spline path and triggers a new aim event. More...
 
class  diguyCharacterPathDecisionBead
 A bead that sits on a character's spline path and triggers a new decision. More...
 
class  diguyCharacterPathEvent
 Interface to base class of event beads, not often used. More...
 
class  diguyCharacterPathGazeBead
 A bead that sits on a character's spline path and triggers a new gaze. More...
 
class  diguyCharacterPathScriptBead
 A bead that sits on a character's spline path and triggers a new script evaluation. More...
 
class  diguyCharacterPoseOverride
 A class that allows end users to override a character's animation on a joint level. More...
 
class  diguyLinkController
 A class that allows end users to override a character's animation on a joint level. this class complements the diguyPoseOverride system with one that is a bit more scriptable and can handle automatic animation effects. More...
 
class  diguySensorRegion
 
class  diguySignal
 
class  diguyVariable
 
class  diguyVehicleController
 Attached to certain types of more complex vehicles, to manage their behavior. More...
 
class  diguyVehicleNearCollision
 
class  diguyLoadManager
 
class  diguyPathShape
 
class  diguySound
 This class is represents a sound file on disk. More...
 
class  diguySoundInstance
 
class  diguyWaypoint
 
class  diguyCharacterGuide
 Represents algorithm for steering and maneuvering a character towards a goal point. More...
 
class  diguyFormation
 A class that represents the layout of a group of characters. More...
 
class  diguyImpact
 A class that represents a bullet impact in the world, often used by AIs to make reaction decisions. More...
 
class  diguyMathHelper
 Contains useful math functions. More...
 
class  diguyScenario
 Represents the scenario currently being portrayed. More...
 
class  diguyScenarioMergeSettings
 
class  diguySceneObject
 A scene object is a static (that is, non-moving) object in the scenario. Scene objects are the basic terrain that characters are ground-clamped to and navigate around or on. Scene objects do not typically animate. More...
 

Callback Functions

enum  {
  diguyCharacter::CALLBACK_ID_CREATE = 1, diguyCharacter::CALLBACK_ID_DESTROY, diguyCharacter::CALLBACK_ID_PRE_CREATE, diguyCharacter::CALLBACK_ID_CURRENT_APPEARANCE_CHANGED,
  diguyCharacter::CALLBACK_ID_CURRENT_HEAD_APPEARANCE_CHANGED, diguyCharacter::CALLBACK_ID_CURRENT_HAND_ITEM_APPEARANCE_CHANGED, diguyCharacter::CALLBACK_ID_SHAPE_VISIBILITY_CHANGED, diguyCharacter::CALLBACK_ID_PRE_UPDATE,
  diguyCharacter::CALLBACK_ID_POST_UPDATE, diguyCharacter::CALLBACK_ID_DONE_SPEAKING, diguyCharacter::CALLBACK_ID_GAZE_STATUS, diguyCharacter::CALLBACK_ID_LPOINT_STATUS,
  diguyCharacter::CALLBACK_ID_SHOW, diguyCharacter::CALLBACK_ID_HIDE, diguyCharacter::CALLBACK_ID_PRE_DIE, diguyCharacter::CALLBACK_ID_POST_DIE,
  diguyCharacter::CALLBACK_ID_PRE_FIRE_WEAPON, diguyCharacter::CALLBACK_ID_POST_FIRE_WEAPON, diguyCharacter::CALLBACK_ID_IMPACT, diguyCharacter::CALLBACK_ID_FIRE_WEAPON_SUCCESS,
  diguyCharacter::CALLBACK_ID_CURRENT_ACTION_CHANGED, diguyCharacter::CALLBACK_ID_DESIRED_ACTION_CHANGED, diguyCharacter::CALLBACK_ID_DESIRED_ACTION_REACHED, diguyCharacter::CALLBACK_ID_MANUALLY_INVOKED,
  diguyCharacter::CALLBACK_ID_USER_SELECTED, diguyCharacter::CALLBACK_ID_USER_UNSELECTED, diguyCharacter::CALLBACK_ID_IGUY_INTERACT, diguyCharacter::CALLBACK_ID_IGUY_INTERACT_WITH_SUBJECT,
  diguyCharacter::CALLBACK_ID_GUIDE_POSITION_ACQUIRED, diguyCharacter::CALLBACK_ID_GUIDE_POSITION_UNACQUIRED, diguyCharacter::CALLBACK_ID_GUIDE_ORIENTATION_ACQUIRED, diguyCharacter::CALLBACK_ID_GUIDE_ORIENTATION_UNACQUIRED,
  diguyCharacter::CALLBACK_ID_GUIDE_ALTITUDE_ACQUIRED, diguyCharacter::CALLBACK_ID_GUIDE_ALTITUDE_UNACQUIRED, diguyCharacter::CALLBACK_ID_GUIDE_TARGET_LOST, diguyCharacter::CALLBACK_ID_CURRENT_TOUT_REACHED,
  diguyCharacter::CALLBACK_ID_POST_CREATE_GEOMETRY, diguyCharacter::CALLBACK_ID_PRE_DESTROY_GEOMETRY, diguyCharacter::CALLBACK_ID_END_OF_PATH_REACHED, diguyCharacter::CALLBACK_ID_CHARACTER_CLICKED,
  diguyCharacter::CALLBACK_ID_UI_PRE_TRANSLATION, diguyCharacter::CALLBACK_ID_UI_POST_TRANSLATION, diguyCharacter::CALLBACK_ID_UI_MOUSE_DOWN, diguyCharacter::CALLBACK_ID_UI_MOUSE_UP,
  diguyCharacter::CALLBACK_ID_UI_RIGHT_MOUSE_DOWN, diguyCharacter::CALLBACK_ID_UI_RIGHT_MOUSE_UP, diguyCharacter::CALLBACK_ID_UI_LEFT_CLICK, diguyCharacter::CALLBACK_ID_UI_RIGHT_CLICK,
  diguyCharacter::CALLBACK_ID_UI_DOUBLE_CLICK, diguyCharacter::CALLBACK_ID_UI_MIDDLE_CLICK, diguyCharacter::CALLBACK_ID_UI_SCROLL_UP, diguyCharacter::CALLBACK_ID_UI_SCROLL_DOWN,
  diguyCharacter::CALLBACK_ID_AGENT_NEW_BEHAVIOR, diguyCharacter::CALLBACK_ID_AGENT_NEW_PATH_SHAPE, diguyCharacter::CALLBACK_ID_AGENT_NEW_FOCUS_CHARACTER, diguyCharacter::CALLBACK_ID_AGENT_ATTACK_OUT_OF_TARGETS,
  diguyCharacter::CALLBACK_ID_AGENT_ATTACK_NO_VISIBLE_TARGETS, diguyCharacter::CALLBACK_ID_AGENT_PURSUE_TARGET_REACHED, diguyCharacter::CALLBACK_ID_AGENT_PURSUE_TARGET_LOST, diguyCharacter::CALLBACK_ID_AGENT_MINGLE_TARGET_REACHED,
  diguyCharacter::CALLBACK_ID_AGENT_MINGLE_TARGET_LOST, diguyCharacter::CALLBACK_ID_AGENT_WANDER_TARGET_REACHED, diguyCharacter::CALLBACK_ID_AGENT_WANDER_TARGET_LOST, diguyCharacter::CALLBACK_ID_AGENT_FLEE_AREA_LEFT,
  diguyCharacter::CALLBACK_ID_AGENT_FLEE_AREA_ENTERED, diguyCharacter::CALLBACK_ID_AGENT_TRAVEL_WAYPOINT_REACHED, diguyCharacter::CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED, diguyCharacter::CALLBACK_ID_AGENT_TRAVEL_BACKWARD_DEST_REACHED,
  diguyCharacter::CALLBACK_ID_AGENT_TRAVEL_NEAR_FORWARD_DEST, diguyCharacter::CALLBACK_ID_AGENT_CROWD_MEMBER_KILLED, diguyCharacter::CALLBACK_ID_AGENT_CROWD_MEMBER_IMPACT, diguyCharacter::CALLBACK_ID_AGENT_NEARBY_SCENE_OBJECT_IMPACT,
  diguyCharacter::CALLBACK_ID_AGENT_NEARBY_WEAPON_FIRED, diguyCharacter::CALLBACK_ID_AGENT_VEHICLE_COLLISION, diguyCharacter::CALLBACK_ID_AGENT_VEHICLE_NEAR_COLLISION, diguyCharacter::CALLBACK_ID_AGENT_PATH_PLAN_COMPLETED,
  diguyCharacter::CALLBACK_ID_AGENT_MIND_CURRENT_STATE_CHANGED, diguyCharacter::CALLBACK_ID_AGENT_NON_ZERO_REPULSION, diguyCharacter::CALLBACK_ID_AGENT_ZERO_REPULSION
}
 This is an enumeration of the different callbacks that can be registered with add_callback() and add_callback_script(). More...
 

Callback Functions

enum  { diguyCharacterGesture::CALLBACK_ID_CREATE = 1, diguyCharacterGesture::CALLBACK_ID_DESTROY, diguyCharacterGesture::CALLBACK_ID_ATTAINED_DESIRED_ACTION }
 This is an enumeration of the different callbacks that can be registered with add_callback() and add_callback_script(). More...
 
int diguyCharacterGesture::add_callback (int callback_id, diguyCharacterGestureCallback *callback, void *callback_params=0, void *callback_user_data=0)
 This function adds a user callback. More...
 
int diguyCharacterGesture::remove_callback (int callback_id, diguyCharacterGestureCallback *callback)
 This function removes a user callback. More...
 
int diguyCharacterGesture::remove_callback_with_user_data (int callback_id, void *callback_user_data)
 This function removes a user callback. More...
 
int diguyCharacterGesture::add_callback_script (int callback_id, const char *callback_script, const char *callback_script_type=NULL)
 This function adds a user callback script. More...
 
int diguyCharacterGesture::remove_callback_script (int callback_id, const char *callback_script, const char *callback_script_type=NULL)
 This function removes a user callback script previously added with add_callback_script(). More...
 

Detailed Description

The portion of the API focused on adding entities to your world.

Enumeration Type Documentation

anonymous enum

This is an enumeration of the different callbacks that can be registered with add_callback() and add_callback_script().

Callbacks return a value of type diguyCallbackReturn, which will be DIGUY_CALLBACK_STOP or DIGUY_CALLBACK_CONTINUE. If the callback returns DIGUY_CALLBACK_STOP, in some cases the default handler of the function will not be called; the callback is asserting that it has done everything necessary for the function call. If the callback returns DIGUY_CALLBACK_CONTINUE, the default handler for the function will be called after the callback.

Usable From:

  • C++
  • Script

Callback Enums:

CALLBACK_ID_CREATE

 This callback will be called when a new character is created,
 *after* the character is fully initialized.

 Note that this callback can only be added by calling
 diguyScenario::add_default_character_callback(); adding it with
 diguyCharacter::add_callback() will have no effect, as by that
 time the character has already been created.

CALLBACK_ID_DESTROY

 This callback will be called when a character is
 destroyed.

CALLBACK_ID_PRE_CREATE

 Like CALLBACK_ID_CREATE, this callback will be called when a
 new character is created; however, it is called ** <b>efore* the </b>
 character is fully initialized.

NOTE: Care must be taken when using this callback! As mentioned above, the character is not fully initialized, meaning that most member functions of the diguyCharacter object should not be called. Those member functions that are safe to call will be mentioned in the documentation for the function; e.g., set_graphics_api_node_ptr().

Note that this callback can only be added by calling diguyScenario::add_default_character_callback(); adding it with diguyCharacter::add_callback() will have no effect, as by that time the character has already been created.

CALLBACK_ID_CURRENT_APPEARANCE_CHANGED

 This callback will be called when a character's current
 appearance is changed.

CALLBACK_ID_CURRENT_HEAD_APPEARANCE_CHANGED

 This callback will be called when a character's current head
 appearance is changed.

CALLBACK_ID_PRE_UPDATE

 This callback will be called before the character is updated as
 a result of the diguyScenario::update() function.

CALLBACK_ID_POST_UPDATE

 This callback will be called after the character is updated as a
 result of the diguyScenario::update() function.

CALLBACK_ID_DONE_SPEAKING

 This callback will be called when the character has finished
 speaking the contents of a speak() function call.

CALLBACK_ID_GAZE_STATUS

 This callback will be called after the character's gaze has
 experienced a status change.

CALLBACK_ID_LPOINT_STATUS

 This callback will be called after the character's lpoint (left
 arm pointing) has experienced a status change.

CALLBACK_ID_SHOW

 This callback will be called when the character is being shown
 for any reason.

CALLBACK_ID_HIDE

 This callback will be called when the character is being hidden
 for any reason.

CALLBACK_ID_PRE_DIE

 This callback will be called when the character has been told to
 die, before a die action has been selected and initiated.

 If the returned diguyCallbackReturn value is
 DIGUY_CALLBACK_STOP, the character will not die.

CALLBACK_ID_POST_DIE

 This callback will be called when the character has been told to
 die, after a die action has been selected and initiated.

CALLBACK_ID_PRE_FIRE_WEAPON

 This callback will be called when the character has been told to
 fire its weapon, before a final decision has been made to fire.

 If the returned diguyCallbackReturn value is
 DIGUY_CALLBACK_STOP, the character will not fire.

CALLBACK_ID_IMPACT

 This callback will be called when the character has been hit.
 diguyCharacter::get_last_impact_record() contains a pointer to
 the impact information. If a character has this callback the
 standard behavior (killing the character) is skipped and the
 system assumes the end user has handled the impact.

 Similar behavior results if
 diguyCrowd::CALLBACK_ID_CROWD_MEMBER_IMPACT is registered.

CALLBACK_ID_POST_FIRE_WEAPON

 This callback will be called when the character has been told to
 fire its weapon, after a final decision has been made to fire.

CALLBACK_ID_CURRENT_ACTION_CHANGED

 This callback will be called whenever the character's current
 action changes, typically after a call to set_desired_action()
 or force_action().

CALLBACK_ID_DESIRED_ACTION_CHANGED

 This callback will be called whenever the character's desired
 action changes, typically after a call to set_desired_action().

CALLBACK_ID_DESIRED_ACTION_REACHED

 This callback will be called when the character reaches its
 desired action as set by a call to set_desired_action().

CALLBACK_ID_MANUALLY_INVOKED

 This callback id will be supplied to event handlers invoked by a
 call to manually_invoke_event_handler().

CALLBACK_ID_USER_SELECTED

 This callback will be called when the character is selected in DI-Guy Scenario.

CALLBACK_ID_USER_UNSELECTED

 This callback will be called on a currently selected character when a different
 character is selected in DI-Guy Scenario.

CALLBACK_ID_IGUY_INTERACT

 This callback will be called when the character has been clicked
 on while DI-Guy Scenario is in I-Guy Input Mode.  Note that this
 is called on the character clicked, not the I-Guy character.

CALLBACK_ID_IGUY_INTERACT_WITH_SUBJECT

 This callback will be called when the character, as the I-Guy
 character, has clicked another character in I-Guy Input Mode.
 Note that this is called for the I-Guy character, not the
 clicked character.

CALLBACK_ID_GUIDE_POSITION_ACQUIRED

 This callback will be called when the character has reached its
 desired position as set by set_desired_position(). The
 diguyCharacterGuide is responsible for moving the character towards
 this position.

CALLBACK_ID_GUIDE_POSITION_UNACQUIRED

 This callback will be called if the character moves too far away
 from its desired position after it has been previously reached.

CALLBACK_ID_GUIDE_ORIENTATION_ACQUIRED

 This callback will be called when the character has reached its
 desired orientation as set by set_desired_orientation(). The
 diguyCharacterGuide is responsible for moving the character towards
 this orientation.

CALLBACK_ID_GUIDE_ORIENTATION_UNACQUIRED

 This callback will be called if the character turns too far away
 from its desired orientation after it has been previously
 reached.

CALLBACK_ID_GUIDE_ALTITUDE_ACQUIRED

 This callback will be called when the character has reached its
 desired altitude as set by set_desired_orientation() or other functions.
 The callback is most meaningful for vehicles that need to achieve
 some sort "cruising altitude" while moving to a destination.

CALLBACK_ID_GUIDE_ALTITUDE_UNACQUIRED

 This callback will be called if the character turns too far away
 from its desired orientation after it has been previously
 reached.

CALLBACK_ID_GUIDE_TARGET_LOST

 This callback will be called when the character guide has determined
 that the character can't reach its desired position/orientation. An
 example would be a missile that has flown past its target

CALLBACK_ID_CURRENT_TOUT_REACHED

 This callback will be called when scenario time reaches this
 character's tout time as set by set_current_tout().

CALLBACK_ID_POST_CREATE_GEOMETRY

 This callback will be called just after the character's geometry
 has been created.

CALLBACK_ID_PRE_DESTROY_GEOMETRY

 This callback will be called just before the character's
 geometry is broken down and destroyed.

CALLBACK_ID_END_OF_PATH_REACHED

 This callback will be called when a character reaches the end of
 their current path. Note the path must finish, forcing to other
 paths will not trigger this callback.

DI-Guy Scenario UI Callback enums:

CALLBACK_ID_UI_PRE_TRANSLATION

 This callback will be called when the user interface starts
 moving a character.

CALLBACK_ID_UI_POST_TRANSLATION

 This callback will be called when the user interface finishes
 moving a character.

CALLBACK_ID_UI_MOUSE_DOWN

 This callback will be called when the user interface gets a
 mouse click in the DIGUY_SCENARIO_INPUT_MODE_POINT_SELECT input
 mode.

CALLBACK_ID_UI_MOUSE_UP

 This callback will be called when the user interface gets a
 mouse release in the DIGUY_SCENARIO_INPUT_MODE_POINT_SELECT
 input mode.

DI-Guy AI Agent Callback enums:

CALLBACK_ID_AGENT_NEW_BEHAVIOR

 This callback will be called when an agent changes its current
 behavior.

CALLBACK_ID_AGENT_NEW_FOCUS_CHARACTER

 This callback will be called when an agent changes its current
 focus character; this happens most frequently when it is focused
 on a group.

CALLBACK_ID_AGENT_ATTACK_OUT_OF_TARGETS

 This callback will be called when an agent in attack behavior
 evaluates the group it's focused on and cannot find an
 appropriate target.  This can happen if all group members are
 dead.

CALLBACK_ID_AGENT_ATTACK_NO_VISIBLE_TARGETS

 This callback will be called when an agent in attack behavior
 can't see any potential members of the group it's focused on.

CALLBACK_ID_AGENT_PURSUE_TARGET_REACHED

 This callback will be called when an agent in pursue behavior
 has come within the pursuit distance of its pursuit target.

CALLBACK_ID_AGENT_PURSUE_TARGET_LOST

 This callback will be called when an agent in pursue behavior
 is no longer within the pursuit distance of its pursuit target.

CALLBACK_ID_AGENT_MINGLE_TARGET_REACHED

 This callback will be called when an agent in mingle behavior
 has reached its mingle target.

CALLBACK_ID_AGENT_MINGLE_TARGET_LOST

 This callback will be called when an agent in mingle behavior
 is no longer is range of its mingle target.

CALLBACK_ID_AGENT_WANDER_TARGET_REACHED

 This callback will be called when an agent in wander behavior
 has reached its wander target.

CALLBACK_ID_AGENT_WANDER_TARGET_LOST

 This callback will be called when an agent in wander behavior
 is no longer is range of its wander target.

CALLBACK_ID_AGENT_FLEE_AREA_LEFT

 This callback will be called when an agent in flee behavior has
 successfully moved out range of all fled characters or
 locations.  This will only be called when the agent is
 transitioning from inside the flee area to outside of it.

CALLBACK_ID_AGENT_FLEE_AREA_ENTERED

 This callback will be called when an agent in flee behavior has
 moved inside of the range of any fled characters or locations.
 This will only be called when the agent is transitioning from
 outside the flee area to inside of it.

CALLBACK_ID_AGENT_TRAVEL_WAYPOINT_REACHED

 This callback will be called when an agent in travel behavior
 has reached in intermediate waypoint and is about to move
 on to the next.

CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED

 This callback will be called when an agent in travel behavior
 has reached the end of its travel path when moving forward
 along the path.

CALLBACK_ID_AGENT_TRAVEL_BACKWARD_DEST_REACHED

 This callback will be called when an agent in travel behavior
 has reached the beginning of its travel path when moving
 backward along the path.

CALLBACK_ID_AGENT_TRAVEL_NEAR_FORWARD_DEST

 This callback will be called when an agent gets within a specified
 distance of the end of the travel path

CALLBACK_ID_AGENT_CROWD_MEMBER_KILLED

 This callback will be called when fellow member of the crowd is
 killed.

- This is the character version of
    diguyCrowd::CALLBACK_ID_CROWD_MEMBER_KILLED
- The crowd's callback character is the crowd member that was
    killed.
- The crowd's callback impact contains the impact information.

CALLBACK_ID_AGENT_CROWD_MEMBER_IMPACT

 This callback will be called when a fellow member of the crowd
 is hit by a detonation.  This callback does not replace
 diguyCharacter::CALLBACK_ID_IMPACT, which still needs to be
 handled to implement damage models.

- The crowd's callback character is the crowd member that was
    hit.
- The crowd's callback impact contains the impact information.

CALLBACK_ID_AGENT_NEARBY_SCENE_OBJECT_IMPACT

 This callback will be called when a detonation occurs within the
 awareness radius (as set by set_awareness_radius()) of the
 crowd's current bounds.

- This is the character version of
    diguyCrowd::CALLBACK_ID_NEARBY_SCENE_OBJECT_IMPACT
- The crowd's callback character is the character that caused
    the detonation.
- The crowd's callback impact contains the impact information.

CALLBACK_ID_AGENT_NEARBY_WEAPON_FIRED

 This callback will be called when a weapon is fired within the
 awareness radius (as set by set_awareness_radius()) of the
 crowd's current bounds.

- The crowd's callback character is the character that fired the
    weapon.

CALLBACK_ID_AGENT_VEHICLE_COLLISION

 This callback will be called on a vehicle agent when it hits a
 member of a companion crowd.

CALLBACK_ID_AGENT_VEHICLE_NEAR_COLLISION

 This callback will be called on a vehicle agent when it
 approaches another vehicle.

CALLBACK_ID_AGENT_NON_ZERO_REPULSION

 This callback will be called when an agent character's repulsion
 forces become non-zero.

CALLBACK_ID_AGENT_ZERO_REPULSION

 This callback will be called when an agent character's repulsion
 forces become zero.

CALLBACK_ID_AGENT_PATH_PLAN_COMPLETED

 This callback will be called when a character who's requested a
 path plan via the background path planner
 (agent_move_to_point_bg) gets a path result. Call
 diguyCharacter::get_path_planning_result() to get the status of
 the result.

CALLBACK_ID_AGENT_MIND_CURRENT_STATE_CHANGED

 This callback will be called when the current state the agent's
 mind, if it has one, has changed.  Call
 diguyCharacter::get_mind_current_state_name() to get the new
 state name.
Enumerator
CALLBACK_ID_CREATE 
CALLBACK_ID_DESTROY 
CALLBACK_ID_PRE_CREATE 
CALLBACK_ID_CURRENT_APPEARANCE_CHANGED 
CALLBACK_ID_CURRENT_HEAD_APPEARANCE_CHANGED 
CALLBACK_ID_CURRENT_HAND_ITEM_APPEARANCE_CHANGED 
CALLBACK_ID_SHAPE_VISIBILITY_CHANGED 
CALLBACK_ID_PRE_UPDATE 
CALLBACK_ID_POST_UPDATE 
CALLBACK_ID_DONE_SPEAKING 
CALLBACK_ID_GAZE_STATUS 
CALLBACK_ID_LPOINT_STATUS 
CALLBACK_ID_SHOW 
CALLBACK_ID_HIDE 
CALLBACK_ID_PRE_DIE 
CALLBACK_ID_POST_DIE 
CALLBACK_ID_PRE_FIRE_WEAPON 
CALLBACK_ID_POST_FIRE_WEAPON 
CALLBACK_ID_IMPACT 
CALLBACK_ID_FIRE_WEAPON_SUCCESS 
CALLBACK_ID_CURRENT_ACTION_CHANGED 
CALLBACK_ID_DESIRED_ACTION_CHANGED 
CALLBACK_ID_DESIRED_ACTION_REACHED 
CALLBACK_ID_MANUALLY_INVOKED 
CALLBACK_ID_USER_SELECTED 
CALLBACK_ID_USER_UNSELECTED 
CALLBACK_ID_IGUY_INTERACT 
CALLBACK_ID_IGUY_INTERACT_WITH_SUBJECT 
CALLBACK_ID_GUIDE_POSITION_ACQUIRED 
CALLBACK_ID_GUIDE_POSITION_UNACQUIRED 
CALLBACK_ID_GUIDE_ORIENTATION_ACQUIRED 
CALLBACK_ID_GUIDE_ORIENTATION_UNACQUIRED 
CALLBACK_ID_GUIDE_ALTITUDE_ACQUIRED 
CALLBACK_ID_GUIDE_ALTITUDE_UNACQUIRED 
CALLBACK_ID_GUIDE_TARGET_LOST 
CALLBACK_ID_CURRENT_TOUT_REACHED 
CALLBACK_ID_POST_CREATE_GEOMETRY 
CALLBACK_ID_PRE_DESTROY_GEOMETRY 
CALLBACK_ID_END_OF_PATH_REACHED 
CALLBACK_ID_CHARACTER_CLICKED 
CALLBACK_ID_UI_PRE_TRANSLATION 
CALLBACK_ID_UI_POST_TRANSLATION 
CALLBACK_ID_UI_MOUSE_DOWN 
CALLBACK_ID_UI_MOUSE_UP 
CALLBACK_ID_UI_RIGHT_MOUSE_DOWN 
CALLBACK_ID_UI_RIGHT_MOUSE_UP 
CALLBACK_ID_UI_LEFT_CLICK 
CALLBACK_ID_UI_RIGHT_CLICK 
CALLBACK_ID_UI_DOUBLE_CLICK 
CALLBACK_ID_UI_MIDDLE_CLICK 
CALLBACK_ID_UI_SCROLL_UP 
CALLBACK_ID_UI_SCROLL_DOWN 
CALLBACK_ID_AGENT_NEW_BEHAVIOR 
CALLBACK_ID_AGENT_NEW_PATH_SHAPE 
CALLBACK_ID_AGENT_NEW_FOCUS_CHARACTER 
CALLBACK_ID_AGENT_ATTACK_OUT_OF_TARGETS 
CALLBACK_ID_AGENT_ATTACK_NO_VISIBLE_TARGETS 
CALLBACK_ID_AGENT_PURSUE_TARGET_REACHED 
CALLBACK_ID_AGENT_PURSUE_TARGET_LOST 
CALLBACK_ID_AGENT_MINGLE_TARGET_REACHED 
CALLBACK_ID_AGENT_MINGLE_TARGET_LOST 
CALLBACK_ID_AGENT_WANDER_TARGET_REACHED 
CALLBACK_ID_AGENT_WANDER_TARGET_LOST 
CALLBACK_ID_AGENT_FLEE_AREA_LEFT 
CALLBACK_ID_AGENT_FLEE_AREA_ENTERED 
CALLBACK_ID_AGENT_TRAVEL_WAYPOINT_REACHED 
CALLBACK_ID_AGENT_TRAVEL_FORWARD_DEST_REACHED 
CALLBACK_ID_AGENT_TRAVEL_BACKWARD_DEST_REACHED 
CALLBACK_ID_AGENT_TRAVEL_NEAR_FORWARD_DEST 
CALLBACK_ID_AGENT_CROWD_MEMBER_KILLED 
CALLBACK_ID_AGENT_CROWD_MEMBER_IMPACT 
CALLBACK_ID_AGENT_NEARBY_SCENE_OBJECT_IMPACT 
CALLBACK_ID_AGENT_NEARBY_WEAPON_FIRED 
CALLBACK_ID_AGENT_VEHICLE_COLLISION 
CALLBACK_ID_AGENT_VEHICLE_NEAR_COLLISION 
CALLBACK_ID_AGENT_PATH_PLAN_COMPLETED 
CALLBACK_ID_AGENT_MIND_CURRENT_STATE_CHANGED 
CALLBACK_ID_AGENT_NON_ZERO_REPULSION 
CALLBACK_ID_AGENT_ZERO_REPULSION 
anonymous enum

This is an enumeration of the different callbacks that can be registered with add_callback() and add_callback_script().

Usable From:

  • C++
  • Script
Enumerator
CALLBACK_ID_CREATE 
CALLBACK_ID_DESTROY 
CALLBACK_ID_ATTAINED_DESIRED_ACTION 

Function Documentation

int diguyCharacterGesture::add_callback ( int  callback_id,
diguyCharacterGestureCallback callback,
void *  callback_params = 0,
void *  callback_user_data = 0 
)

This function adds a user callback.

Parameters
callbackpointer to function with prototype diguyCharacterGestureCallback (typedefed above)
callback_idinteger id of when this callback is to be called
callback_paramsnot currently used; pass NULL
callback_user_datapointer for user's own use; DI-Guy will do nothing to the contents of this pointer beyond passing it back when the callback is invoked

callback_id should be one of the following values:

CALLBACK_ID_CREATE

 This callback will be called when a new gesture is created.

CALLBACK_ID_DESTROY

 This callback will be called when the gesture is destroyed.

CALLBACK_ID_ATTAINED_DESIRED_ACTION

 This callback will be called when a table gesture has reached
 its desired action as set by set_table_action_desired().

Callback Return Values:

Callbacks return a value of type diguyCallbackReturn, which will be DIGUY_CALLBACK_STOP or DIGUY_CALLBACK_CONTINUE. If the callback returns DIGUY_CALLBACK_STOP, the default handler of the function will not be called; the callback is asserting that it has done everything necessary for the function call. If the callback returns DIGUY_CALLBACK_CONTINUE, the default handler for the function will be called after the callback.

Returns:

0 on success, -1 on failure

Callable From:

  • C++
int diguyCharacterGesture::remove_callback ( int  callback_id,
diguyCharacterGestureCallback callback 
)

This function removes a user callback.

All callbacks matching the specified callback_id and callback function will be removed.

Parameters
callback_idinteger id of when this callback is to be called
callbackpointer to function with prototype diguyCharacterGestureCallback (typedefed above)

Returns:

0 on success, -1 on failure

Callable From:

  • C++
int diguyCharacterGesture::remove_callback_with_user_data ( int  callback_id,
void *  callback_user_data 
)

This function removes a user callback.

All callbacks matching the specified callback_id and callback_user_data pointer will be removed.

Parameters
callback_idinteger id of when this callback is to be called
callback_user_datapointer for user's own use

Returns:

0 on success, -1 on failure

Callable From:

  • C++
int diguyCharacterGesture::add_callback_script ( int  callback_id,
const char *  callback_script,
const char *  callback_script_type = NULL 
)

This function adds a user callback script.

Callback scripts can be removed with remove_callback_script().

See diguyCharacter::add_callback_script() for an example of use.

Parameters
callback_idinteger id of the callback
callback_scriptscript text of callback to be added
callback_script_typethe type of script contained in callback_script

If NULL is passed for callback_script_type, a default script type will be derived based on the default script interpreter of the scenario.

lua specific:

When the script is called, the object for which it is being called will be in the $callback_object scalar.

To pass NULL when calling from a lua script, use nil.

Returns:

0 on success, -1 on failure

int diguyCharacterGesture::remove_callback_script ( int  callback_id,
const char *  callback_script,
const char *  callback_script_type = NULL 
)

This function removes a user callback script previously added with add_callback_script().

See diguyCharacter::remove_callback_script() for an example of use.

Parameters
callback_idinteger id of the callback
callback_scriptscript text of callback previously added
callback_script_typethe type of script contained in callback_script

If NULL is passed for callback_script, all callback scripts whose ids match callback_id and whose types match callback_script_type will be removed.

If NULL is passed for callback_script_type, a default script type will be derived based on the default script interpreter of the scenario.

lua specific:

To pass NULL when calling from a lua script, use nil.

Returns:

0 on success, -1 on failure