GIFT VBS Plugin 2023-1¶
Overview¶
The GIFT VBS Plugin allows GIFT to communicate and interact with VBS.
Installation¶
Run the GIFT installer and follow the VBS Training Application configuration instructions. For more detailed instructions, follow the instructions in the GIFT Installation procedures.
Configuration¶
The GIFT plugin can be configured once it is installed using the file ‘giftvbsplugin.properties’ in the ‘plugins/gift/config’ folder of the VBS install directory.
Properties¶
PortNumber- This sets the port number for the plugin to use to communicate with the GIFT Gateway module. If you change this property verify that it matches the Gateway module’s port number for its interop connection to the GIFT VBS Plugin. Consult the “Gateway Module Interop Connection Settings” section in the Configuration Settings document for more details on configuring VBS with GIFT.
- Value Type: Integer
- Default: 27015
- Example:
PortNumber=27015
Note: see https://gifttutoring.org/projects/gift/wiki/Configuration_Settings_2023-1#External-applications for more information on VBS and GIFT network ports.
LogLevel- Sets the level of logging messages wrote to the file, similar to Log4j log levels; greater log level logs all the lesser log level messages as well i.e. INFO level logging will log all INFO messages and ERROR message
- Possible Values: OFF, ERROR, INFO, DEBUG, ALL
- Default: ALL
- Example:
LogLevel=DEBUG
Logging¶
Logs for the plugin can be found in the ‘plugins/gift/logs’ directory of the VBS install directory.
Building¶
The C++ project used to build the VBS Plugin can be found at "ThirdParty\Applications\VBS Plugin" within the GIFT repo.
The following instructions assume that the project is being built using Visual Studio Community 2017, since that was the last version of Visual Studio that the project was built with. It is possible that the project could be built using newer versions of Visual Studio, but it may require upgrades and changes that are not mentioned in the below instructions.
If you have a newer version of Visual Studio installed, you can also use the Visual Studio installer to install Visual Studio Community 2017 alongside your existing version. Since the VBS plugin was originally developed in 2011, it uses some older libraries that may not be installed by default depending on your versions of Visual Studio and Windows, which may cause build errors when you import the VBS plugin solution. To address this, you may need to adjust your installation settings in order to include some optional Windows C++ SDKs. This can also be done using the Visual Studio installer, as shown in the example below using Visual Studio 2017.
Importing the Visual Studio Solution¶
1. Click File > Open > Project/Solution...
2. Select "ThirdParty\Applications\VBS Plugin\VBSPlugin.sln" from your checkout of the GIFT repo using the file window that is opened.
3. Click on VBSPlugin.cpp in the Solution Explorer to open it and confirm the solution was imported successfully
Building the Solution¶
The VBSPlugin solution can be built for either 32-bit or 64-bit systems, which will update either GIFTVBSPlugin.dll or GIFTVBSPlugin64.dll respectively.
Build GIFTVBSPlugin.dll for 32-bit Systems¶
1. Click Build > Configuration Manager.
2. In the configuration manager, set "Active solution platform:" to x86
3. Close the configuration manager,
4. Click Build > Rebuild Solution. The "Output" panel should display a "Rebuild All: 1 succeeded" message if the build completed successfully
Build GIFTVBSPlugin64.dll for 64-bit Systems¶
1. Click Build > Configuration Manager.
2. In the configuration manager, set "Active solution platform:" to x64
3. Close the configuration manager,
4. Click Build > Rebuild Solution. The "Output" panel should display a "Rebuild All: 1 succeeded" message if the build completed successfully
Scripting¶
The GIFT VBS Plugin allows GIFT to apply VBS script commands according to the VBS syntax defined at https://sqf.bisimulations.com/display/SQF/VBS+Scripting+Reference.
The Real time assessment (DKF) authoring tool found in the GIFT course creator allows authors to create strategies to apply during a VBS scenario. These strategies can be teleport, create actors, highlight object, change time of day just to name a few. One of the authored strategy types for VBS is custom script. This allows authors to provide their own VBS script commands that GIFT will simply send to the GIFT VBS plugin to apply to the game engine while running a VBS scenario. The value provided to GIFT should be tested in VBS for validation before running it in a GIFT course / real time assessment.
Example custom script - causes a weapon malfunction in VBS:
AR disableWeaponControl [[],false,false,true,true]