assignedVehicleRole: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Some wiki formatting)
 
(92 intermediate revisions by 13 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


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


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


| Return the role a unit is assigned to within its assigned vehicle.
|game3= arma2oa
|version3= 1.50


The array which is returned contains:
|game4= tkoh
* [] - Not assigned to any vehicle
|version4= 1.00
* ["Driver"] - Assigned as driver
* ["Cargo"] - Assigned as cargo
* ["Turret", [turret path]] - Assigned to a turret


|= Description
|game5= arma3
____________________________________________________________________________________________
|version5= 0.50


| [[Array]] <nowiki>=</nowiki> '''assignedVehicleRole''' [[Object#Unit|Unit]]|= Syntax
|arg= global


|p1= [[Object#Unit|Unit]]: [[Object]] |= Parameter 1
|gr1= Object Manipulation


| [[Array]] |= Return value
|descr= Returns the role a unit is assigned to within its assigned vehicle.
____________________________________________________________________________________________
{{Feature|informative|See [[AI Group Vehicle Management]] for more information.}}
 
|x1= <pre>_RoleArray=assignedVehicleRole player</pre> |= Example 1
____________________________________________________________________________________________


| |= See also
|mp= On a client the command will return empty arrays for every unit that is not local. On the server the command correctly returns the role, regardless of the units locality.


}}
|s1= [[assignedVehicleRole]] unitName
 
|p1= unitName: [[Object]]


<h3 style="display:none">Notes</h3>
|r1= [[Array]] - the array which is returned contains:<br>
<dl class="command_description">
* [] - not assigned to any vehicle
* ["driver"] - Assigned as driver
* ["cargo"] or {{GVI|arma3|1.32|size= 0.75}} ["cargo", [turret path]] - assigned as cargo
* ["turret", turretPath] - assigned to a turret (turretPath format [[Turret Path]])


<!-- Note Section BEGIN -->
|x1= <sqf>_RoleArray = assignedVehicleRole player;</sqf>


<!-- Note Section END -->
|x2= Get weapons available to player at player occupied turret:
</dl>
<sqf>_weaponsTurret = vehicle player weaponsTurret (assignedVehicleRole player select 1);</sqf>


<h3 style="display:none">Bottom Section</h3>
|seealso= [[addVehicle]] [[assignedVehicle]] [[unassignVehicle]] [[leaveVehicle]] [[assignAsCargo]] [[assignAsCommander]] [[assignAsDriver]] [[assignAsGunner]] [[assignAsTurret]] [[crew]] [[assignedVehicles]] [[assignedGroup]] [[fullCrew]]
}}


[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
{{Note
[[Category:Scripting Commands ArmA|{{uc:{{PAGENAME}}}}]]
|user= Killzone_Kid
[[Category:Command_Group:_Object_Information|{{uc:{{PAGENAME}}}}]]
|timestamp= 20130831161800
[[Category:Command_Group:_Vehicle_Assignment|{{uc:{{PAGENAME}}}}]]
|text= When player is in a group of AIs and is not the leader, [[assignedVehicleRole]] of the player could be unpredictable and absolutely not related to the position player occupies.
In short, forget about this command for the player, it is unreliable and has been broken too many times in the past.
}}

Latest revision as of 15:28, 17 April 2023

Hover & click on the images for description

Description

Description:
Returns the role a unit is assigned to within its assigned vehicle.
See AI Group Vehicle Management for more information.
Multiplayer:
On a client the command will return empty arrays for every unit that is not local. On the server the command correctly returns the role, regardless of the units locality.
Groups:
Object Manipulation

Syntax

Syntax:
assignedVehicleRole unitName
Parameters:
unitName: Object
Return Value:
Array - the array which is returned contains:
  • [] - not assigned to any vehicle
  • ["driver"] - Assigned as driver
  • ["cargo"] or Arma 3 logo black.png1.32 ["cargo", [turret path]] - assigned as cargo
  • ["turret", turretPath] - assigned to a turret (turretPath format Turret Path)

Examples

Example 1:
_RoleArray = assignedVehicleRole player;
Example 2:
Get weapons available to player at player occupied turret:
_weaponsTurret = vehicle player weaponsTurret (assignedVehicleRole player select 1);

Additional Information

See also:
addVehicle assignedVehicle unassignVehicle leaveVehicle assignAsCargo assignAsCommander assignAsDriver assignAsGunner assignAsTurret crew 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
Killzone_Kid - c
Posted on Aug 31, 2013 - 16:18 (UTC)
When player is in a group of AIs and is not the leader, assignedVehicleRole of the player could be unpredictable and absolutely not related to the position player occupies. In short, forget about this command for the player, it is unreliable and has been broken too many times in the past.