VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Add Task (addTaskGui)

Table of Contents

The Add Task adds a new task command which will instruct an entity to retreat under certain circumstances

The Add Task example demonstrates the following:

The sim engine part of the Add Task example adds a new task and controller which will receive and implement the new DtRetreatTask.

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

Using Scripted Set

This example also shows how to use this GUI as a scripted gui. Load the add task scenario from the developer toolkit scenarios to see an example of defining and using the retreat task via a scripted dialog and lus script.

How to Run the Example

This example demonstrates how to add a new kind of task (retreat).

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. Load the scenario userData\scenarios\Sample\developer_toolkit_examples\addTask\addTask.scnx. The scenario references the custom SMS data\simulationModelSets\developer_toolkit_examples\addTask.sms.
  3. Play the scenario.
  4. Entities tasked to "retreat immediately" will move at full speed in the opposite direction from enemy entities.
  5. Entities tasked to "hold ground" will stay still until they determine themselves to be "under fire," at which point they will retreat at full speed in the opposite direction from enemy entities.

Classes

DtTaskRetreatActionmenu item that is registered with the task menu from the plugin code.
DtTaskRetreatDialogThe widget that is used to select the retreat mechanism.
DtRetreatTaskThe subclass of DtSimTask that is used to communicate the new task request.

Plugin Entry Points

/******************************************************************************
** Copyright (c) 2016 MAK Technologies, Inc.
** All rights reserved.
******************************************************************************/
#include <vrvCore/DtDe.h>
using namespace makVrf;
void DtTaskMenuConfigurationLoaded(makVrv::DtDe* de)
{
//Inserts the DtTaskRetreatAction object name as the menu item into a specific point of the Set Menu with the masterModeMenuConfiguration
//The set entry is placed after the menu entry corresponding to the "DtVrfSetResponsibilityAction" object
DtVrfScenarioManager::instance(*de).initialTaskMenuConfiguration().addMenuItemAfter("DtTaskRetreatAction", "DtVrfTaskRotaryWingLandAction");
}
{
DtTaskMenu& taskMenu = DtTaskMenu::instance(*de);
//[register menu item with tasl menu]
//Registers the DtTaskRetreatAction object with the DtTaskMenu assembler
//[register menu item with task menu assembler]
//Register callback to be notified when initial task menu configuration has changed. This will always allow the plugin
//to correctly add in the new task command
(boost::bind(&DtTaskMenuConfigurationLoaded, de));
return true;
}
{
info.pluginName = "Add Task Gui";
info.pluginVersion = "1.00";
info.pluginDescription = "Front-end plugin addition to add new Retreat Task command";
info.pluginCreator = "MAK Technologies";
info.pluginCreatorEmail = "sales@mak.com";
info.pluginContactWebPage = "www.mak.com";
info.pluginContactMailingAddress = "68 Moulton Street - Cambridge, MA 02138";
info.pluginContactPhone = "(617) 876 8085";
}

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)