assignTeam: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "<code>([^\[]+)<\/code>" to "<sqf>$1</sqf>") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 25: | Line 25: | ||
|eff= global | |eff= global | ||
|descr= 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: | |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. | |||
{{Feature|important|In older versions of the game ({{arma2}}?) the effect of this command is '''local''' {{Icon|localEffect|32}}.}} | |||
|s1= unit [[assignTeam]] team | |s1= unit [[assignTeam]] team | ||
Line 47: | Line 62: | ||
|x1= <sqf>_soldier2 assignTeam "RED";</sqf> | |x1= <sqf>_soldier2 assignTeam "RED";</sqf> | ||
|x2= In a unit's init script in the editor | |||
<sqf>this spawn {_this assignTeam "RED"};</sqf> | |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> | |||
|seealso= [[assignedTeam]] [[dissolveTeam]] [[unassignTeam]] | |seealso= [[assignedTeam]] [[dissolveTeam]] [[unassignTeam]] | ||
}} | }} |
Latest revision as of 18:04, 28 April 2023
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.
- 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:
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
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint: Elite version 1.00
- Operation Flashpoint: Elite: New Scripting Commands
- Operation Flashpoint: Elite: 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: Groups
- Scripting Commands: Global Effect