- Operation Flashpoint
- Create unit of a class that's defined in CfgVehicles.
The Group parameter MUST be an existing group or the unit won't be created.
- type createUnit [ position, group, init, skill, rank]
- type: String - Classname of unit to be created as per cfgVehicles
- [ position, group, init, skill, rank]: Array
- position: Position, Position2D or Object - Location unit is created at.
- group: Group - Existing group new unit will join.
- init: String - (optional, default "") Command to be executed upon creation of unit. Parameter this is set to the created unit and passed to the code.
- skill: Number - (optional, default 0.5)
- rank: String - (optional, default "PRIVATE")
"SoldierWB" createUnit [ position player, group player ];
"soldierWB" createUnit [ getMarkerPos "barracks", _groupAlpha];
"soldierWB" createUnit [ getMarkerPos "marker_1", _groupAlpha,"loon1 = this;
this addWeapon 'BAF_L85A2_RIS_SUSAT'", 0.6, "corporal"];
- The code in init is executed on all connected clients in multiplayer. It can therefore be used to get around the publicVariable limitation of not being able to send strings and arrays over the network.
- createUnit arraycreateCentercreateGroupcreateVehiclesetVehiclePosition
- Posted on August 13, 2006 - 12:32
- To give a newly created unit a name, put "newUnit = this" in the init field.
- Posted on 18:41, 5 April 2007 (CEST)
- The eventhandlers added with addEventHandler in the init parameter will only fire locally on the machine where this creation command is called from.
- Posted on December 24, 2007 - 00:33
- If you do not wish it to be in a group, you can create a gamelogic and group it to that.
Note: The unit will deny to move away from the gamelogic.