assignTeam: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "[[Category:Scripting Commands ArmA|" to "[[Category:Scripting Commands Armed Assault|")
m (Some wiki formatting)
 
(49 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma |Game name=
|game1= ofpe
|version1= 1.00


|1.00|= Game version
|game2= arma1
|version2= 1.00


|arg= global|Multiplayer Arguments=
|game3= arma2
|eff= global |Multiplayer Effects=
|version3= 1.00
____________________________________________________________________________________________


| Assigns the unit (in case of a vehicle, its commander) to the given team. Team is an option in group control (unit management) menu that allows to split player group in teams and then give bulk order to separate teams. In order to operate properly, the command requires specific conditions:
|game4= arma2oa
* The command requires [[player]] to be fully initialised
|version4= 1.50
* The unit getting assigned must be either player himself or a unit in player's group
* Units in player's group as well as player himself can all have different teams assigned
* The colour of the assigned team for a unit is seen on the group management UI as well as squad radar
The possible team values (colours) are:
* "MAIN" - (white)
* "RED" - (red)
* "GREEN" - (green)
* "BLUE" - (blue)
* "YELLOW"  - (yellow)
'''NOTE''': In older version of the game the effect of this command is local {{EffArg|cmd|eff|local}}
|DESCRIPTION=
____________________________________________________________________________________________


| unit '''assignTeam''' team |SYNTAX=
|game5= tkoh
|version5= 1.00


|p1= unit: [[Object]] |PARAMETER1=
|game6= arma3
|version6= 0.50


|p2= team: [[String]] |PARAMETER2=
|gr1= Groups


| [[Nothing]] |RETURNVALUE=
|arg= global
____________________________________________________________________________________________
 
|x1= <code>_soldier2 [[assignTeam]] "RED";</code> |EXAMPLE1=
|x2= In a unit's init script in the editor you should use the following. Or else you might experience [https://en.wikipedia.org/wiki/Race_condition race conditions].
<code>0 = [[this]] [[spawn]] {_this [[assignTeam]] "RED"};</code> |EXAMPLE2=


____________________________________________________________________________________________
|eff= global


| [[assignedTeam]], [[dissolveTeam]], [[unassignTeam]] |SEEALSO=
|descr= {{{!}} class="wikitable float-right align-center"
! Team
! Value
{{!}}-
{{!}} White
{{!}} "MAIN"
{{!}}-
{{!}} Red
{{!}} "RED"
{{!}}-
{{!}} Green
{{!}} "GREEN"
{{!}}-
{{!}} Blue
{{!}} "BLUE"
{{!}}-
{{!}} Yellow
{{!}} "YELLOW"
{{!}}}
Assigns the unit (in case of a vehicle, its commander) to the given team. Team is an option in group control (unit management) menu that allows to split player group in teams and then give bulk order to separate teams.
In order to operate properly, the command requires specific conditions:
* the command requires [[player]] to be fully initialised
* the unit getting assigned must be either player himself or a unit in player's group
The colour of the assigned team for a unit is seen on the group management UI as well as squad radar.


}}


<h3 style="display:none">Notes</h3>
{{Feature|important|In older versions of the game ({{arma2}}?) the effect of this command is '''local''' {{Icon|localEffect|32}}.}}
<dl class="command_description">
 
|s1= unit [[assignTeam]] team
 
|p1= unit: [[Object]]
 
|p2= team: [[String]]


<!-- Note Section BEGIN -->
|r1= [[Nothing]]


<!-- Note Section END -->
|x1= <sqf>_soldier2 assignTeam "RED";</sqf>
</dl>


<h3 style="display:none">Bottom Section</h3>
|x2= In a unit's init script in the editor [[spawn]] should be used, otherwise a {{Link|https://en.wikipedia.org/wiki/Race_condition|race condition}} may be experienced:
<sqf>this spawn { _this assignTeam "RED" };</sqf>


[[Category:Scripting Commands|ASSIGNTEAM]]
|seealso= [[assignedTeam]] [[dissolveTeam]] [[unassignTeam]]
[[Category:Scripting Commands OFP Elite |ASSIGNTEAM]]
}}
[[Category:Scripting Commands Armed Assault|ASSIGNTEAM]]
[[Category:Command_Group:_Groups|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Take On Helicopters|{{uc:{{PAGENAME}}}}]]

Latest revision as of 18:04, 28 April 2023

Hover & click on the images for description

Description

Description:
Team Value
White "MAIN"
Red "RED"
Green "GREEN"
Blue "BLUE"
Yellow "YELLOW"

Assigns the unit (in case of a vehicle, its commander) to the given team. Team is an option in group control (unit management) menu that allows to split player group in teams and then give bulk order to separate teams. In order to operate properly, the command requires specific conditions:

  • the command requires player to be fully initialised
  • the unit getting assigned must be either player himself or a unit in player's group

The colour of the assigned team for a unit is seen on the group management UI as well as squad radar.


In older versions of the game (Arma 2?) the effect of this command is local LELocal.
Groups:
Groups

Syntax

Syntax:
unit assignTeam team
Parameters:
unit: Object
team: String
Return Value:
Nothing

Examples

Example 1:
_soldier2 assignTeam "RED";
Example 2:
In a unit's init script in the editor spawn should be used, otherwise a race condition may be experienced:
this spawn { _this assignTeam "RED" };

Additional Information

See also:
assignedTeam dissolveTeam unassignTeam

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