Jump to content
z80cpu

Modify Names Shown And Distance When Shown

Recommended Posts

-- Shows/hide names of towns, cities, bases, etc. as well as adjusting at what distance they will shown to player. --


Yes, this is an old mod.  Difference is that I added 'distance when to show names' as well as showing how to add other locations.  And not everybody may have this due to main Exile site being gone now.


Directions below are crafted on a 'novice level' so all admins can hopefully add this if desired without any issues/questions!


I use this overwrite 'ExileClient_util_world_getNearestLocationName.sqf' and my other overwrite 'ExileClient_gui_hud_showSurvivalInfo.sqf' together with no issues, which both are posted here.


**************************************************************************


***  How To Install  ***


#1 - Un-PBO your mission file.  In your mission PBO, file and open the file called:  Config.CPP

 

 

 

#2 - Search/Find the section called:  class CfgExileCustomCode

 

Once found, it will look something like what is shown below:


class CfgExileCustomCode
{

 

---  Other items may be here alreay  ---


};

 

 

 

 

#3 - In that section, add/paste the following:

 

 

// Show Town/Base Info
ExileClient_util_world_getNearestLocationName = "YOUR_OVERWRITE_PATH\FOLDER_NAME_YOU_CHOOSE_IF_WANTED\ExileClient_util_world_getNearestLocationName.sqf";

 

 

 

 

#4 - When completed, the 'CfgExileCustomCode' section should look like:

 

class CfgExileCustomCode
{

 

---  Other items may be here alreay  ---

 

// Show Town/Base Info -
ExileClient_util_world_getNearestLocationName = "YOUR_OVERWRITE_PATH\FOLDER_NAME_YOU_CHOOSE_IF_WANTED\ExileClient_util_world_getNearestLocationName.sqf";

 

};

 

 

I personally use the folder name of 'overwrites' for all my overwrites and I used 'BaseNames' for this overwrite.

 

So my line in my Config.CPP looks like:  "overwrites\BaseNames\ExileClient_util_world_getNearestLocationName.sqf";


Note:  Make SURE, that no other overwrite is using the same 'module'. I.E.; ExileClient_util_world_getNearestLocationName.sqf
If so, you must combine the two overwrites.


I have only added 3 lines (shown/marked below), so it will be extremely easy to 'merge' any like modules in use.


Addition #1:  _MyRadius = 150;  -  How far away in meters to show message.


Addition #2:  _radius = [_this, 1, _MyRadius] call BIS_fnc_param;  -  Putting new variable '_MyRadius' into origian location where 500 was.  (500 meters is default value).  Original code:  _radius = [_this, 1, 500]


Addition #3:  Add/Remove items from the '_locationTypes' array.  See below for more info on this.


With change #3, do be CAREFUL!  There should ALWAYS be a comma after EVERY item EXCEPT THE LAST ONE!  EVERY name should be 'surrounded' by quotes!

 

Format, First -> LAST ITEM-1:  QUOTE - ITEM - QUOTE - COMMA     Example:  "ITEM",

Format, LAST ITEM:  QUOTE - ITEM - QUOTE     Example:  "ITEM"

 

 

* Failure to follow said format can cause ARMA to crash! *

 

 

Correct:
_locationTypes = ["a", "b", "c", "1", "2", "3"];
_locationTypes = ["a","b","c","1","2","3"];

 

 

Incorrect:
_locationTypes = [a, b, c, 1, 2, 3];  <-- No quotes
_locationTypes = [a, b, c, 1, 2, 3,];  <-- No quotes and a comma on the end
_locationTypes = ["a", "b", "c", "1", "2", "3",];  <-- Comma on the end

 


To make changes such as removing base names from showing to other players, just remove that item!

 

Note:  Make sure that the area you ADD back into this list has QUOTES AROUND THE NAME!

 

 

Original:
_locationTypes =
[
    "ExileTerritory",
    "NameCityCapital",        
    "NameCity",                
    "NameVillage",            
    "NameLocal",            
    "Hill",                    
    "NameMarine"            
];


To Stop Showing Base Names, Which Is Shown Below, Just Remove "ExileTerritory", (Notice:  Comma IS included):
_locationTypes =
[
    "NameCityCapital",        
    "NameCity",                
    "NameVillage",            
    "NameLocal",            
    "Hill",                    
    "NameMarine"            
];


Showing Other locations As An Example (3 Added At The Top And Are BOLDED):

_locationTypes =
[
    "HistoricalSite",
    "FlatArea",
    "Name",
    "NameCityCapital",        
    "NameCity",                
    "NameVillage",            
    "NameLocal",            
    "Hill",                    
    "NameMarine"            
];


Note:  "ExileTerritory" is the name used to show player's bases.

 


To set the distance a player must be to have the message shown, change the value of the variable '_MyRadius' to whatever you desire it to be.  Default value is 500.  This is the distance in meters for the radius.


Note:  There are 114 locations you can use in the array '_locationTypes'.  Most of them are useless in Exile.

 

To see all possible areas that you could put in the '_locationTypes' array, visit:  https://community.bistudio.com/wiki/Location scroll down to the 'ARMA 3' section.

 

 

 

 

#5 - Save, Re-PBO the mission, Stop the server, Copy over new mission PBO, Re-Start server!

 

 

 

 

**************************************************************************

 

 

 

 

--  Put the following code below into a file called:  ExileClient_util_world_getNearestLocationName.sqf

 

Make SURE you name it EXACTLY as above as well as the case of the letters, as it DOES MATTER!  a <> A, A = A

 

First 3 lines in the newly created ExileClient_util_world_getNearestLocationName.sqf will be:

 

/**
 * ExileClient_gui_hud_showSurvivalInfo
 *

 

 


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

 

 

 

 

/**
 * ExileClient_util_world_getNearestLocationName
 *
 * Exile Mod
 * www.exilemod.com
 * © 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/.
 */
 
private["_position", "_radius", "_locationTypes", "_locations", "_locationName", "_location"];
_MyRadius = 150;  // Added/Modified Line - Addition #1  Set this value to whatever you want too.  Want the info to show far off?  Set it to 1000.  Wnat it to show when basically the player is 'on top of it'?  Set it to 25.  Number is meters from the base flag.  Original value is 500.
_position = _this select 0;
_radius = [_this, 1, _MyRadius] call BIS_fnc_param;   // Added/Modified Line - Addition #2  -  Original value of '_MyRadius' is 500.  Original line:  _radius = [_this, 1, 500]
_locationTypes =
[
    "NameCityCapital",        
    "NameCity",                
    "NameVillage",            
    "NameLocal",            
    "Hill",                    
    "NameMarine"            
];
//  Delete locations above to have them NOT show on screen once player gets withi the set radius.  Added/Modified Line - Addition #3 - Exile Base Names Removed
_locations = nearestLocations [_position, _locationTypes, _radius];
_locationName = "";
if !((count _locations) isEqualTo 0) then
{
    _location = _locations select 0;
    _locationName = name _location;

    if (_locationName isEqualTo "") then
    {
        _locationName = text _location;

    };
};
_locationName

Share this post


Link to post
Share on other sites

×