Fandom

武装突袭 Wiki

SelectBestPlaces

简体 | 繁體

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

您使用了广告屏蔽软件!


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

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

  

点击图片可看到更多讯息

开始使用于

游戏:
Arma 2
版本:
1.00

描述

描述:
Find the places with the maximum value of expression in the given area. Places can be on water. Results are sorted by value. Search pattern is randomised every command execution.

基本句法

句法:
selectBestPlaces [position, radius, expression, precision, sourcesCount]
参数:
[position, radius, expression, precision, sourcesCount]: Array -

position: Object, Position3D or Position2D

radius: Number

expression: String - Arithmetic expression. Simple expression var names containing values from 0 to 1 depending on location (see also Ambient Parameters):

  • forest
  • trees
  • meadow
  • hills
  • houses
  • sea
  • night
  • rain
  • windy
  • deadBody
  • waterDepth
  • camDepth

precision: Number

sourcesCount: Number - max results to return
返回值:
Array - in Format [[position: Position2D, expressionResult: Number], ...]

范例

范例1:
myPlaces = selectBestPlaces [position player, 50, "meadow + 2*hills", 1, 5];

额外资讯

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

Ambient ParametersfindEmptyPositionisFlatEmpty

注意事项

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

Notes

Posted on Jul 17, 2010 - 18:39
Rübe
see http://forums.bistudio.com/showthread.php?t=93897 for some more information (though neither official, nor complete). The most important information is the list of useable keywords for the expression which is: forest, trees, meadow, hills, houses, sea, night, rain, windy and deadBody. The keyword will be replaced by the actual value at the given sample position and thus the expression gets evaluated. For example the following expression (which returns high values in forest) "forest + trees - meadow - houses - (10 * sea)" might be transformed to 0 + 0.1 - 0.7 - 0 - (10 * 0) which is - with it's result of -0.6 - not in the forest, though there are some tree(s) around. You get the idea.
Also note that you may aswell check such an expression value at a single position by passing a low radius and a sourceCount of 1, which is often just as useful as retrieving multiple (and already sorted) positions.
Also do not underestimate the keywords night, rain or windy, for if you couple them with the other keywords, you can easily get a highly dynamic system at a very low cost. (this, btw., is how animals "choose" where and when to spawn)
Posted on Apr 3, 2014 - 16:10
ffur2007slx2_5
In ArmA3 ver 1.14 Two new expressions are available: waterDepth(0-1) and camDepth(0-1), along with three simple operators: interpolate, randomGen and factor that can be used together with expressions. E.g. p = selectBestPlaces [

 position player,
 500,
 "(2 * (waterDepth interpolate [1,16,0,1]) * ((0.1+houses factor [0.1,0.8]) * (randomGen 1 + houses)))",
 1,
 1];

Algorithm randomGen: randomGen A(number): randomly generate a float number from 0 - A Algorithm factor: A(number) factor [p,q] = p< A <q: [(A -p)/(q-p)] Algorithm interpolate: A(number) interpolate [p,q,r,s] = A <=p:r A >=q:s p< A <q: [(A -p)/(q-p)]*(s-r) +r

Bottom Section

Posted on June 15, 2015 - 13:27 (UTC)
Killzone Kid
precision seems to have range 0 - 100. At very low values the command is extremely slow. 100 makes it quite fast. It looks like precision is some kind of grid search size. Large chunks make the search faster but less accurate.

Resulting array is [] if sourcesCount is 0 or expression is "". In all other cases it seems that result is array of arrays of the set max count. The sole indication of successful search is expressionResult value when it is > 0.

更多维基

随机维基