createUnit array: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (createUnit group moved to createUnit array: analogous createVehicle array)
m (updated.)
Line 2: Line 2:
____________________________________________________________________________________________
____________________________________________________________________________________________


| ofp |= Game name
| arma |= Game name


|1.34|= Game version
|2.32|= Game version
____________________________________________________________________________________________
____________________________________________________________________________________________


| Create unit of given type.
| 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. If the markers array contains several marker names, the position of a random one is used. Otherwise, the given position is used. 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".  |= Description
____________________________________________________________________________________________
|
| group createUnit [type, position, markers, placement, special] |= Syntax


Format of unitInfo is: [pos ([[Position]]), group ([[Group]]),init ([[Code]]), skill ([[Number]]), rank ([[String]])]
|p1= group: [[Group]] |= Parameter 1


Note: init, skill and rank are optional, default values are: "", 0.5, "PRIVATE".
|p2= type: [[String]] |= Parameter 2


Note: The [[Group]] parameter MUST be an existing group or the unit won't be created.  |= Description
|p3= pos: [[Array]] |= Parameter 3
____________________________________________________________________________________________
 
|  
|p4= markers: [[Array]] |= Parameter 4
| type '''createUnit''' unitInfo |= Syntax


|p1= type: [[String]] |= Parameter 1
|p5= placement: [[Number]] |= Parameter 5


|p2= unitInfo: [[Array]] |= Parameter 2
|p6= special: [[String]] |= Parameter 6


| [[Nothing]] |= Return value
| [[Object]] |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________
|x1 = <code>"soldierWB" '''createUnit''' [ [[getMarkerPos]] "barracks", groupAlpha]
|x1 = <code> unit <nowiki>=</nowiki> group [[player]] createUnit ["SoldierWB", [[position]] [[player]], [], 0, "FORM"]   </code>
"soldierWB" '''createUnit''' [ [[getMarkerPos]] "marker_1", groupAlpha,<br /> {loon1 <nowiki>=</nowiki> this ; this [[addWeapon]] "binocular"}, 0.6, "corporal"] </code>
|  |= See also
|  |= See also



Revision as of 13:42, 13 August 2006

-wrong parameter ("Arma") defined!-2.32
Hover & click on the images for description

Description

Description:
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. If the markers array contains several marker names, the position of a random one is used. Otherwise, the given position is used. 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".
Groups:
Uncategorised

Syntax

Syntax:
Syntax needed
Parameters:
group: Group
type: String
pos: Array
markers: Array
placement: Number
special: String
Return Value:
group createUnit [type, position, markers, placement, special]

Examples

Example 1:
unit = group player createUnit ["SoldierWB", position player, [], 0, "FORM"]

Additional Information

See also:
Object

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