Jump to content
Sign in to follow this  
twisted

finding nearest town error MP

Recommended Posts

Hi

im am calling this code

_Alltowns = nearestLocations [getPosATL _townpos, ["NameVillage","NameCity","NameCityCapital"], 2000]; 
sleep 1;
_townName = _Alltowns select 0;

but it returns "any" and tnot the towns name in MP (internet)

what am i doign worng here?

also, why do markers sometimes show up in MP games and sometimes not even when difficulty level has NOT been change.

code i use to make the markers

_inited =0;

if (_inited == 0) then {total_markers = total_markers + 1;eastTowns = eastTowns + 1; _inited =1;};
_townCounter = total_markers;
_NumberOfMarkers = _townCounter;

_townmarkersize = 300;
_towntriggersize = 400;
_ammoDropped = 0 ;
_where = 5;





//hint format["MarkerE is called %1", _markernameE];


_markernameE = text format["_MarkerE%1",_NumberOfMarkers+1];
_markernameE = "markerE" + (str _townCounter);
_MarkerE = CreateMarker [_markernameE, getPos _townpos];
_markernameE SetMarkerShape "ELLIPSE";
_markernameE SetMarkerColor "ColorRed";
_markernameE SetMarkerSize [_townmarkersize,_townmarkersize];

Share this post


Link to post
Share on other sites

you could try counting the towns you placed in the array then select the first - pretty much what i do -

not quite sure what you mean with the makers sometimes show up and sometime not even when difficulty level has not been changed...

Share this post


Link to post
Share on other sites
you could try counting the towns you placed in the array then select the first - pretty much what i do -

not quite sure what you mean with the makers sometimes show up and sometime not even when difficulty level has not been changed...

i thought that select 0 does this?

Share this post


Link to post
Share on other sites

Hi mate...

_Alltowns = nearestLocations [getPosATL _townpos, ["NameVillage","NameCity","NameCityCapital"], 2000]; 
sleep 1;
_townName = _Alltowns select 0;

but it returns "any" and tnot the towns name in MP (internet)

what am i doign worng here?

Try this for the town name...

_townName = text (_Alltowns select 0);

If that does not work... make sure that _townpos is actually a position.... because that code should work.

also, why do markers sometimes show up in MP games and sometimes not even when difficulty level has NOT been change.

code i use to make the markers

_inited =0;

if (_inited == 0) then {total_markers = total_markers + 1;eastTowns = eastTowns + 1; _inited =1;};
_townCounter = total_markers;
_NumberOfMarkers = _townCounter;

_townmarkersize = 300;
_towntriggersize = 400;
_ammoDropped = 0 ;
_where = 5;

//hint format["MarkerE is called %1", _markernameE];


[color="#FF0000"]_markernameE = text format["_MarkerE%1",_NumberOfMarkers+1];
_markernameE = "markerE" + (str _townCounter);[/color]
_MarkerE = CreateMarker [_markernameE, getPos _townpos];
_markernameE SetMarkerShape "ELLIPSE";
_markernameE SetMarkerColor "ColorRed";
_markernameE SetMarkerSize [_townmarkersize,_townmarkersize];

markernameE seems to be assigned twice... this makes no sense. It's one or the other.

If some markers are not showing up it's probably because several markers get the same name or same position. Check your logic and how you count things.

Edited by twirly
Clarity

Share this post


Link to post
Share on other sites

thank you very much. I often make no sense in this kind of thing because i am winging it 98% of the time. again thanks for the clarity, I appreciate it

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×