effectiveCommander: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
 
(Add example)
 
(69 intermediate revisions by 11 users not shown)
Line 1: Line 1:
[[Category:Scripting Commands|EFFECTIVECOMMANDER]]
{{RV|type=command
[[Category:Scripting Commands ArmA|EFFECTIVECOMMANDER]]


|game1= arma1
|version1= 1.00


<h2 style="color:#000066">''''' effectiveCommander ''vehicle'''''</h2>
|game2= arma2
|version2= 1.00


|game3= arma2oa
|version3= 1.50


'''Operand types:'''
|game4= tkoh
|version4= 1.00


'''vehicle:''' [[Object]]
|game5= arma3
|version5= 0.50


'''[vehicle, turret path]:''' [[Array]]
|gr1= Unit Control


'''Type of returned value:'''
|descr= Returns the effective commander of the vehicle. Effective commander is the player whom driver AI will listen to.
So if in a tank there is a gunner and a commander and AI driver, if the [[effectiveCommander]] is gunner, then gunner pressing {{Controls|W}} {{Controls|A}} {{Controls|S}} {{Controls|D}} will give AI orders to move.
If gunner jumps out and then enters a tank again, the [[effectiveCommander]] role most likely has changed to commander that remained in tank. Also the assignment seems to work on first come first served basis.


[[Object]]
|s1= [[effectiveCommander]] vehicle


'''Compatibility:'''
|p1= vehicle: [[Object]]


Version 2.92 required.
|r1= [[Object]] - commander unit


'''Description:'''
|x1= <sqf>
_unit = driver tank;
_effectiveCommander = effectiveCommander _unit; // returns the tank driver itself
_effectiveCommander = effectiveCommander tank; // returns the effective commander (commander or gunner or driver)
_effectiveCommander = effectiveCommander vehicle _unit; // identical to the one above - use [[vehicle]] if only the unit is known
</sqf>


Returns the effective commander (who really commands) of the vehicle.
|seealso= [[setEffectiveCommander]] [[commander]] [[driver]] [[gunner]] [[currentPilot]] [[vehicleMoveInfo]]
}}

Latest revision as of 18:56, 15 September 2024

Hover & click on the images for description

Description

Description:
Returns the effective commander of the vehicle. Effective commander is the player whom driver AI will listen to. So if in a tank there is a gunner and a commander and AI driver, if the effectiveCommander is gunner, then gunner pressing W A S D will give AI orders to move. If gunner jumps out and then enters a tank again, the effectiveCommander role most likely has changed to commander that remained in tank. Also the assignment seems to work on first come first served basis.
Groups:
Unit Control

Syntax

Syntax:
effectiveCommander vehicle
Parameters:
vehicle: Object
Return Value:
Object - commander unit

Examples

Example 1:
_unit = driver tank; _effectiveCommander = effectiveCommander _unit; // returns the tank driver itself _effectiveCommander = effectiveCommander tank; // returns the effective commander (commander or gunner or driver) _effectiveCommander = effectiveCommander vehicle _unit; // identical to the one above - use vehicle if only the unit is known

Additional Information

See also:
setEffectiveCommander commander driver gunner currentPilot vehicleMoveInfo

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