![]() |
VR-Forces Developer's Guide
|
The Add Task Interaction example demonstrates how to add support for a new interaction to task a VR-Forces entity.
For example, the NETN FOM has a module called the ETR (Entity Tasking and Reports) module which includes many interactions designed to send tasks or set requests to entities. VR-Forces supports a limited subset of these tasks, but it does not have full support. Additionally, users with other FOMs, or even custom DIS interactions, that offer similar capabilities may want to expand the ability of VR-Forces to process these messages. This example shows how to convert such an interaction into a VR-Forces task or set request message.
This example registers a new conversion function with the DtVrlinkCommandInteractionTranslator. This class is responsible for translating incoming interactions into VRF tasks and set requests. If the Translator has a conversion function that matches an received interaction, it will call the conversion function to perform translation. The conversion function must then output a list containing one or more DtEvent instance. Most commonly these are a single DtTaskEvent and/or one or more DtSetEvent.
This particular example adds some support for the NETN ETR FireAtEntityWM interaction. This interaction represents a task for one entity to fire at another using a specified weapon, munition, quantity of rounds, and rate of fire. This example does not support all parameters, but it uses the specified munition type to select an appropriate weapon which will be fired the specified number of times. The rate of fire and weapon type are ignored.
This plugin only enables the VR-Forces sim engine to process the FireAtEntityWM interaction. To see this behavior, you will also need a remote application to send this interaction. The remoteControl example has an additional command that will send this interaction. This remoteControl example command will only have an effect when the sim is loaded with the addTaskInteraction plugin.
In the Launcher:
To view the new behavior: