setGroupOwner: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "|= Game name" to "|Game name=")
m (Text replacement - "Nelis.75733126" to "Nelis75733126")
 
(44 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma3 |Game name=
|game1= arma3
|version1= 1.40


|1.40|Game version=
|gr1= Multiplayer


|exec= server|=
|serverExec= server
____________________________________________________________________________________________


| Changes the ownership of a group (and all its units) to a given client. Group leader can't be a player. Only works when called from a server. Returns true if locality was changed. For [[agents]] use [[setOwner]] command. |DESCRIPTION=
|descr= Changes the ownership of a group (and all its units) to a given client. The group leader must not be a player. This command only works when called from the server. Returns true if locality was changed. For [[agents]] use [[setOwner]] command.
____________________________________________________________________________________________


| group '''setGroupOwner''' clientID |SYNTAX=
|s1= group [[setGroupOwner]] clientID


|p1= group: [[Group]] - |PARAMETER1=
|p1= group: [[Group]]
|p2= clientID: [[Number]] - the [[Multiplayer_Scripting#Machine_network_ID | machine network ID]] of the new [[owner]].


|p2= clientID: [[Number]] - clientID of the new [[owner]] |PARAMETER2=
|r1= [[Boolean]]


|p3= |PARAMETER3=  
|x1= <sqf>_localityChanged = _someGroup setGroupOwner (owner _playerObject);</sqf>


| [[Boolean]] |RETURNVALUE=
|seealso= [[owner]] [[setOwner]] [[groupOwner]]
}}


<dl class="command_description">


|x1= <code>_localityChanged = _someGroup [[setGroupOwner]] ([[owner]] _playerObject);</code>|EXAMPLE1=  
<dt></dt>
<dd class="notedate">Posted on 2015-07-30 - 12:49 (UTC)</dd>
<dt class="note">[[User:Nelis75733126|Nelis75733126]]</dt>
<dd class="note">
In Arma 3 1.48, setGroupOwner only works if the group has units in it.
</dd>


____________________________________________________________________________________________
<dt><dt>
<dd class="notedate">Posted on 2020-04-28 - 22:58 (UTC)</dd>
<dt class="note">{{Link|link= https://forums.bohemia.net/profile/1117131-tmzulu/|text= TMZulu}}</dt>
<dd class="note">
The [[setGroupOwner]] command will dismount the unit leader of a vehicle if the vehicle is stationary, likely due to the dummy waypoint used in the transfer.<br>
[[lock|Locking]] the vehicle during transfer can counter this behavior.
</dd>


| [[owner]], [[setOwner]], [[groupOwner]] |SEEALSO=
<dt><dt>
 
<dd class="notedate">Posted on 2020-04-30 - 21:15 (UTC)</dd>
|  |MPBEHAVIOUR=
<dt class="note">[[User:TMZulu|TMZulu]]</dt>
____________________________________________________________________________________________
<dd class="note">
}}
Using '''setGroupOwner''' may cause AI to have their loadout removed. This typically occurs when transferring multiple groups in sequence without delay. This occurs on seemingly random AI in groups. The simple but finicky solution to this is to add a sufficient delay between the transfer of groups. Alternatively, one could have the units' loadouts saved and then reloaded if the unit is shown as naked. Both of these methods may be combined as well.
 
</dd>
<h3 style='display:none'>Notes</h3>
<dl class='command_description'>
<!-- Note Section BEGIN -->
 
<!-- Note Section END -->
</dl>
 
<h3 style='display:none'>Bottom Section</h3>
[[Category:Arma 3: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Command_Group:_Multiplayer|{{uc:{{PAGENAME}}}}]]


<!-- CONTINUE Notes -->
<dt><dt>
<dl class="command_description">
<dd class="notedate">Posted on 2020-04-30 - 21:58 (UTC)</dd>
<dd class="notedate">Posted on July 30, 2015 - 12:49 (UTC)</dd>
<dt class="note">[[User:TMZulu|TMZulu]]</dt>
<dt class="note">[[User:IT07|IT07]]</dt>
<dd class="note">
<dd class="note">
In ArmA3 1.48, setGroupOwner does NOT work if group has no units
Locality dependent commands such as '''forceSpeed''' will no longer work after transfer and must be reapplied on the owning client.
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 15:38, 29 June 2024

Hover & click on the images for description

Description

Description:
Changes the ownership of a group (and all its units) to a given client. The group leader must not be a player. This command only works when called from the server. Returns true if locality was changed. For agents use setOwner command.
Groups:
Multiplayer

Syntax

Syntax:
group setGroupOwner clientID
Parameters:
group: Group
clientID: Number - the machine network ID of the new owner.
Return Value:
Boolean

Examples

Example 1:
_localityChanged = _someGroup setGroupOwner (owner _playerObject);

Additional Information

See also:
owner setOwner groupOwner

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
Posted on 2015-07-30 - 12:49 (UTC)
Nelis75733126
In Arma 3 1.48, setGroupOwner only works if the group has units in it.
Posted on 2020-04-28 - 22:58 (UTC)
TMZulu
The setGroupOwner command will dismount the unit leader of a vehicle if the vehicle is stationary, likely due to the dummy waypoint used in the transfer.
Locking the vehicle during transfer can counter this behavior.
Posted on 2020-04-30 - 21:15 (UTC)
TMZulu
Using setGroupOwner may cause AI to have their loadout removed. This typically occurs when transferring multiple groups in sequence without delay. This occurs on seemingly random AI in groups. The simple but finicky solution to this is to add a sufficient delay between the transfer of groups. Alternatively, one could have the units' loadouts saved and then reloaded if the unit is shown as naked. Both of these methods may be combined as well.
Posted on 2020-04-30 - 21:58 (UTC)
TMZulu
Locality dependent commands such as forceSpeed will no longer work after transfer and must be reapplied on the owning client.