commander: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - ":<code>" to ": <code>")
m (Some wiki formatting)
 
(11 intermediate revisions by the same user not shown)
Line 30: Line 30:
|s1= [[commander]]  vehicle
|s1= [[commander]]  vehicle


|p1= vehicle: [[Object]] - Vehicle
|p1= vehicle: [[Object]] - vehicle


|r1= [[Object]] - The unit sitting in the commander place is returned. If vehicle is not a vehicle but a person, the person is returned.
|r1= [[Object]] - the unit sitting in the commander place is returned. If vehicle is not a vehicle but a person, the person is returned.


|x1= <code>[[moveOut]] [[commander]] _tank;</code>
|x1= <sqf>moveOut commander _tank;</sqf>


|x2= Detect if player is in commander turret of a vehicle:
|x2= Detect if player is in commander turret of a vehicle:
<code>_isVehicleCommander = [[player]] [[isEqualTo]] [[commander]] [[objectParent]] [[player]];</code>
<sqf>_isVehicleCommander = player isEqualTo commander objectParent player;</sqf>


|seealso= [[driver]] [[gunner]] [[crew]] [[currentPilot]] [[effectiveCommander]]
|seealso= [[driver]] [[gunner]] [[crew]] [[currentPilot]] [[effectiveCommander]]
}}
}}
<dl class="command_description">
<dt></dt>
<dd class="notedate">Posted on August 3, 2006 - 14:25</dd>
<dt class="note">[[User:Hardrock|hardrock]]</dt>
<dd class="note">''Notes from before the conversion:''
It is also possible to find the commander of a vehicle by placing a '''C''' after the name of the vehicle so ''Tank1C'' and '''''commander''' Tank1'' both refer to the same unit, providing the original commander has not got out of the tank.
The difference between the two is ''Tank1C'' is always the unit that was commander of the tank when the mission started, whilst '''''commander''' Tank1'' is the commander which is now there.
<dt><dt>
<dd class="notedate">Posted on August 3, 2006 - 14:25</dd>
<dt class="note">[[User:Giova|Giova]]</dt>
<dd class="note">'''''WARNING''' about Hardrock note:''
Take very care about this : if you give a vehicleVarName to one crew, so his referent will not be Tank1x anymore ! Also, if in the mission editor, you put something in the name field, when this soldier will getin a vehicle, it will not be a Tank1x too. So do not take consideration about Hardrock note, if you don't want to have bad surprise. It Is better to force names by using [[setVehicleVarName]] command.
<code>(([[crew]] tank) [[select]] 0) [[setVehicleVarName]] "Tankcrew0"</code>
</dl>

Latest revision as of 11:39, 28 March 2024

Hover & click on the images for description

Description

Description:
In Operation Flashpoint it returns the commander of a vehicle. Since Armed Assault it returns the primary observer. The commander of a vehicle can be found with effectiveCommander.
Groups:
Object Manipulation

Syntax

Syntax:
commander vehicle
Parameters:
vehicle: Object - vehicle
Return Value:
Object - the unit sitting in the commander place is returned. If vehicle is not a vehicle but a person, the person is returned.

Examples

Example 1:
moveOut commander _tank;
Example 2:
Detect if player is in commander turret of a vehicle:
_isVehicleCommander = player isEqualTo commander objectParent player;

Additional Information

See also:
driver gunner crew currentPilot effectiveCommander

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