Fandom

武装突袭 Wiki

NearestObject

简体 | 繁體

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

您使用了广告屏蔽软件!


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

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

Introduced with Operation Flashpoint version 1.00
  

点击图片可看到更多讯息

开始使用于

游戏:
Operation Flashpoint
版本:
1.00

描述

描述:
Returns the nearest object of given type to given position within a sphere. Hardcoded radius is 50 meters. Unlike with nearestObjects, where distance is measured in 2D space, nearestObject will be closest object in 3D space.

If object class type is used, any object derived from the type is found as well (In OFP however, only objects with exactly the type given are found). If object ID passed as an argument (as in example 2) the search range is unlimited.

基本句法

句法:
nearestObject [position, type]
参数:
[position, type]: Array

position: Position3D or Position2D or Object - position to start search at

type: String - type of object (see typeOf, class type)
返回值:
Object - Nearest object, objNull otherwise

替代句法

句法:
nearestObject position
参数:
position: Position3D or Position2D or Object - position to start search at
返回值:
Object - Nearest object, objNull otherwise

替代句法2

句法:
position nearestObject type
参数:
position: Position3D or Position2D - position to start search at

type: String - type of object (see typeOf, class type)
返回值:
Object - Nearest object, objNull otherwise

替代句法3

句法:
position nearestObject id
参数:
position: Position3D or Position2D - position to start search at

id: Number - object Visitor id
返回值:
Object - Nearest object, objNull otherwise

范例

范例1:
_nObject = nearestObject [2345,6789]; _nObject = nearestObject [player, "StreetLamp"];

范例2:
Return the object with ID 123456:_nObject = [0,0,0] nearestObject 123456;

范例3:
_nObject = getPos player nearestObject "StreetLamp";

范例4:
Return the nearest object with (typeOf _nObject == "#XXXX") -> #mark, #slop, etc. Unlimited search range:_nObject = _position nearestObject -1; Return the nearest object with (typeOf _nObject != ""). Search range is 50m: _nObject = nearestObject _position;

范例5:
_blood = nearestObject [player, "#slop"]; _step = nearestObject [player, "#mark"]; _track = nearestObject [player, "#track"]; _crater = nearestObject [player, "#crater"];

额外资讯

多人游戏:
-
也可以看看:

nearestObjectsnearObjectsReadynearObjectsobjectFromNetIdnearEntitiesentitiesobject

注意事项

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

Notes

Bottom Section

更多维基

随机维基