selectBestPlaces: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(mass edit: removing obsolete </dt> and </dd> tags) |
||
Line 34: | Line 34: | ||
<dl class='command_description'> | <dl class='command_description'> | ||
<!-- Note Section BEGIN --> | <!-- Note Section BEGIN --> | ||
<dd class="notedate" | <dd class="notedate"> | ||
<dt class="note">'''[[User:Rübe|Rübe]]''' | <dt class="note">'''[[User:Rübe|Rübe]]''' | ||
<dd class="note">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.<br> | <dd class="note">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.<br> | ||
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.<br> | 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.<br> | ||
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) | 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) | ||
<!-- Note Section END --> | <!-- Note Section END --> | ||
</dl> | </dl> |
Revision as of 02:54, 18 October 2011
Description
- Description:
- Find the places with the max. 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)