Fandom

武装突袭 Wiki

CreateUnit

简体 | 繁體

4,827个页面创建
于此维基上
添加新页面
评论0 分享

您使用了广告屏蔽软件!


Wikia通过广告运营为用户提供免费的服务。我们对用户通过嵌入广告屏蔽软件访问网站进行了使用调整。

如果您使用了广告屏蔽软件,将无法使用我们的服务。请您移除广告屏蔽软件,以确保页面正常加载。

Introduced with Operation Flashpoint version 1.34
  Effects of this scripting command are broadcasted over the network and happen on every computer in the network

点击图片可看到更多讯息

开始使用于

游戏:
Operation Flashpoint
版本:
1.34

描述

描述:
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")
返回值:
Nothing

范例

范例1:
"SoldierWB" createUnit [ position player, group player ];

范例2:
"soldierWB" createUnit [ getMarkerPos "barracks", _groupAlpha];

范例3:
"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

注意事项

此处撰写句法皆为可行用法. 可到官网[1]专页回报错误. 你可以使用讨论页面或是论坛来进行讨论.
新增注意事项 | 如何新增?

Notes

Posted on August 13, 2006 - 12:32
raedor
To give a newly created unit a name, put "newUnit = this" in the init field.
Posted on 18:41, 5 April 2007 (CEST)
Shuko
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
MulleDK13
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.

Bottom Section

Posted on August 27, 2015 - 02:25 (UTC)
Austin medic
In order to solve the above problem you can simply group it to the game logic as stated, then group it to grpNull

e.g myUnit join myGroupLogic; myUnit join grpNull

更多维基

随机维基