createUnit: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "_{10,} " to "")
m (Warning)
 
(56 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command


| ofp |Game name=
|game1= ofp
|version1= 1.34


|1.34|Game version=
|game2= ofpe
|version2= 1.00


|eff= global |Effects in MP=
|game3= arma1
|version3= 1.00


|gr1= Object Manipulation |GROUP1=
|game4= arma2
|version4= 1.00


| Create a unit of class that is defined in [[:Category:CfgVehicles|CfgVehicles]].
|game5= arma2oa
{{Important | <div style{{=}}"float: left; margin-right: 0.5em;">{{GVI|ofp|1.34}} {{GVI|arma1|1.00}}</div>
|version5= 1.50
This command could be bugged in {{ofp}} or {{arma1}} ; an additional [[join]] may solve the problem.<br>
However, some commands such as [[setUnitPos]] only work if run before the [[join]].}}
{{Warning | The unit will not be created if the passed group does not exist (a.k.a [[grpNull]]); this can happen if [[createGroup]] fails because the '''group limit has been reached''' (see [[createGroup]] for respective game limits).}} |Description=


|group [[createUnit]] [type, position, markers, placement, special] |Syntax=
|game6= tkoh
|version6= 1.00


|p1= group: [[Group]] - Existing group new unit will join |Parameter 1=
|game7= arma3
|p2= [type, position, markers, placement, special]: [[Array]] |Parameter 2=
|version7= 0.50
|p3= type: [[String]] - Class name of unit to be created as per [[CfgVehicles]] |Parameter 3=
|p4= position: [[Position]], [[Position2D]], [[Object]] or [[Group]] - Location unit is created at. In case of [[Group]] position of the [[group]] [[leader]] is used |Parameter 4=
|p5= markers: [[Array]] - Placement markers |Parameter 5=
|p6= placement: [[Number]] - Placement radius |Parameter 6=
|p7= special: [[String]] - Unit placement special, one of:
* <tt>"NONE"</tt> - The unit will be created at the first available free position nearest to given position
* <tt>"FORM"</tt> - Not implemented, currently functions the same as "NONE".
* <tt>"CAN_COLLIDE"</tt> - The unit will be created exactly at passed position
* <tt>"CARGO"</tt> - The unit will be created in cargo of the group's vehicle, regardless of the passed position (see Example 5). If group has no vehicle or there is no cargo space available, the unit will be placed according to <tt>"NONE"</tt>. To check available cargo space use:<code>_hasCargo = _veh [[emptyPositions]] "CARGO" > 0;</code> |Parameter 7=


| [[Object]] - The created unit |Return value=
|arg= local


|s2= type [[createUnit]] [position, group, init, skill, rank] |Syntax2=
|eff= global


|p21= type: [[String]] - Class name of unit to be created as per [[CfgVehicles]] |Parameter 21=
|gr1= Object Manipulation
|p22= [position, group, init, skill, rank]: [[Array]] |Parameter 22=
|p23= position: [[Position]], [[Position2D]], [[Object]] or [[Group]] - Location unit is created at. In case of [[Group]] position of the [[group]] [[leader]] is used |Parameter 23=
|p24= group: [[Group]] - Existing group new unit will join |Parameter 24=
|p25= init: [[String]] - (Optional, default "") Unit init statement, similar to unit init field in the editor. The code placed in unit init will run upon unit creation for every client on network, present and future. The code itself receives the reference to the created unit via local variable [[this]]. Avoid using global commands in unit init statement as it already runs on every client. |Parameter 25=
|p26= skill: [[Number]] - (Optional, default 0.5) Unit [[skill]] |Parameter 26=
|p27= rank: [[String]] - (Optional, default "PRIVATE") Unit [[rank]] |Parameter 27=


|r2= {{Warning|'''[[Nothing]]''' - This syntax does NOT return a unit reference! In order to reference this unit, you can use {{Inline code|newUnit {{=}} this}} in the ''init'' field.<br>
|descr= Create a unit of the provided [[:Category:CfgVehicles|CfgVehicles]] class.
If the target group is not local, the init script will only execute after a slight delay; see [[User:Killzone_Kid|Killzone_Kid]]'s note below for more information and issues about this syntax.}} |Return value 2=


|x1= <code>_unit = [[group]] [[player]] [[createUnit]] ["B_RangeMaster_F", [[position]] [[player]], [], 0, "FORM"];</code>|Example 1=
{{Feature|warning|
|x2= <code>"B_RangeMaster_F" [[createUnit]] [<nowiki/>[[position]] [[player]], [[group]] [[player]]];</code> |Example 2=
The unit will not be created if the passed group does not exist (a.k.a [[grpNull]]);
|x3= <code>"B_RangeMaster_F" [[createUnit]] [<nowiki/>[[getMarkerPos]] "barracks", _groupAlpha];</code> |Example 3=
this can happen if [[createGroup]] fails because the '''group limit has been reached''' (see [[createGroup]] for respective game limits).
|x4= <code>"B_RangeMaster_F" [[createUnit]] [
}}
[[getMarkerPos]] "marker_1",
 
{{{!}} class="wikitable" style="width: 100%"
!
! style="width: 50%" {{!}} {{Link|#Syntax 1}}
! style="width: 50%" {{!}} {{Link|#Syntax 2}}
{{!}}-
! Group's&nbsp;locality
{{!}} the provided group ''can'' be non-[[Multiplayer Scripting#Locality|local]], but a warning will be logged
{{!}} the provided group '''must''' be [[Multiplayer Scripting#Locality|local]]
{{!}}-
! Unit's [[side]]
{{!}} using a classname from a different side than the provided group will result in the unit itself being of a (config-defined) side inside a group of another side - see {{Link|#Example 6}} for more information
{{!}} using a classname from a different side than the provided group will result in the unit being of the same side as the provided group
{{!}}-
! Other
{{!}} the unit's init code will execute after a slight delay if the provided group is not local
{{!}} this syntax does '''not''' return a reference to the created unit (see {{Link|#Example 7}})
{{!}}}
 
{{Feature|arma1|
{{GVI|ofp|1.34}} {{GVI|arma1|1.00}} This command was sometimes bugged in {{ofp}} or {{arma1}}; an additional [[join]] may solve the problem.<br>
However, some commands such as [[setUnitPos]] only work if run before the [[join]].
}}
 
|mp= It is recommended to create the unit where the group is '''[[Multiplayer Scripting#Locality|local]]''' - use [[remoteExec]] if needed.
 
|s1= group [[createUnit]] [type, position, markers, placement, special]
 
|p1= group: [[Group]] - existing group new unit will join; if the group is not [[local]], a warning will be logged
 
|p2= type: [[String]] - classname of unit to be created as per [[CfgVehicles]]
 
|p3= position: [[Object]], [[Group]] or [[Array]] format [[Position]] or [[Position#Introduction|Position2D]] - location where to create the unit. In case of [[Group]], the [[group]] [[leader]]'s position is used
 
|p4= markers: [[Array]] - placement markers
 
|p5= placement: [[Number]] - placement radius
 
|p6= special: [[String]] - unit placement special, one of:
* {{hl|"NONE"}} - The unit will be created at the first available free position nearest to given position
* {{hl|"FORM"}} - Not implemented, currently functions the same as "NONE"
* {{hl|"CAN_COLLIDE"}} - The unit will be created exactly at the provided position
* {{hl|"CARGO"}} - The unit will be created in cargo of the group's vehicle, regardless of the passed position (see {{Link|#Example 5}}).<!--
--> If group has no vehicle or there is no cargo space available, the unit will be placed according to {{hl|"NONE"}}.<!--
--> {{hl|"CARGO"}} placement excludes cargo positions with personal FFV turrets. To check available cargo space use:
{{{!}} style="width: 100%"
! {{GVI|arma3|1.34}} FFV
{{!}} <sqf>private _hasCargo = { isNull (_x select 0) } count (fullCrew [_veh, "cargo", true]) > 0;</sqf>
{{!}}-
! before
{{!}} <sqf>_hasCargo = _veh emptyPositions "CARGO" > 0;</sqf>
{{!}}}
 
|r1= [[Object]] - the created unit
 
|s2= type [[createUnit]] [position, group, init, skill, rank]
 
|p21= type: [[String]] - classname of unit to be created as per [[CfgVehicles]]
 
|p22= position: [[Object]], [[Group]] or [[Array]] format [[Position]] or [[Position#Introduction|Position2D]] - location at which the unit is created. In case of [[Group]] position of the [[group]] [[leader]] is used
 
|p23= group: [[Group]] - existing group the new unit will join
 
|p24= init: [[String]] - (Optional, default "") unit init statement, similar to unit init field in the editor. The code placed in unit init will run upon unit creation for every client on network, present and future.
The code itself receives the reference to the created unit via local variable [[Magic Variables#this_2|this]].
{{Feature|warning|
* Do not use global effect commands in a unit's ''init'' as it runs on every client (local effect ones are OK, e.g [[setIdentity]]).
* Do not use local variables inside the init code as they are not available in multiplayer.}}
 
|p25= skill: [[Number]] - (Optional, default 0.5) unit [[skill]]
 
|p26= rank: [[String]] - (Optional, default "PRIVATE") unit [[rank]]
 
|r2= {{Feature|warning|'''[[Nothing]]''' - this syntax does '''not''' return a unit reference! See {{Link|#Example 7}} for a workaround.}}
 
|x1= <sqf>_unit = group player createUnit ["B_RangeMaster_F", position player, [], 0, "NONE"];</sqf>
 
|x2= <sqf>"B_RangeMaster_F" createUnit [position player, group player];</sqf>
 
|x3= <sqf>"B_RangeMaster_F" createUnit [getMarkerPos "barracks", _groupAlpha];</sqf>
 
|x4= <sqf>
"B_RangeMaster_F" createUnit [
getMarkerPos "marker_1",
_groupAlpha,
_groupAlpha,
"loon1 = [[this]]; [[this]] [[addWeapon]] 'BAF_L85A2_RIS_SUSAT'",
"loon1 = this; this addWeapon 'BAF_L85A2_RIS_SUSAT'",
0.6,
0.6,
"corporal"
"corporal"
];</code> |Example 4=
];
</sqf>
 
|x5= <!-- referenced in parameters (p6) -->
<sqf>
_veh = "O_Quadbike_01_F" createVehicle (player getRelPos [10, 0]);
_grp = createVehicleCrew _veh;
_unit = _grp createUnit [typeOf driver _veh, _grp, [], 0, "CARGO"];
</sqf>
 
|x6= <!-- referenced in the description -->Creating a unit from a different side may lead to issues:
<sqf>
_grp = createGroup east;
hint str side _grp; // EAST
_ap = _grp createUnit ["C_man_p_beggar_F", position player, [], 0, "NONE"];
hint str side _ap; // CIV, not EAST


|x5= <code>_veh = "O_Quadbike_01_F" [[createVehicle]] ([[player]] [[getRelPos]] [10, 0]);
// workaround
_grp = [[createVehicleCrew]] _veh;
[_ap] joinSilent _grp;
_unit = _grp [[createUnit]] [<nowiki/>[[typeOf]] [[driver]] _veh, _grp, [], 0, "CARGO"];</code>|Example 5=
hint str side _ap; // EAST
</sqf>


| [[createCenter]], [[createGroup]], [[createVehicle]], [[setVehiclePosition]], [[create3DENEntity]] |See also=
|x7= <!-- referenced in alternative result (r2) -->
}}
Reference the created unit through a global variable:
<sqf>
_myUnit = "B_RangeMaster_F" createUnit [position player, group player]; // wrong - this syntax does not return a reference


[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
"B_RangeMaster_F" createUnit [position player, group player, "myUnit = this"]; // correct - the unit is myUnit (NOT _myUnit!)
[[Category:Scripting Commands OFP 1.46|{{uc:{{PAGENAME}}}}]]
</sqf>
[[Category:Scripting Commands OFP 1.96|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
{{GameCategory|arma1|Scripting Commands}}
{{GameCategory|arma2|Scripting Commands}}
{{GameCategory|tkoh|Scripting Commands}}
{{GameCategory|arma3|Scripting Commands}}


<h3 style="display:none">Notes</h3>
|seealso= [[createCenter]] [[createGroup]] [[createVehicle]] [[setVehiclePosition]] [[create3DENEntity]]
<dl class="command_description">
}}
<!-- Note Section BEGIN -->
<dd class="notedate">Posted on 27th Nov 2016
<dt class="note">[[User:Ffur2007slx2_5|Ffur2007slx2_5]]
<dd class="note">
{{GVI|arma3|1.64}} The side of the created unit by this command uses its config's side and not the side of a passed empty group created by [[createGroup]]:
<code>_grp = [[createGroup]] [[east]];
[[hint]] [[str]] [[side]] _grp; {{codecomment|// EAST}}
_ap = _grp [[createUnit]] [ "C_man_p_beggar_F", [[position]] [[player]], [], 0, "FORM"];
[[hint]] [[str]] [[side]] _ap; {{codecomment|// CIV, not EAST}}</code>
We can use [[join]] command or fill the _grp with entities in advance to set _ap to the desired side.


<dd class="notedate">Posted on 8th Dec 2018
{{Note
<dt class="note">[[User:oOKexOo|oOKexOo]]
|user= oOKexOo
<dd class="note">
|timestamp= 20181208215700
Since {{GVI|arma3|1.86}}: If you want to place a module with [[createUnit]], you have to ensure that the module gets activated automatically by setting '''[[BIS_fnc_initModules]]_disableAutoActivation''' to [[false]], ''e.g'':
|text= Since {{GVI|arma3|1.86}}: If you want to place a module with [[createUnit]], you have to ensure that the module gets activated automatically by setting '''[[BIS_fnc_initModules]]_disableAutoActivation''' to [[false]], ''e.g'':
<code>[[private]] _grp = [[createGroup]] [[sideLogic]];
<sqf>
"ModuleSmokeWhite_F" [[createUnit]] [
private _grp = createGroup sideLogic;
[[getPos]] [[player]],
"ModuleSmokeWhite_F" createUnit [
getPos player,
_grp,
_grp,
"[[this]] [[setVariable]] ['BIS_fnc_initModules_disableAutoActivation', [[false]], [[true]]];"
"this setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];"
];</code>
];
</sqf>
}}


<dd class="notedate">Posted on 18th Mar 2019
{{Note
<dt class="note">[[User:Killzone_Kid|Killzone_Kid]]
|user= Killzone_Kid
<dd class="note">
|timestamp= 20190318193100
Alt Syntax is the older syntax and differs in functionality from the main, newer syntax. The main difference is that the older syntax '''does not''' return unit reference. This is because the unit created with Alt Syntax is created strictly where passed [[group]] is [[local]]. This means that if the group is remote the unit will be created on the different client than the one the command was executed on and therefore it is not possible to return created unit reference immediately. In contrast, the newer syntax allows creating units in remote groups while returning unit reference immediately, which could be unsafe and the appropriate warning is logged into ''.rpt'' file: <tt>Warning: Adding units to a remote group is not safe. Please use [[setGroupOwner]] to change the group owner first.</tt><br><br>
|text= Alt Syntax is the older syntax and differs in functionality from the main, newer syntax. The main difference is that the older syntax '''does not''' return unit reference.
Another very important difference is that the older syntax (Alt Syntax) will create unit of the same [[side]] as the side of the [[group]] passed as argument. For example, if the group is WEST and the unit faction is OPFOR of type, say <tt>"O_Soldier_GL_F"</tt>, the unit created will be on the WEST side as well. In contrast, newer syntax will create the same unit on the EAST side in the WEST group, which will be treated as hostile by other group members and eliminated.<br><br>
This is because the unit created with Alt Syntax is created strictly where passed [[group]] is [[Multiplayer Scripting#Locality|local]].
{{Warning | Beware that in MP if unit is created in remote group with older syntax, the unit init will execute on calling client sometime in the future, after the unit is created on remote client, therefore the following code will fail:
This means that if the group is remote the unit will be created on the different client than the one the command was executed on and therefore it is not possible to return created unit reference immediately.
{{codecomment|// Real example of the bad code}}
In contrast, the newer syntax allows creating units in remote groups while returning unit reference immediately, which could be unsafe and the appropriate warning is logged into ''.rpt'' file: {{hl|Warning: Adding units to a remote group is not safe. Please use [[setGroupOwner]] to change the group owner first.}}<br><br>
"O_Soldier_AR_F" [[createUnit]] [<nowiki/>[[position]] [[player]], someRemoteGroup, "thisUnit {{=}} this"];
Another very important difference is that the older syntax (Alt Syntax) will create unit of the same [[side]] as the side of the [[group]] passed as argument.
[[publicVariable]] "thisUnit";
For example, if the group is WEST and the unit faction is OPFOR of type, say {{hl|"O_Soldier_GL_F"}}, the unit created will be on the WEST side as well.
[[hint]] [[str]] [[isNil]] "thisUnit"; {{codecomment|// [[true]]!
In contrast, newer syntax will create the same unit on the EAST side in the WEST group, which will be treated as hostile by other group members and eliminated.
// The unit reference is [[nil]] because init statement has not been executed on this client yet.}}
{{Feature|warning|
Beware that in MP if unit is created in remote group with older syntax, the unit init will execute on calling client sometime in the future, after the unit is created on remote client, therefore the following code will fail:
<sqf>
// real example of the bad code
"O_Soldier_AR_F" createUnit [position player, someRemoteGroup, "thisUnit = this"];
publicVariable "thisUnit";
hint str isNil "thisUnit"; // true!
// the unit reference is nil because init statement has not been executed on this client yet
</sqf>
}}
}}
}}
<!-- Note Section END -->
</dl>


<!-- CONTINUE Notes -->
{{Note
<dl class="command_description">
|user= fusselwurm
<dd class="notedate">Posted on June 19, 2020 - 10:13 (UTC)</dd>
|timestamp= 20200619101300
<dt class="note">[[User:fusselwurm|fusselwurm]]</dt>
|text= {{GVI|arma3|1.98}} note that even when setting the ''placement special'' parameter to "NONE", 3DEN-placed objects are being ignored when looking for a free position.
<dd class="note">
In other words: units will spawn within editor-placed rocks or under houses.
{{GVI|arma3|1.98}} note that even when setting the ''placement special'' parameter to "NONE", 3DEN-placed objects are being ignored when looking for a free position. In other words: units will spawn within editor-placed rocks or under houses.
}}
</dd>
</dl>
<!-- DISCONTINUE Notes -->

Latest revision as of 09:27, 22 October 2024

Hover & click on the images for description

Description

Description:
Create a unit of the provided CfgVehicles class.
The unit will not be created if the passed group does not exist (a.k.a grpNull); this can happen if createGroup fails because the group limit has been reached (see createGroup for respective game limits).
Syntax 1 Syntax 2
Group's locality the provided group can be non-local, but a warning will be logged the provided group must be local
Unit's side using a classname from a different side than the provided group will result in the unit itself being of a (config-defined) side inside a group of another side - see Example 6 for more information using a classname from a different side than the provided group will result in the unit being of the same side as the provided group
Other the unit's init code will execute after a slight delay if the provided group is not local this syntax does not return a reference to the created unit (see Example 7)
Armed Assault
Logo A0.png1.34 Logo A1 black.png1.00 This command was sometimes bugged in Operation Flashpoint or Armed Assault; an additional join may solve the problem.
However, some commands such as setUnitPos only work if run before the join.
Multiplayer:
It is recommended to create the unit where the group is local - use remoteExec if needed.
Groups:
Object Manipulation

Syntax

Syntax:
group createUnit [type, position, markers, placement, special]
Parameters:
group: Group - existing group new unit will join; if the group is not local, a warning will be logged
type: String - classname of unit to be created as per CfgVehicles
position: Object, Group or Array format Position or Position2D - location where to create the unit. In case of Group, the group leader's position is used
markers: Array - placement markers
placement: Number - placement radius
special: String - unit placement special, one of:
  • "NONE" - The unit will be created at the first available free position nearest to given position
  • "FORM" - Not implemented, currently functions the same as "NONE"
  • "CAN_COLLIDE" - The unit will be created exactly at the provided position
  • "CARGO" - The unit will be created in cargo of the group's vehicle, regardless of the passed position (see Example 5). If group has no vehicle or there is no cargo space available, the unit will be placed according to "NONE". "CARGO" placement excludes cargo positions with personal FFV turrets. To check available cargo space use:
Arma 3 logo black.png1.34 FFV
private _hasCargo = { isNull (_x select 0) } count (fullCrew [_veh, "cargo", true]) > 0;
before
_hasCargo = _veh emptyPositions "CARGO" > 0;
Return Value:
Object - the created unit

Alternative Syntax

Syntax:
type createUnit [position, group, init, skill, rank]
Parameters:
type: String - classname of unit to be created as per CfgVehicles
position: Object, Group or Array format Position or Position2D - location at which the unit is created. In case of Group position of the group leader is used
group: Group - existing group the new unit will join
init: String - (Optional, default "") unit init statement, similar to unit init field in the editor. The code placed in unit init will run upon unit creation for every client on network, present and future. The code itself receives the reference to the created unit via local variable this.
  • Do not use global effect commands in a unit's init as it runs on every client (local effect ones are OK, e.g setIdentity).
  • Do not use local variables inside the init code as they are not available in multiplayer.
skill: Number - (Optional, default 0.5) unit skill
rank: String - (Optional, default "PRIVATE") unit rank
Return Value:
Nothing - this syntax does not return a unit reference! See Example 7 for a workaround.

Examples

Example 1:
_unit = group player createUnit ["B_RangeMaster_F", position player, [], 0, "NONE"];
Example 2:
"B_RangeMaster_F" createUnit [position player, group player];
Example 3:
"B_RangeMaster_F" createUnit [getMarkerPos "barracks", _groupAlpha];
Example 4:
"B_RangeMaster_F" createUnit [ getMarkerPos "marker_1", _groupAlpha, "loon1 = this; this addWeapon 'BAF_L85A2_RIS_SUSAT'", 0.6, "corporal" ];
Example 5:
_veh = "O_Quadbike_01_F" createVehicle (player getRelPos [10, 0]); _grp = createVehicleCrew _veh; _unit = _grp createUnit [typeOf driver _veh, _grp, [], 0, "CARGO"];
Example 6:
Creating a unit from a different side may lead to issues:
_grp = createGroup east; hint str side _grp; // EAST _ap = _grp createUnit ["C_man_p_beggar_F", position player, [], 0, "NONE"]; hint str side _ap; // CIV, not EAST // workaround [_ap] joinSilent _grp; hint str side _ap; // EAST
Example 7:
Reference the created unit through a global variable:
_myUnit = "B_RangeMaster_F" createUnit [position player, group player]; // wrong - this syntax does not return a reference "B_RangeMaster_F" createUnit [position player, group player, "myUnit = this"]; // correct - the unit is myUnit (NOT _myUnit!)

Additional Information

See also:
createCenter createGroup createVehicle setVehiclePosition create3DENEntity

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
oOKexOo - c
Posted on Dec 08, 2018 - 21:57 (UTC)
Since Arma 3 logo black.png1.86: If you want to place a module with createUnit, you have to ensure that the module gets activated automatically by setting BIS_fnc_initModules_disableAutoActivation to false, e.g:
private _grp = createGroup sideLogic; "ModuleSmokeWhite_F" createUnit [ getPos player, _grp, "this setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];" ];
Killzone_Kid - c
Posted on Mar 18, 2019 - 19:31 (UTC)
Alt Syntax is the older syntax and differs in functionality from the main, newer syntax. The main difference is that the older syntax does not return unit reference. This is because the unit created with Alt Syntax is created strictly where passed group is local. This means that if the group is remote the unit will be created on the different client than the one the command was executed on and therefore it is not possible to return created unit reference immediately. In contrast, the newer syntax allows creating units in remote groups while returning unit reference immediately, which could be unsafe and the appropriate warning is logged into .rpt file: Warning: Adding units to a remote group is not safe. Please use setGroupOwner to change the group owner first.

Another very important difference is that the older syntax (Alt Syntax) will create unit of the same side as the side of the group passed as argument. For example, if the group is WEST and the unit faction is OPFOR of type, say "O_Soldier_GL_F", the unit created will be on the WEST side as well. In contrast, newer syntax will create the same unit on the EAST side in the WEST group, which will be treated as hostile by other group members and eliminated.
Beware that in MP if unit is created in remote group with older syntax, the unit init will execute on calling client sometime in the future, after the unit is created on remote client, therefore the following code will fail:
// real example of the bad code "O_Soldier_AR_F" createUnit [position player, someRemoteGroup, "thisUnit = this"]; publicVariable "thisUnit"; hint str isNil "thisUnit"; // true! // the unit reference is nil because init statement has not been executed on this client yet
fusselwurm - c
Posted on Jun 19, 2020 - 10:13 (UTC)
Arma 3 logo black.png1.98 note that even when setting the placement special parameter to "NONE", 3DEN-placed objects are being ignored when looking for a free position. In other words: units will spawn within editor-placed rocks or under houses.