createAgent: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
 
mNo edit summary
Line 3: Line 3:




<h2 style="color:#000066">'''''createAgent ''[type, position, markers, placement, special]: Array'''''</h2>
<h2 style="color:#000066">'''createAgent ''[type, position, markers, placement, special]: Array'''''</h2>




Line 20: Line 20:
'''Description:'''
'''Description:'''


Creates an (independent) agent (person) of the given type (type is a name of a subclass of CfgVehicles). 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".
Creates an (independent) agent (person) of the given '''type''' (type is a name of a subclass of CfgVehicles).
 
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".
 


'''Example''':
'''Example''':
      
      
agent = '''createAgent''' ["SoldierWB", position player, [], 0, "FORM"]
agent = '''createAgent''' ["SoldierWB", position player, [], 0, "FORM"]

Revision as of 01:59, 6 July 2006


createAgent [type, position, markers, placement, special]: Array


Operand types:

[type, position, markers, placement, special]: Array

Type of returned value:

Object

Compatibility:

Version 2.89 required.

Description:

Creates an (independent) agent (person) of the given type (type is a name of a subclass of CfgVehicles).

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".


Example:

agent = createAgent ["SoldierWB", position player, [], 0, "FORM"]