Wyqer

GPS Check for Map Markers

43 posts in this topic

As I read in an other thread that some people would like to have a check for the exile map markers if the player has a GPS.
So I started to modify the exile script for the map markers and here is the result.

Features:
You can choose if you only want to have a marker for the player and not for party members or if you want markers for the player and the party members.
Also it removes the "move map to player position" button.

Player only:

  • If the player has a GPS equipped (not only in backpack or vest) he can see his own position on the map like vanilla exile.
  • In a group then he can only see himself and no other members of the party.

Player and Party:

  • If the player has a GPS equipped (not only in backpack or vest) he can see his own position on the map like vanilla exile.
  • In a group he can also see, if he has an GPS equipped, everyone in the party who has also an GPS equipped. People in the party who have no GPS can't see themself and also no party members, even if they have a GPS.

 

Installation:

  • Unpack your mission.pbo
  • Create a folder in the mission.pbo folder names "fixes"
  • In the "fixes" folder create a file named "ExileClient_gui_map_event_onDraw.sqf"
  • Open the file and copy the whole following code in the file.
/**
 * ExileClient_gui_map_event_onDraw
 *
 * Exile Mod
 * exile.majormittens.co.uk
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 *
 * GPS Check by Wyqer - 16.12.2015
 *
 */

private["_marker"];

_showGroup = false; // true = Group markers shown if the members have GPS | false = Only player marker if he has a GPS

/* DO NOT EDIT BELOW */

_display = uiNamespace getVariable "RSCDiary";
_ctrl = _display displayCtrl 1202;
_ctrl ctrlEnable false;
_ctrl ctrlsettextcolor [0,0,0,0];
_ctrl ctrlSetTooltip "";
_ctrl ctrlCommit 0;

if (_showgroup) then
{
	{
		deleteMarkerLocal _x;
	}
	forEach ExileClientPartyMapMarkers;
	{
		if ("ItemGPS" in (assignedItems _x) AND "ItemGPS" in (assignedItems player)) then
		{
			_marker = createMarkerLocal [format ["ExilePartyMarker%1", _forEachIndex], getPosVisual _x];
			_marker setMarkerShapeLocal "ICON";
			_marker setMarkerTypeLocal "ExilePlayer";
			_marker setMarkerDirLocal (getDirVisual _x);
			_marker setMarkerAlphaLocal 0.75;
			if (_x isEqualTo player) then 
			{
				_marker setMarkerColorLocal "ColorBlue";
			}
			else 
			{
				_marker setMarkerColorLocal "ColorGreen";
				_marker setMarkerTextLocal (name _x);
			};
		};
		ExileClientPartyMapMarkers pushBack _marker;
	}
	forEach units (group player);
}
else
{
	if ("ownMapPosition" in allMapMarkers) then
	{
		deleteMarkerLocal "ownMapPosition";
	};
	
	if ("ItemGPS" in (assignedItems player)) then
	{
		_marker = createMarkerLocal ["ownMapPosition", getPosVisual player];
		_marker setMarkerShapeLocal "ICON";
		_marker setMarkerTypeLocal "ExilePlayer";
		_marker setMarkerDirLocal (getDirVisual player);
		_marker setMarkerAlphaLocal 0.75;
		_marker setMarkerColorLocal "ColorBlue";
	};
};
  • In your config.cpp from your mission.pbo search for the following section:
class CfgExileCustomCode 
{
	/*
		You can overwrite every single file of our code without touching it.
		To do that, add the function name you want to overwrite plus the 
		path to your custom file here. If you wonder how this works, have a
		look at our bootstrap/fn_preInit.sqf function.

		Simply add the following scheme here:

		<Function Name of Exile> = "<New File Name>";

		Example:

		ExileClient_util_fusRoDah = "myaddon\myfunction.sqf";
	*/
};
  • Modify it that it looks like this:
class CfgExileCustomCode 
{
	/*
		You can overwrite every single file of our code without touching it.
		To do that, add the function name you want to overwrite plus the 
		path to your custom file here. If you wonder how this works, have a
		look at our bootstrap/fn_preInit.sqf function.

		Simply add the following scheme here:

		<Function Name of Exile> = "<New File Name>";

		Example:

		ExileClient_util_fusRoDah = "myaddon\myfunction.sqf";
	*/
  	ExileClient_gui_map_event_onDraw = "fixes\ExileClient_gui_map_event_onDraw.sqf";
};
  • Repack your mission.pbo and overwrite your current mission file in mpmissions folder
  • Finished

BE Filters:

scripts.txt
 

In the line with "7 createMarker" put the following at the end:
!="AND \"ItemGPS\" in (assignedItems player)) then\n{\n_marker = createMarkerLocal [format [\"ExilePartyMarker%1\", _forEachIndex], getPo"


In the line with "7 units" put the following at the end:
!="};\n};\nExileClientPartyMapMarkers pushBack _marker;\n}\nforEach units (group player);\n}\nelse\n{\nif (\"ownMapPosition\" in allMapMarker"

 

Hope you enjoy and if there are problems.... post it here as always :)

Edited by Wyqer
Update for remove of "move map to player position"
  • Like 9

Share this post


Link to post
Share on other sites
Advertisement

Update

Added that the "move map to player position" will be removed at the map screen.

Just copy again the whole content for the ExileClient_gui_map_event_onDraw.sqf and replace your current content in your mission fixes file there.

Share this post


Link to post
Share on other sites

Really Nice Idea... But just a small suggestion.... What i will do on all scripts.... why not make the part that no one is allowed to change to clean that....

/* DO NOT EDIT BELOW */
_display = uiNamespace getVariable "RSCDiary";
_ctrl = _display displayCtrl 1202;
_ctrl ctrlEnable false;
_ctrl ctrlsettextcolor [0,0,0,0];
_ctrl ctrlSetTooltip "";
_ctrl ctrlCommit 0;
if (_showgroup) then{{deleteMarkerLocal _x;} forEach ExileClientPartyMapMarkers; {if ("ItemGPS" in (assignedItems _x) AND "ItemGPS" in (assignedItems player)) then{_marker = createMarkerLocal [format ["ExilePartyMarker%1", _forEachIndex], getPosVisual _x]; _marker setMarkerShapeLocal "ICON"; _marker setMarkerTypeLocal "ExilePlayer"; _marker setMarkerDirLocal (getDirVisual _x); _marker setMarkerAlphaLocal 0.75;
if (_x isEqualTo player) then {_marker setMarkerColorLocal "ColorBlue";} else {_marker setMarkerColorLocal "ColorGreen"; _marker setMarkerTextLocal (name _x);}; };
ExileClientPartyMapMarkers pushBack _marker;}forEach units (group player);}
else{if ("ownMapPosition" in allMapMarkers) then{deleteMarkerLocal "ownMapPosition";}; if ("ItemGPS" in (assignedItems player)) then{_marker = createMarkerLocal ["ownMapPosition", getPosVisual player]; _marker setMarkerShapeLocal "ICON"; _marker setMarkerTypeLocal "ExilePlayer"; _marker setMarkerDirLocal (getDirVisual player); _marker setMarkerAlphaLocal 0.75; _marker setMarkerColorLocal "ColorBlue";};};

 

The longer the script the more rules it needs to read.... it is a fact when line are on a row like my example it read much faster...... Dont Believe me... Use Google xD

Edited by Mr Heisenberg

Share this post


Link to post
Share on other sites

You don't do something like that when writing code. Normally it's a common convention to have one statement per line and not nearly everything in one line. It's harder to read because the common formatting is missing and as one of the important things: If you have an error in line X with a missing ";" or something, you wish you would have only one statement per line.

  • Like 2

Share this post


Link to post
Share on other sites
17 minutes ago, Wyqer said:

You don't do something like that when writing code. Normally it's a common convention to have one statement per line and not nearly everything in one line. It's harder to read because the common formatting is missing and as one of the important things: If you have an error in line X with a missing ";" or something, you wish you would have only one statement per line.

Yea but when ia code is done and not editing for public then minify it.......

Keep the code open when it still need and allow to edit by public........

For Public keep it easy for them to read / NOT FOR EDITING minify the script...

---------------------------------------------------------------------------

Reason to minify is get the lags out of the server..... arma 3 itself has allot of rubbish in the coding... and then we have mods with NON-Minify Codes... well then u ask for lags and more that isn't really necessary

__________________________________________________________________________________

This what i do is just a small suggestion..... Can use when they like :)

Edited by Mr Heisenberg

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.