selectBestPlaces

From Bohemia Interactive Community
Revision as of 08:09, 9 June 2013 by Ceeeb (talk | contribs) (added white space)
Jump to navigation Jump to search
Hover & click on the images for description

Description

Description:
Find the places with the maximum value of _expression in the given area. Places can be on water.
Groups:
Uncategorised

Syntax

Syntax:
selectBestPlaces [_position, _radius, _expression, _precision, _sourcesCount]
Parameters:
[_position,_radius,_expression,_precision,_sourcesCount]: Array -
Return Value:
Array - Format is [[position: Position2D, expressionResult: Number], ...]

Examples

Example 1:
(example)

Additional Information

See also:
findEmptyPositionisFlatEmpty

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

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 usefull 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)

Bottom Section