createUnit array: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
Line 1: Line 1:
[[Category:Scripting Commands|CREATEUNITGROUP]]
{{Command|= Comments
[[Category:Scripting Commands ArmA|CREATEUNITGROUP]]
____________________________________________________________________________________________


| ofp |= Game name


<h2 style="color:#000066">'''''group'' createUnit ''[type, position, markers, placement, special]'''''</h2>
|1.34|= Game version
____________________________________________________________________________________________


| Create unit of given type.
Format of unitInfo is: [pos ([[Position]]), group ([[Group]]),init ([[Code]]), skill ([[Number]]), rank ([[String]])] Note: init, skill and rank are optional, default values are: "", 0.5, "PRIVATE". Note: The [[Group]] parameter MUST be an existing group or the unit won't be created.
Examples: "soldierWB" createUnit [ [[getMarkerPos]] "barracks", groupAlpha]
"soldierWB" createUnit [ [[getMarkerPos]] "marker_1", groupAlpha, {loon1 = this ; this [[addWeapon]] "binocular"}, 0.6, "corporal"] |= Description
____________________________________________________________________________________________


'''Operand types:'''
| type '''createUnit''' unitInfo |= Syntax


'''group:''' [[Group]]
|p1= type: [[String]] |= Parameter 1


'''[type, position, markers, placement, special]:''' [[Array]]
|p2= unitInfo: [[Array]] |= Parameter 2


'''Type of returned value:'''
| [[Nothing]] |= Return value
____________________________________________________________________________________________


[[Object]]
|  |= See also


'''Compatibility:'''
}}


Version 2.32 required.
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->


'''Description:'''
<!-- Note Section END -->
</dl>


Creates a unit (person) of the given '''type''' (type is a name of a subclass of CfgVehicles) and makes it a member of the given '''group'''.
<h3 style="display:none">Bottom Section</h3>


If the '''markers''' array contains several marker names, the position of a random one is used, otherwise, the given '''position''' is used.
[[Category:Scripting Commands|CREATEUNITGROUP]]
 
[[Category:Scripting Commands ArmA|CREATEUNITGROUP]]
The unit is placed inside a circle with this position as its center and '''placement''' as its radius.
 
'''Special''' properties can be: "NONE" and "FORM".
 
 
'''Example:'''
 
unit = [[group]] [[player]] '''createUnit''' ["SoldierWB", [[position]] [[player]], [], 0, "FORM"]

Revision as of 00:09, 2 August 2006

Hover & click on the images for description

Description

Description:
type createUnit unitInfo
Groups:
Uncategorised

Syntax

Syntax:
Nothing
Parameters:
type: String
unitInfo: Array
Return Value:
Return value needed

Examples

Examples:
Example needed

Additional Information

See also:
See also needed

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

Notes

Bottom Section