addVehicle: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "_{10,} " to "")
No edit summary
 
(29 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command


| arma1 |Game name=
|game1= arma1
|version1= 1.05


|1.05|Game version=
|game2= arma2
|version2= 1.00


|arg= local |Multiplayer Arguments=
|game3= arma2oa
|version3= 1.50


|gr1= Object Manipulation |GROUP1=
|game4= tkoh
|version4= 1.00


| Adds a specified vehicle for use by a specified AI led group.
|game5= arma3
<br><br>
|version5= 0.50
Notes:
* The vehicle will be considered as available for use by this group.
* It creates a/adds to the vehicle pool for the given group to use. So more than one vehicle can be added to a group, and more than one group can be added to a vehicle.
* This is relevant for some waypoints like getIn and guard - potentially more.
* The AI choosing what vehicle to use based on the vehicle's [[CfgVehicles_Config_Reference#cost|cost]] value. Probably also distance to the available vehicles plays a role.
* When deciding whether to board a vehicle, AI leaders seem to only consider the transport benefit of a vehicle, ignoring any combat benefits the vehicle may provide.
* This happens also implicitly when using assignAsXXX or moveInXXX commands, or player GL orders units to enter a vehicle, as well editor or Zeus placed vehicles with units assigned to it.
* One can make an AI GL order his group to board the specified vehicle with [[orderGetIn]] [[true]]. Setting to [[false]] will cancel the order, but the AI will first enter to get out again immediately thereafter. To immediately (potentially temporarily) halt the AI moving to the vehicle one can use  [[allowGetIn]] [[false]].
* When vehicle is added in this way, it can appear as a target for the enemy - even if the vehicle currently has no crew.
* If used on a vehicle already driven by a member of another group, the driver will continue under his own group's orders, which may not benefit the addVehicle group.
* Seems to have no affect on AI under player command - at least as long as the player remains the GL.
* To remove vehicle from a group, use [[leaveVehicle]].
|DESCRIPTION=


| groupName '''addVehicle''' vehicleName|SYNTAX=
|arg= local


|p1= groupName: [[Group]]|PARAMETER1=
|gr1= Object Manipulation


|p2= vehicleName: [[Object]]|PARAMETER2=
|descr= Adds a specified vehicle for use by a specified AI led group.
{{Feature|informative|See [[AI Group Vehicle Management]] for more information.}}


| [[Nothing]] |RETURNVALUE=
|s1= groupName [[addVehicle]] vehicleName
 
|x1= <code>_grp [[addVehicle]] _vehicle</code> |EXAMPLE1=


|x2= Using on crewed vehicle:<code>[[group]] tank [[addVehicle]] tank;</code> |EXAMPLE2=
|p1= groupName: [[Group]]


| [[leaveVehicle]], [[unassignVehicle]], [[createVehicleCrew]] |SEEALSO=
|p2= vehicleName: [[Object]]


}}
|r1= [[Nothing]]


<h3 style="display:none">Notes</h3>
|x1= <sqf>_grp addVehicle _vehicle;</sqf>
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|x2= Using on crewed vehicle:
</dl>
<sqf>group tank addVehicle tank;</sqf>


<h3 style="display:none">Bottom Section</h3>
|seealso= [[leaveVehicle]] [[unassignVehicle]] [[createVehicleCrew]] [[assignedVehicles]] [[assignedGroup]] [[fullCrew]]
 
}}
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
{{GameCategory|arma1|Scripting Commands}}
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}

Latest revision as of 16:18, 31 August 2022

Hover & click on the images for description

Description

Description:
Adds a specified vehicle for use by a specified AI led group.
See AI Group Vehicle Management for more information.
Groups:
Object Manipulation

Syntax

Syntax:
groupName addVehicle vehicleName
Parameters:
groupName: Group
vehicleName: Object
Return Value:
Nothing

Examples

Example 1:
_grp addVehicle _vehicle;
Example 2:
Using on crewed vehicle:
group tank addVehicle tank;

Additional Information

See also:
leaveVehicle unassignVehicle createVehicleCrew assignedVehicles assignedGroup fullCrew

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