The fsVarsAVarXYZSet function can be used to set the value of a specific AVar stored as a three dimensional vector (including LLA).

 

Syntax
FsVarError fsVarsAVarXYZSet(
    FsAVarId aVarId,
    FsUnitId unitId,
    FsVarParamArray param,
    FsVec3d value,
    FsObjectId target
);

 

Parameters
ParametersDescription
aVarId

The ID of an AVar (found using fsVarsGetAVarId).

unitIdThe ID of a unit (found using fsVarsGetUnitId).
paramA parameter which might be mandatory to access the AVar (in the case of an indexed AVar, for example). Elements in param can be FsCrc, String or index.
valueThe new value of the AVar.
target

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

 

Return Values

This function returns FsVarError, where 0 means there is no error (in which case, the value of the AVar has been set in result).

 

Example
FsUnitId unitId = fsVarsGetUnitId("feet per seconds");
FsAVarId aVarId = fsVarsGetAVarId("STRUCT WORLDVELOCITY");
FsVec3d newValue {-6, 0, 0};
if (fsVarsAVarXYZSet(aVarId, unitId, {}, newValue) == FS_VAR_ERROR_NONE)
{
    // valid
}
else
{
    // error
}