fsVarsBVarCall

The fsVarsBVarCall function can be used to call the value of a specific BVar and its preset.

 

Syntax
FsVarError fsVarsBVarGet(
    FsBVarId bVarId,
    FsVarParamArray param,
    FsObjectId target
);

 

Parameters
Parameters Description
bVarId

The ID of a BVar (found using fsVarsGetBVarId).

param The list of parameters needed to call the BVar. It can contain double, int (which will be converted to a double) or string.
target

The ID of the object from which the variable is being called.

Possible targets are:

  1. FS_OBJECT_ID_USER_AIRCRAFT
  2. FS_OBJECT_ID_USER_AVATAR
  3. FS_OBJECT_ID_USER_CURRENT

Default: FS_OBJECT_ID_USER_AIRCRAFT.

 

Return Values

The function returns FsVarError, where 0 means there is no error (in which case, the BVar preset has been executed).

 

Example
FsBVarId BVarSetId = fsVarsGetBVarId("AUXILIARY_SUNSHADE_ADJUST_PILOT_SET", true);
FsVarParamArray param = FsCreateParamArray("i", 1);
FsVarError err = fsVarsBVarCall(BVarSetId, param);
if (err != FS_VAR_ERROR_NONE)
{
    // Error
}