VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Decide to Give Up (decideToGiveUpTask)

Table of Contents

The Decide to Give Up example demonstrates the following:

Subclassing a Controller Component

The Decide to Give Up example installs a new version of the DtGroundMoveToControllerComponent to give up the task after a certain amount of sim time. This example can be used as a starting point for other type of reasons to give up on a task.

Since this example is loaded as a plugin, it can be used in conjunction with the released VR-Forces application

How to Run the Example

This example demonstrates how to add 'decide to give' up logic to an existing behavior.

Usage

In the Launcher, click the Plug-ins button to bring up the Plug-ins Selection dialog. Enable the plugin.

To view the new behavior:

  1. Start VR-Forces GUI and SIM.
  2. Create a new scenario (use any terrain database) - e.g. EntityLevel SMS on Ground_DB II terrain.
  3. Create a M1A2 entity.
  4. Create a waypoint, some distance away from the entity (at least 50 meters away).
  5. Give the entity a move-to <waypoint> task.
  6. Right-click > Information... on entity to open its information window.
  7. Set the Object Console Notify Level to Info.
  8. Click on play button.
  9. Observe the output in the entity's Object Console window. After 10 seconds of simulation time, the enitty will stop moving and there will be messages printed to the entity Information dialog and the SIM console indicating that the entity has 'given up on the task'.

Classes

DerivedMoveToControllerThis subclass of DtGroundMoveToControllerComponent gives up on the movement task after a certain amount of simulation time.

Plugin Entry Points

/*******************************************************************************
** Copyright (c) 2003 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
/*******************************************************************************
** $RCSfile: plugin.cxx,v $ $Revision: 1.3 $ $State: Exp $
*******************************************************************************/
#include "vrfcgf/cgf.h"
extern "C" {
{
info.pluginName = "decideToGiveUpTask";
info.pluginVersion = "1.00";
info.pluginCreator = "MAK Technologies";
info.pluginCreatorEmail = "sales@mak.com";
info.pluginContactWebPage = "www.mak.com";
info.pluginContactMailingAddress = "10 Fawcett Street, Suite 204, Cambridge, MA 02138 USA";
info.pluginContactPhone = "(617) 876 8085";
}
DT_VRF_DLL_PLUGIN bool DtInitializeVrfPlugin(DtCgf* cgf)
{
return true;
}
}

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)