Sign in to follow this  
Followers 0
ncp-sarge

Limiting Flags per Family?

6 posts in this topic

First up, I seem to remember seeing this somewhere before but I couldn't find it.  I may have just overlooked it or something so sorry if I did.

I'm interested if it's possible to set it up so that you can only have 1 flag per family.  Or set a specific limit to how many flags a family can have.  A large family can pretty much blanket a map on a server with base spawns, and even small groups can set up many small bases around.  It would create a very different dynamic on a server if you had to be in a family to create a flag and then that family only gets 1 or 2 bases.

To sum up, is it possible to change the settings to only allow people in a family to place a flag, and then limit the amount of flags that a family can place?

Share this post


Link to post
Share on other sites

I highly doubt it and don't think that would be something would enjoy either. People wouldn't be able to independently create their own bases if this was implemented.

Share this post


Link to post
Share on other sites
Advertisement

Posted (edited)

Is that the stuff having to do with polys and nodes and stuff in the mission confg at the top? I don't really know what that stuff does but I went ahead and cut them in half maybe that's what you're looking for.

Spoiler

    /*

        Maximum markers per clan

    */
    maximumIcons = 10;

    /*
        Maximum number of characters on a Marker in a presistent system

        Note: MAX 255!
        
    */
    maximumIconText = 48;

    /*

        Maximum poly markers per clan

    */
    maximumPolys = 5;


    /*

        Maximum points in poly
    */
    maximumPolyNode = 5;

 

Edited by Emton

Share this post


Link to post
Share on other sites

Uh oh I better put it back to default but I wonder what the markers do, sort of hard to test some of this stuff when you need a real life virtual family hmmmmmm

Share this post


Link to post
Share on other sites

Alrighty, this should be pretty easy to do. I reckon you could do it with one file change
Please bear in mind that this isn't tested, nor will I test it because my playerbase would hate the change. 

I would try something like this... 
Basically the concept is check the flags around the map to see if  a person has build rights on the flag. and add to the count. if the count goes above X then it throws an error and wont let you build.

ExileClient_object_item_construct.sqf

private["_itemClassName","_minimumDistanceToTraderZones","_minimumDistanceToSpawnZones","_maximumNumberOfTerritoriesPerPlayer","_numberOfTerritories"];
_itemClassName = _this select 0;

_maxTerritories = 2; 	// change this to your max
_count = 0;
_myUID = getPlayerUID player;
{
	_flag = _x;
	_bldRights = _flag getVariable ["ExileTerritoryBuildRights", []];
	if (_myUID in _bldRights) then {
		_count = _count + 1;
	};
} forEach (allMissionObjects "Exile_Construction_Flag_Static");


if !(_itemClassName in (magazines player)) exitWith {false};
if( isClass(configFile >> "CfgMagazines" >> _itemClassName >> "Interactions" >> "Constructing") ) then
{
	if (findDisplay 602 != displayNull) then
	{
		(findDisplay 602) closeDisplay 2; 
	};
	try {
		// THIS HERE IS THE CHECK
		if (_count > _maxTerritories) then {throw "Your family already has too many Territories.";};
	
		if !((vehicle player) isEqualTo player) then {throw "You cannot build while in a vehicle.";};
		_minimumDistanceToTraderZones = getNumber (missionConfigFile >> "CfgTerritories" >> "minimumDistanceToTraderZones");
		if ([player, _minimumDistanceToTraderZones] call ExileClient_util_world_isTraderZoneInRange) then {throw "You are too close to a safe zone.";};
		if (player call ExileClient_util_world_isInNonConstructionZone) then { throw "Building is disallowed here on this server.";};		
		// ignore the below, these are my barracks locations. but this can be helpful if you want to stop building in certain locations and not sure how?
		//	if ((player distance [13164.426,6837.8364,0]) < 500) then { throw "Building is Disallowed here on this Server."; };
		//	if ((player distance [6317.3369,7810.248,0]) < 500) then { throw "Building is Disallowed here on this Server."; };
		//	if ((player distance [2056.092,5183.564,0]) < 500) then { throw "Building is Disallowed here on this Server."; };
		//	if ((player distance [4748.8921,2273.4509,0]) < 500) then { throw "Building is Disallowed here on this Server."; };
		//	if ((player distance [12104.534,12617.873,0]) < 500) then { throw "Building is Disallowed here on this Server."; };
		//	if ((player distance [8062.44,13600.8,0]) < 600) then { throw "Building is Disallowed here on this Server."; };		
		if (player call ExileClient_util_world_isInConcreteMixerZone) then {throw "You are too close to a concrete mixer zone.";};
		_minimumDistanceToSpawnZones = getNumber (missionConfigFile >> "CfgTerritories" >> "minimumDistanceToSpawnZones");
		if ([player, _minimumDistanceToSpawnZones] call ExileClient_util_world_isSpawnZoneInRange) then {throw "You are too close to a spawn zone.";};
		if(_itemClassName isEqualTo "Exile_Item_Flag") then { 
			_maximumNumberOfTerritoriesPerPlayer = getNumber (missionConfigFile >> "CfgTerritories" >> "maximumNumberOfTerritoriesPerPlayer");
			_numberOfTerritories = player call ExileClient_util_territory_getNumberOfTerritories;
			if (_numberOfTerritories >= _maximumNumberOfTerritoriesPerPlayer) then {	throw "You have reached the maximum number of territories you can own.";};
			call ExileClient_gui_setupTerritoryDialog_show;
		} else { [_itemClassName] call ExileClient_construction_beginNewObject; };
	}
	catch { ["ErrorTitleAndText", ["Construction aborted!", _exception]] call ExileClient_gui_toaster_addTemplateToast; };
};
true

If it doesn't work out of the box, sorry. but this is what I would try. 

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
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.