effectiveCommander: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) |
Lou Montana (talk | contribs) (Add example) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 18: | Line 18: | ||
|gr1= Unit Control | |gr1= Unit Control | ||
|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 | |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. | |||
|s1= [[effectiveCommander]] vehicle | |s1= [[effectiveCommander]] vehicle | ||
Line 26: | Line 28: | ||
|r1= [[Object]] - commander unit | |r1= [[Object]] - commander unit | ||
|x1= < | |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> | |||
|seealso= [[setEffectiveCommander]] [[commander]] [[driver]] [[gunner]] | |seealso= [[setEffectiveCommander]] [[commander]] [[driver]] [[gunner]] [[currentPilot]] [[vehicleMoveInfo]] | ||
}} | }} |
Latest revision as of 18:56, 15 September 2024
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
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
Categories:
- Scripting Commands
- Introduced with Armed Assault version 1.00
- 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: Unit Control