createUnit array: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (fixed desc, sort of fixed example.)
Line 8: Line 8:


| Create unit of given type.
| 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.  
Format of unitInfo is: [pos ([[Position]]), group ([[Group]]),init ([[Code]]), skill ([[Number]]), rank ([[String]])]  
Examples: "soldierWB" createUnit [ [[getMarkerPos]] "barracks", groupAlpha]
 
"soldierWB" createUnit [ [[getMarkerPos]] "marker_1", groupAlpha, {loon1 = this ; this [[addWeapon]] "binocular"}, 0.6, "corporal"] |= Description
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. |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________
 
|
| type '''createUnit''' unitInfo |= Syntax
| type '''createUnit''' unitInfo |= Syntax


Line 21: Line 23:
| [[Nothing]] |= Return value
| [[Nothing]] |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________
 
|x1 = <code> "soldierWB" createUnit [ [[getMarkerPos]] "barracks", groupAlpha]
"soldierWB" createUnit [ [[getMarkerPos]] "marker_1", groupAlpha, {loon1 <nowiki>=</nowiki> this ; this [[addWeapon]] "binocular"}, 0.6, "corporal"] </code>
|  |= See also
|  |= See also



Revision as of 05:17, 7 August 2006

Hover & click on the images for description

Description

Description:
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.
Groups:
Uncategorised

Syntax

Syntax:
Syntax needed
Parameters:
type: String
unitInfo: Array
Return Value:
type createUnit unitInfo

Examples

Example 1:
"soldierWB" createUnit [ getMarkerPos "barracks", groupAlpha] "soldierWB" createUnit [ getMarkerPos "marker_1", groupAlpha, {loon1 = this ; this addWeapon "binocular"}, 0.6, "corporal"]

Additional Information

See also:
Nothing

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