BIS fnc setVehicleMass: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "_{10,} " to "")
m (Some wiki formatting)
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Function|Comments=
{{RV|type=function


| arma3 |Game name=
|game1= arma3
|version1= 1.00


|1.00|Game version=
|gr1= Object Manipulation


|gr1 = Object Manipulation |GROUP1=
|arg= local


|arg= local |Arguments=
|eff= global


|eff= global |Effect=
|descr= Set mass relative to the default vehicle mass (default mass being vehicle mass on first execution of this function).


| Set mass relative to the default vehicle mass (default mass being vehicle mass on first execution of this function). |Description=
|s1= [vehicle, animationInformation, massDifference] call [[BIS_fnc_setVehicleMass]]


| [vehicle, animationInformation, massDifference] call [[BIS_fnc_setVehicleMass]] |Syntax=
|p1= vehicle: [[Object]]


|p1= vehicle: [[Object]] |Parameter 1=
|p2= animationInformation: [[Boolean]] or [[Array]] - (Optional, default <sqf inline>[]</sqf>)
 
|p2= animationInformation: [[Boolean]] or [[Array]] - (Optional, default {{Inline code|[]}})
* [[Boolean]] - [[true]] to take current animations mass in consideration, [[false]] to set "raw" mass
* [[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, ...] |Parameter 2=
* [[Array]] - animation sources and phases to format ["animationSource1", 1, "animationSource2", 0, ...]
 
|p3= massDifference: [[Number]] - (Optional, default 0) value to add to the mass (can be negative) |Parameter 3=
 
| [[Boolean]] - success state |Return value=


2) Doesn't care about the current phase of animations, it will change the mass for the given sources
|p3= massDifference: [[Number]] - (Optional, default 0) value to add to the mass (can be negative)


3) Will do the same as the first example, then, subtract 150 to the mass
|r1= [[Boolean]] - success state


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


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


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


| [[setMass]], [[setCenterOfMass]] |See also=
|seealso= [[setMass]] [[setCenterOfMass]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Functions|{{uc:setVehicleMass}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:setVehicleMass}}]]

Latest revision as of 15:59, 13 July 2022

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:
Object Manipulation

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:
setMass setCenterOfMass

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