createUnit: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 34: Line 34:
'''Examples:'''
'''Examples:'''


"soldierWB" '''createUnit''' [ [[getMarkerPos]] "barracks", groupAlpha]
"soldierWB" '''createUnit''' [ [[getMarkerPos]] "barracks", groupAlpha]<br>
"soldierWB" '''createUnit''' [ [[getMarkerPos]] "marker_1", groupAlpha, "loon1 = '''this''' ; '''this''' [[addweapon]] {binocular}, 0.6, "corporal"]
"soldierWB" '''createUnit''' [ [[getMarkerPos]] "marker_1", groupAlpha, "loon1 = '''this''' ; '''this''' [[addweapon]] {binocular}, 0.6, "corporal"]

Revision as of 17:40, 16 April 2006

back to COMREF

type creatUnit unitInfo


Operand types:

type: String

unitInfo: Array

Type of returned value:

Nothing

Compatibility:

Added in version 1.34

Description:

Create unit of given type. Format of unitInfo is:

[pos (Position), group (Group),init (String), 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"]