assignedVehicleRole: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "[[Category:Scripting_Commands_Take_On_Helicopters" to "[[Category:Scripting Commands Take On Helicopters") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
(62 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{RV|type=command | ||
| | |game1= arma1 | ||
|version1= 1.05 | |||
|1. | |game2= arma2 | ||
|version2= 1.00 | |||
| | |game3= arma2oa | ||
|version3= 1.50 | |||
| | |game4= tkoh | ||
|version4= 1.00 | |||
|game5= arma3 | |||
|version5= 0.50 | |||
|arg= global | |||
| | |gr1= Object Manipulation | ||
| | |descr= Returns the role a unit is assigned to within its assigned vehicle. | ||
{{Feature|informative|See [[AI Group Vehicle Management]] for more information.}} | |||
| | |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]] | ||
}} | |r1= [[Array]] - the array which is returned contains:<br> | ||
* [] - 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]]) | |||
< | |x1= <sqf>_RoleArray = assignedVehicleRole player;</sqf> | ||
|x2= Get weapons available to player at player occupied turret: | |||
<sqf>_weaponsTurret = vehicle player weaponsTurret (assignedVehicleRole player select 1);</sqf> | |||
< | |||
|seealso= [[addVehicle]] [[assignedVehicle]] [[unassignVehicle]] [[leaveVehicle]] [[assignAsCargo]] [[assignAsCommander]] [[assignAsDriver]] [[assignAsGunner]] [[assignAsTurret]] [[crew]] [[assignedVehicles]] [[assignedGroup]] [[fullCrew]] | |||
}} | |||
{{Note | |||
|user= Killzone_Kid | |||
|timestamp= 20130831161800 | |||
|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. | |||
}} | |||
In | |||
Latest revision as of 15:28, 17 April 2023
Description
- Description:
- Returns the role a unit is assigned to within its assigned vehicle.
- 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 1.32 ["cargo", [turret path]] - assigned as cargo
- ["turret", turretPath] - assigned to a turret (turretPath format Turret Path)
Examples
- Example 1:
- Example 2:
- Get weapons available to player at player occupied turret:
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
- 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.
Categories:
- Scripting Commands
- Introduced with Armed Assault version 1.05
- ArmA: Armed Assault: New Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Object Manipulation