VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Add Script Variable

Table of Contents

The Add Script Variable example demonstrates the following:

The Add Script Variable example shows how to add a new scripted task or set variable to the script system, in this case an integer list of values. It will show to add the gui componenet as well as the component to transfer the data to/from reader/writer variables (which the foundation of getting this information into lua scripts).
To use this example you can either load the add script variable toolkit developer example. This example has an entity with a plan that contains a task that uses the new variable in that task, or, you can create a new scenario with a scenario script that adds the Integer List variable to a scripted task.

Usage

Since this example is loaded as a plugin, it will need to be enabled in the Launcher. In the Launcher, click the Plug-ins button to bring up the Plug-ins Selection dialog. Enable the plugin. Then launch VR-Forces.

To view the new behavior:

  1. Create a new Scenario
  2. Create a new scripted task. Scripted tasks are accessed from the Simulation menu item.
  3. Add a new variable for the Integer List scripted variable type
  4. Edit the lua script.
  5. In the init method add lua code to loop over the table entries for the new integer list variable and printWarn each entry.
  6. Create a new entity and show the object console for that entity.
  7. Task the entity to perform the new scripted task.
  8. The entity information window and the back-end console window should display the integer values

Classes

DtScriptedTaskRwIntegerListVariableConverterThe variable converter that converts to/from scripted task variable.
DtIntegerrListEntryWidgetThe variable converter that converts to/from scripted task variable.

Plugin Entry Points


Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)