BIS fnc setVehicleMass: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Page filling)
m (Text replacement - " <nowiki>[</nowiki>" to " [<nowiki/>")
Line 32: Line 32:


|x1= <code>{{codecomment|// default behaviour, change the mass according to the current phase of the animation sources}}
|x1= <code>{{codecomment|// default behaviour, change the mass according to the current phase of the animation sources}}
result = <nowiki>[</nowiki>[[this]]]        [[call]] [[BIS__fnc_setVehicleMass]];
result = [<nowiki/>[[this]]]        [[call]] [[BIS__fnc_setVehicleMass]];
result = <nowiki>[</nowiki>[[this]], [], 0] [[call]] [[BIS_fnc_setVehicleMass]];</code> |Example 1=
result = [<nowiki/>[[this]], [], 0] [[call]] [[BIS_fnc_setVehicleMass]];</code> |Example 1=


|x2= <code>{{codecomment|// doesn't care about the current phase of animations, it will change the mass for the given sources}}
|x2= <code>{{codecomment|// doesn't care about the current phase of animations, it will change the mass for the given sources}}
result = <nowiki>[</nowiki>[[this]], ["source1", 1, "source2", 0]] [[call]] [[BIS_fnc_initVehicle]];</code> |Example 2=
result = [<nowiki/>[[this]], ["source1", 1, "source2", 0]] [[call]] [[BIS_fnc_initVehicle]];</code> |Example 2=


|x3= <code>{{codecomment|// will do the same as the first example, then subtract 150 to the mass}}
|x3= <code>{{codecomment|// will do the same as the first example, then subtract 150 to the mass}}
result = <nowiki>[</nowiki>[[this]], [], -150] [[call]] [[BIS_fnc_initVehicle]];</code> |Example 3=
result = [<nowiki/>[[this]], [], -150] [[call]] [[BIS_fnc_initVehicle]];</code> |Example 3=
____________________________________________________________________________________________
____________________________________________________________________________________________



Revision as of 12:38, 19 March 2020

Hover & click on the images for description

Description

Description:
Set mass relative to the default vehicle mass (default mass being vehicle mass on first execution of this function).
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[vehicle, animationInformation, massDifference] call BIS_fnc_setVehicleMass
Parameters:
vehicle: Object
animationInformation: Boolean or Array - (Optional, default [])
  • Boolean - true to take current animations mass in consideration, false to set "raw" mass
  • Array - animation sources and phases to format ["animationSource1", 1, "animationSource2", 0, ...]
massDifference: Number - (Optional, default 0) value to add to the mass (can be negative)
Return Value:
Boolean - success state

Examples

Example 1:
// default behaviour, change the mass according to the current phase of the animation sources result = [this] call BIS__fnc_setVehicleMass; result = [this, [], 0] call BIS_fnc_setVehicleMass;
Example 2:
// doesn't care about the current phase of animations, it will change the mass for the given sources result = [this, ["source1", 1, "source2", 0]] call BIS_fnc_initVehicle;
Example 3:
// will do the same as the first example, then subtract 150 to the mass result = [this, [], -150] call BIS_fnc_initVehicle;

Additional Information

See also:
setMasssetCenterOfMass

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Bottom Section