setTowParent: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - ";[ ]+ " to "; ")
m (Fix local arg based on Omon XR feedback (on Discord))
 
(6 intermediate revisions by 2 users not shown)
Line 2: Line 2:


|game1= arma3
|game1= arma3
|branch= dev
|version1= 2.06
|version1= 2.06


|arg= global
|arg= local
|eff= global


|eff= local
|descr=
{{{!}} class="wikitable float-right align-center-col-2 align-center-col-3"
! Simulation
! Towable
! Can Tow
{{!}}-
{{!}} CarX
{{!}} {{Icon|checked}}
{{!}} {{Icon|checked}}
{{!}}-
{{!}} TankX
{{!}} {{Icon|unchecked}}
{{!}} {{Icon|checked}}
{{!}}-
{{!}} AirplaneX
{{!}} {{Icon|unchecked}}
{{!}} {{Icon|unchecked}}
{{!}}-
{{!}} BoatX
{{!}} {{Icon|unchecked}}
{{!}} {{Icon|unchecked}}
{{!}}}


|descr= Allows ''towedVehicle'' to be towed by ''towingVehicle''. This loosens the vehicle brakes of the ''towedVehicle'' and turned its steering wheels toward the ''towingVehicle''.
Allows a vehicle to be towed by another. This loosens the towed vehicle's brakes and turns its steering wheels toward the towing vehicle.
Supposed to be used together with a rope connecting both vehicles.
Supposed to be used together with a rope connecting both vehicles.


|mp= {{Feature|warning|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''!}}
|mp= {{Feature|warning|
If a [[player]] enters the towing vehicle, the towed one will try to change its locality to be local to that [[player]].<!--
--> This might be problematic if there is another [[player]] already in the towed vehicle.<!--
--> It is recommended to not have anyone in the towed vehicle!
}}


|gr1= Object Manipulation
|gr1= Object Manipulation
Line 19: Line 43:
|gr2= Ropes and Sling Loading
|gr2= Ropes and Sling Loading


|s1= towedVehicle [[{{PAGENAMEE}}]] towingVehicle
|s1= towedVehicle [[setTowParent]] towingVehicle


|p1= towedVehicle: [[Object]] - Vehicle of type CarX (No tanks, no aircrafts, no boats)
|p1= towedVehicle: [[Object]] - vehicle of type CarX (no tanks, no aircrafts, no boats)


|p2= towingVehicle: [[Object]] - Vehicle of type CarX or TankX (No aircrafts, no boats)
|p2= towingVehicle: [[Object]] - vehicle of type CarX or TankX (no aircrafts, no boats)


|r1= [[Nothing]]
|r1= [[Nothing]]


|x1= <code>_towedVehicle [[apply]] { [[moveOut]] [[_x]] }; {{cc|Make sure no player or AI is in the vehicle}}
|x1= <sqf>
_towedVehicle [[lock]] [[true]];
{ moveOut _x } forEach crew _towedVehicle; // make sure nobody is in the towed vehicle
_hemmt '''setTowParent''' _bobcat; {{cc|Set tow Parent}}
_towedVehicle lock true; // make sure everybody stays out of it
Example needs to be expanded with ropeCreate and ropeAttachTo later</code>
ropeCreate [_bobcat, [0,-5,0], _towedVehicle, [0,2,0]];
 
_towedVehicle setTowParent _bobcat;
|x2=
</sqf>


|seealso= [[ropeCreate]]
|seealso= [[getTowParent]] [[ropeCreate]]
}}
}}

Latest revision as of 21:09, 1 April 2024

Hover & click on the images for description

Description

Description:
Simulation Towable Can Tow
CarX Checked Checked
TankX Unchecked Checked
AirplaneX Unchecked Unchecked
BoatX Unchecked Unchecked

Allows a vehicle to be towed by another. This loosens the towed vehicle's brakes and turns its steering wheels toward the towing vehicle.

Supposed to be used together with a rope connecting both vehicles.
Multiplayer:
If a player enters the towing vehicle, the towed one will try to change its locality to be local to that player. This might be problematic if there is another player already in the towed vehicle. It is recommended to not have anyone in the towed vehicle!
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; // make sure everybody stays out of it ropeCreate [_bobcat, [0,-5,0], _towedVehicle, [0,2,0]]; _towedVehicle setTowParent _bobcat;

Additional Information

See also:
getTowParent 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