twisted 128 Posted February 28, 2014 (edited) so i want to count all towns between to bases(also towns). I figured out a way which would be by finding all towns near the 2 bases and then sorting out and only keeping the towns common to both. but whne i try i get an error. {if _x in _townsby1 then {_commontowns se> Error position: Error if: Type Location, expected Bool _dist = _firsttown distance _secondtown; _townsby1 = nearestLocations [_firsttownpos, ["NameVillage","NameCity","NameLocal","NameCityCapital","CityCenter","Airport"], _dist]; _townsby2 = nearestLocations [_secondtownpos, ["NameVillage","NameCity","NameLocal","NameCityCapital","CityCenter","Airport"], _dist]; // now get all towns common to both lists _commontowns = []; {if _x in _townsby1 then {_commontowns set[count _commontowns, _x]; }} foreach _townsby2; edit - dope. i forgot to put brackets around the if statement. very embaressing. Edited February 28, 2014 by twisted aaaaargh Share this post Link to post Share on other sites