selectBestPlaces – Talk

From Bohemia Interactive Community
Jump to navigation Jump to search

Used for cows to see where to graze:

           _root = configFile >> "CfgVehicles" >> "Cow";
           _favouritezones = getText ( _root >> "favouritezones");
           _randrefpoint =  [(getpos player select 0) +Random(2*_SpawnRadius) -_SpawnRadius,(getpos player select 1) +Random(2*_SpawnRadius) -_SpawnRadius];
           _PosList = selectbestplaces [_randrefpoint,_FindPlaceRadius,_favouritezones,10,5];
           _PosSelect = _PosList select (floor random (count _PosList));
           _Pos =  _PosSelect select 0;

--Doolittle 07:55, 13 October 2009 (CEST)