fsVarsGetBVarId

The fsVarsGetBVarId function can be used to get the FsBVarId of a specific BVar using its name and its preset.

 

Syntax
FsBVarId fsVarsGetBVarId(
    const char* bVarName,
    bool callable,
    FsObjectId target
);

 

Parameters
Parameters Description
bVarName

The name of the BVar and optionally its preset ("name[_preset]").

callable A boolean indicating if the BVar can be called.
target

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

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 the correct ID associated to the given name. If an error occurred, the function will return FS_VAR_INVALID_ID.

 

Example
FsBVarId BVarId = fsVarsGetBVarId("AUXILIARY_SUNSHADE_ADJUST_PILOT", false); // valid in DA62
FsBVarId BVarId = fsVarsGetBVarId("AUXILIARY_SUNSHADE_ADJUST_PILOT", true); // NOT valid in DA62, this preset is not callable
FsBVarId BVarId = fsVarsGetBVarId("AUXILIARY_SUNSHADE_ADJUST_PILOT_TOGGLE", false); // valid in DA62
FsBVarId BVarId = fsVarsGetBVarId("AUXILIARY_SUNSHADE_ADJUST_PILOT_TOGGLE", true); // valid in DA62
FsBVarId BVarId = fsVarsGetAVarId("toto"); // NOT valid in DA62, doesn't exists