Jump to content
Neviothr

Removing waypoint distance indicator?

Recommended Posts

Is there any way to remove the distance indicator under waypoints placed on the map by players?

Share this post


Link to post
Share on other sites

according to KillzoneKid.

 

player onMapSingleClick "_shift";

  • Like 2

Share this post


Link to post
Share on other sites

according to KillzoneKid.

 

player onMapSingleClick "_shift";

 

Nope. This disables the ability to place waypoints on the map completely, if you read the OP carefully, you'd noiced that I asked to remove distance indicator under the waypoint, not the whole thing.

Anyway... mean while /u/OptimusPrime360 on Reddit suggested the below:

if (hasInterface) then { waitUntil {!isNull (findDisplay 12)};
_mapDisplay = findDisplay 12;
_mapControl = _mapDisplay displayCtrl 51;

_mapControl ctrlAddEventHandler ["MouseMoving", {
    TRN_var_mainMapMouseOverCustomMark = "customMark" in (ctrlMapMouseOver (_this select 0));
}];

 ["TRN", "onMapSingleClick", {
    if (_shift) then {
        TRN_var_customMarkLocation = _pos;
    };
}] call BIS_fnc_addStackedEventHandler;

_mapDisplay displayAddEventHandler ["KeyDown", {
    if (!isNil "TRN_var_mainMapMouseOverCustomMark" && {TRN_var_mainMapMouseOverCustomMark} && {(_this select 1) == 211}) then {
        TRN_var_customMarkLocation = nil;
    };
}];

addMissionEventHandler ["Draw3D", {
    if (!isNil "TRN_var_customMarkLocation") then {
        drawIcon3D ["\A3\ui_f\data\igui\cfg\cursors\customMark_ca.paa", [1,1,1,0.8], [TRN_var_customMarkLocation select 0, TRN_var_customMarkLocation select 1, (TRN_var_customMarkLocation select 2) + 2], 1.5, 1.5, 0, "", 1, 0, "TahomaB", "", true];
    };
}];
};

But, this gives a disableSerialization error, so in order for the above to work, you need to add "disableSerialization;", like so:

disableSerialization;
if (hasInterface) then { waitUntil {!isNull (findDisplay 12)};
_mapDisplay = findDisplay 12;
_mapControl = _mapDisplay displayCtrl 51;

_mapControl ctrlAddEventHandler ["MouseMoving", {
    TRN_var_mainMapMouseOverCustomMark = "customMark" in (ctrlMapMouseOver (_this select 0));
}];

 ["TRN", "onMapSingleClick", {
    if (_shift) then {
        TRN_var_customMarkLocation = _pos;
    };
}] call BIS_fnc_addStackedEventHandler;

_mapDisplay displayAddEventHandler ["KeyDown", {
    if (!isNil "TRN_var_mainMapMouseOverCustomMark" && {TRN_var_mainMapMouseOverCustomMark} && {(_this select 1) == 211}) then {
        TRN_var_customMarkLocation = nil;
    };
}];

addMissionEventHandler ["Draw3D", {
    if (!isNil "TRN_var_customMarkLocation") then {
        drawIcon3D ["\A3\ui_f\data\igui\cfg\cursors\customMark_ca.paa", [1,1,1,0.8], [TRN_var_customMarkLocation select 0, TRN_var_customMarkLocation select 1, (TRN_var_customMarkLocation select 2) + 2], 1.5, 1.5, 0, "", 1, 0, "TahomaB", "", true];
    };
}];
};

But, unfortunately this doesn't exactly work well in singleplayer, if you save & load, it ceases to work.  

Share this post


Link to post
Share on other sites
If anyone is still interested in this in the future: there's a way to make the script usable after a save & load - turning the script into a mod.

I've created a simple mod from the above script, you can download it here: https://mega.nz/#!pQgR2BKD!4UjF_4ORvSqbGpRt4A3WCr_U_-gRXtTkmzq0dSZqJGw

 

Some notes!

* The mod requires CBA_A3.

* You must disable HUD waypoints info and HUD waypoints info permanently in your difficulty settings, you don't do so, you'll have 2 waypoints show on your screen.

  • Like 1

Share this post


Link to post
Share on other sites

I've been looking for something like this for sometime, unfortunately the mod link is gone and when I try to compile it myself into a mod, the game gets stuck on the loading screen on multiplayer, but not on singleplayer.  Anyone got any ideas?

Share this post


Link to post
Share on other sites

I was able to make it work by editing the script a bit.  For anyone else looking to make something similar this is what I used.

disableSerialization;
if (IsDedicated || !HasInterface) ExitWith {};
if (hasInterface) then { waitUntil {!isNull player};
_mapDisplay = findDisplay 12;
_mapControl = _mapDisplay displayCtrl 51;

_mapControl ctrlAddEventHandler ["MouseMoving", {
    TRN_var_mainMapMouseOverCustomMark = "customMark" in (ctrlMapMouseOver (_this select 0));
}];

 ["TRN", "onMapSingleClick", {
    if (_shift) then {
        TRN_var_customMarkLocation = _pos;
    };
}] call BIS_fnc_addStackedEventHandler;

_mapDisplay displayAddEventHandler ["KeyDown", {
    if (!isNil "TRN_var_mainMapMouseOverCustomMark" && {TRN_var_mainMapMouseOverCustomMark} && {(_this select 1) == 211}) then {
        TRN_var_customMarkLocation = nil;
    };
}];

addMissionEventHandler ["Draw3D", {
    if (!isNil "TRN_var_customMarkLocation") then {
        drawIcon3D ["\A3\ui_f\data\igui\cfg\cursors\waypointMark_ca.paa", [1,1,0,0.8], [TRN_var_customMarkLocation select 0, TRN_var_customMarkLocation select 1, (TRN_var_customMarkLocation select 2) + 2], 1.5, 1.5, 0, "", 1, 0, "TahomaB", "", true];
    };
}];
};

I edited it a bit more and made my own version of the mod which you can get here: https://steamcommunity.com/sharedfiles/filedetails/?id=2259216491

  • 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

×