setTowParent: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - ";[ ]+ " to "; ")
m (Some fixes for the example code)
Line 27: Line 27:
|r1= [[Nothing]]
|r1= [[Nothing]]


|x1= <code>_towedVehicle [[apply]] { [[moveOut]] [[_x]] }; {{cc|Make sure no player or AI is in the vehicle}}
|x1= <code>{ [[moveOut]] [[_x]]; } [[forEach]] [[crew]] _towedVehicle; {{cc|Make sure nobody is in the towed vehicle}}
_towedVehicle [[lock]] [[true]];
_towedVehicle [[lock]] [[true]];
_hemmt '''setTowParent''' _bobcat; {{cc|Set tow Parent}}
_towedVehicle [[setTowParent]] _bobcat;</code>
Example needs to be expanded with ropeCreate and ropeAttachTo later</code>
{{Wiki|TODO|Example needs to be expanded with [[ropeCreate]] and [[ropeAttachTo]].}}


|x2=
|x2=

Revision as of 15:01, 14 August 2021

Hover & click on the images for description
Only available in Development branch(es) until its release with Arma 3 patch v2.06.

Description

Description:
Allows towedVehicle to be towed by towingVehicle. This loosens the vehicle brakes of the towedVehicle and turned its steering wheels toward the towingVehicle. Supposed to be used together with a rope connecting both vehicles.
Multiplayer:
If a player enters the towingVehicle the towedVehicle will try to change locality to be local to the player. This might be problematic if there is a player already in the towedVehicle. It is recommended to not have anyone in the towedVehicle!
Groups:
Object ManipulationRopes and Sling Loading

Syntax

Syntax:
towedVehicle setTowParent towingVehicle
Parameters:
towedVehicle: Object - Vehicle of type CarX (No tanks, no aircrafts, no boats)
towingVehicle: Object - Vehicle of type CarX or TankX (No aircrafts, no boats)
Return Value:
Nothing

Examples

Example 1:
{ moveOut _x; } forEach crew _towedVehicle; // Make sure nobody is in the towed vehicle _towedVehicle lock true; _towedVehicle setTowParent _bobcat;
🚧
TODO: Example needs to be expanded with ropeCreate and ropeAttachTo.

Additional Information

See also:
ropeCreate

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