Hmm, could be done like this:
#define SECTION_LENGTH 100 // in meters
private ["_fn_getIntermediatePositions","_posPlayer","_posMarker","_sectionCount","_positionList"];
_fn_getIntermediatePositions = {
private ["_pos0","_posN","_sections","_posList","_p","_offsetX","_offsetY"];
_pos0 = _this select 0; // start position
_posN = _this select 1; // end position
_sections = _this select 2; // number of intermediate positions
// offsets to the next position
_offsetX = ((_pos0 select 0) - (_posN select 0)) / _sections;
_offsetY = ((_pos0 select 1) - (_posN select 1)) / _sections;
// generate list of intermediate positions
// starting with the one closest to the end position to make the
// first intermediate position the one with the distance error
_posList = [];
_p = _posN;
for "_i" from 0 to (_sections - 2) do {
_x = (_p select 0) + _offsetX;
_y = (_p select 1) + _offsetY;
_p = [_x,_y];
_posList = [_p] + _posList;
};
// add the last position to list
_posList = _posList + [_posN];
_posList; // return value
};
/* Example Usage
*
* Requires:
* - a marker called "myMarker"
* - a player :)
*/
_posPlayer = getPos player;
_posMarker = markerPos "myMarker"; // mind the quotes!
_sectionCount = (_posPlayer distance _posMarker) / SECTION_LENGTH;
_positionList = [_posPlayer, _posMarker, _sectionCount] call _fn_getIntermediatePositions;
// place a marker at each position
for "_i" from 0 to (count _positionList - 1) do {
_name = "marker" + str(_i);
_pos = _positionList select _i;
_markerstr = createMarker[_name, _pos];
_markerstr setMarkerShape "ICON";
_markerstr setMarkerType "DOT";
_markerstr setMarkerText str(_i);
};