Jump to content
RealLocutus

How to change the color of the waypoint marker?

Recommended Posts

I hope this is the correct sub forum if not please move. Thanks.

 

We are currently playing on a winter map and on this map the waypoint marker (the one you set with Shift + Leftclick) is hard to see.

So my question is there a way to change the color? Maybe with a mod? Thanks.

Share this post


Link to post
Share on other sites
Posted (edited)

Hi,
we can't change the color directly. There is no access command and the function to create that waypoint marker runs internally. The only way you can achieve something similar is to create function that will draw over it. You can customize it by your needs. Paste the code to initPlayerLocal.sqf or else where the code would run locally.
 

addMissionEventHandler ["MapSingleClick", { 
 params ["_units", "_pos", "_alt", "_shift"];
if !(_shift) exitWith {};
if !(isNil "MyDraw3DMarkersEH") then {removeMissionEventHandler ["Draw3D",MyDraw3DMarkersEH]};
_EH = addMissionEventHandler ["Draw3D", { 
 drawIcon3D ["\a3\3DEN\Data\CfgWaypoints\Move_ca.paa", [1,0,0,1],_thisArgs select 0, 1, 1, 0, "", 1, 0.05, "TahomaB", "center", 
  true]; 
},[_pos]];
MyDraw3DMarkersEH = _EH;
}];

Also, this is just example how can it be done. Don't expect fully working code. For instance the icon will persist if you delete the custom waypoint.

Edited by soldierXXXX
  • Like 2

Share this post


Link to post
Share on other sites

I've always wished there was a way to make this work.

Quote

For instance the icon will persist if you delete the custom waypoint.

 

Haven't tried what you wrote because of this but it looks like you were soo close.

Share this post


Link to post
Share on other sites
10 hours ago, major-stiffy said:

I've always wished there was a way to make this work

Alright, I'll see what I can do 😉.

Share this post


Link to post
Share on other sites

Try:


 

addMissionEventHandler ["MapSingleClick", {  
  params ["_units", "_pos", "_alt", "_shift"];
  if !(_shift) exitWith {};
  if !(isNil "MyDraw3DMarkersEH") then {removeMissionEventHandler ["Draw3D",MyDraw3DMarkersEH]};
  _EH = addMissionEventHandler ["Draw3D", {  
    if (customWaypointPosition isNotEqualTo [] ) then {
      drawIcon3D ["\a3\3DEN\Data\CfgWaypoints\Move_ca.paa", [1,0,0,1],_thisArgs select 0, 1, 1, 0, "", 1, 0.05, "TahomaB", "center",  
  true]
    };  
  },[_pos]];
  MyDraw3DMarkersEH = _EH;
}];

 

  • Like 4

Share this post


Link to post
Share on other sites

Nice one @pierremgi You solved it quicker than I had a chance to get to my PC 😄. I actually like this solution a lot more than the one I had in mind. I wasn't aware that we have a command that retrieves that position, so that makes things a lot simpler 😊.

  • Thanks 1

Share this post


Link to post
Share on other sites

Maybe only one thing to improve. If player decides to remove the custom waypoint, remove draw event as well, so the game doesn't have to check the code each frame. When he places new waypoint that event will be always removed anyway, so I see no point in checking that condition further.

addMissionEventHandler ["MapSingleClick", {   
  params ["_units", "_pos", "_alt", "_shift"]; 
  if !(_shift) exitWith {}; 
  if !(isNil "MyDraw3DMarkersEH") then {removeMissionEventHandler ["Draw3D",MyDraw3DMarkersEH]};
  _EH = addMissionEventHandler ["Draw3D", { 
    drawIcon3D ["\a3\3DEN\Data\CfgWaypoints\Move_ca.paa", [1,0,0,1],_thisArgs select 0, 1, 1, 0, "", 1, 0.05, "TahomaB", "center", true];
	//systemChat ("running " + str diag_tickTime);//debug
    if (customWaypointPosition isEqualTo []) then {
	removeMissionEventHandler ["Draw3D",MyDraw3DMarkersEH];
	//systemChat "Not running";//debug
	MyDraw3DMarkersEH = nil;
	}; 
  },[_pos]]; 
  MyDraw3DMarkersEH = _EH; 
}];


 

  • Like 1

Share this post


Link to post
Share on other sites

OMG!  This is wonderful. Thanks so much you guys. I mostly play Pilgrimage mod and will update all ported maps to use this.

 

Thanks so much!

 

I plan to put it in the initPlayerLocal.sqf

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

×