BIS fnc setVehicleMass: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl> " to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...) |
||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
| arma3 | | arma3 | ||
|1.00 | |1.00 | ||
|gr1 = Object Manipulation | |gr1 = Object Manipulation | ||
|arg= local |Arguments= | |arg= local |Arguments= | ||
Line 11: | Line 11: | ||
|eff= global |Effect= | |eff= global |Effect= | ||
| 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). | ||
| [vehicle, animationInformation, massDifference] call [[BIS_fnc_setVehicleMass]] | | [vehicle, animationInformation, massDifference] call [[BIS_fnc_setVehicleMass]] | ||
|p1= vehicle: [[Object]] | |p1= vehicle: [[Object]] | ||
|p2= animationInformation: [[Boolean]] or [[Array]] - (Optional, default {{Inline code|[]}}) | |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, ...] | * [[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) | |p3= massDifference: [[Number]] - (Optional, default 0) value to add to the mass (can be negative) | ||
| [[Boolean]] - success state | | [[Boolean]] - success state | ||
2) Doesn't care about the current phase of animations, it will change the mass for the given sources | 2) Doesn't care about the current phase of animations, it will change the mass for the given sources | ||
Line 31: | Line 31: | ||
|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/>[[this]]] [[call]] [[BIS__fnc_setVehicleMass]]; | result = [<nowiki/>[[this]]] [[call]] [[BIS__fnc_setVehicleMass]]; | ||
result = [<nowiki/>[[this]], [], 0] [[call]] [[BIS_fnc_setVehicleMass]];</code> | result = [<nowiki/>[[this]], [], 0] [[call]] [[BIS_fnc_setVehicleMass]];</code> | ||
|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/>[[this]], ["source1", 1, "source2", 0]] [[call]] [[BIS_fnc_initVehicle]];</code> | result = [<nowiki/>[[this]], ["source1", 1, "source2", 0]] [[call]] [[BIS_fnc_initVehicle]];</code> | ||
|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/>[[this]], [], -150] [[call]] [[BIS_fnc_initVehicle]];</code> | result = [<nowiki/>[[this]], [], -150] [[call]] [[BIS_fnc_initVehicle]];</code> | ||
| [[setMass]], [[setCenterOfMass]] | | [[setMass]], [[setCenterOfMass]] | ||
}} | }} | ||
Revision as of 23:45, 17 January 2021
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
[]
) - massDifference: Number - (Optional, default 0) value to add to the mass (can be negative)
- Return Value:
- Boolean - success state 2) Doesn't care about the current phase of animations, it will change the mass for the given sources 3) Will do the same as the first example, then, subtract 150 to the mass
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