VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
VR-Forces 5.1 API Migration Guide

Table of Contents

Weapon System Changes

The way weapon systems interact with each other and how they are tasked has changed in VRF 5.1. In VRF 5.1, all weapon systems are directly taskable with their own custom tasks, and there is no longer a central "Target Selection Controller" that controls weapons. The following controllers and related classes have been removed:

Weapon Info

There is a new unidirectional communication mechanism called "WeaponInfo" that exists for looking up information about mounted weapons on an entity. This is part of the internal state of the entity and is available only to other components on the same entity. This is accessed through DtVrfObjectStateRepository::weaponInfoList(). Weapon information on this list is accessed using the DtWeaponInfoInterface class. There is also a Lua equivalent for this information.

The "weapon interface" system for interacting with a mounted weapon is no longer used, although the DtBaseWeaponComponentInterface class and subclasses still exist for use as a PSR by the weapon system itself.

DtSimComponent Tick Period API Changes

The management of tick times for the DtSimComponent has changed. This API is mainly used for internal VR-Forces logic, so it is unlikely that custom plugins use this API, but may access in some cases. The following functions and members have been removed from DtSimComponent:

They have been replaced by the DtTimedTickLogic class and its subclasses. DtSimComponent has a new member that is a pointer to a subclass of DtTimedTickLogic, which manages the state and data for the tick period of the component. Depending on the configuration of the component, it will have a different subclass of DtTimedTickLogic. Most components are configured to tick every frame and will have the DtAlwaysTickLogic logic which has no data members. Others that are configured to only tick periodically will have either DtSimTimeOnlyTickLogic or its subclass DtSimTimeAndRealTimeWhenPausedTickLogic. If your DtSimComponent subclass needs to access the tick period data, it can dynamic_cast the DtTimedTickLogic to get at the data members if they are present, as in this example:

// This example function is assumed to be in a DtSimComponent subclass.
void findTickParameters()
{
if (DtAlwaysTickLogic* logic = dynamic_cast<DtAlwaysTickLogic*>(myTimedTickLogic.get()))
{
// DtAlwaysTickLogic has no data. minTickPeriod and Variance are the equivalent of -1 in the pre-VRF5.1 system.
}
else if (DtSimTimeOnlyTickLogic* logic = dynamic_cast<DtSimTimeOnlyTickLogic*>(myTimedTickLogic.get()))
{
double minTickPeriod = logic->minTickPeriod();
double minTickPeriodVariance = logic->minTickPeriodVariance();
double nextTickTime = logic->nextTickSimTime();
}
}

[Home]


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)