Jump to content
Luft08

[SOLVED] Get marker position from string name

Recommended Posts

I need to get the position of a marker. All markers follow a naming convention marker_1, marker_2 etc.  I want to pass in a random number and return the marker position. I can build the string name but I think I need to convert that into an object. I've tried the following code:

 

if (isServer) then {
    destinationNumber = round(random 50) + 1;
    _current_waypoint_str = "patrol_marker_"+str(destinationNumber);
    _current_waypoint_obj = missionNamespace getVariable [_current_waypoint_str, objNull];
    _marker_pos = getPos _current_waypoint_obj; // <<<<------ This fails.

 

// Do Stuff...
};

 

I'm new to this. Can someone help me out? Thanks.

 

Share this post


Link to post
Share on other sites
5 minutes ago, Luft08 said:

_marker_pos = getPos _current_waypoint_obj;

shoud be getMarkerPos (works with strings)

Share this post


Link to post
Share on other sites

Markers are stored as strings, not objects AFAIK

Share this post


Link to post
Share on other sites

Thank you. This has been driving me nuts. 

getMarkerPos  _current_waypoint_str works!

 

 

Share this post


Link to post
Share on other sites

if I type "Get marker position from string name arma" in google, the 1st sesult is this thread, the second is getMarkerPos command reference 

  • Like 1

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

×