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.