alexslx

[Release] Specific Item Build Restriction

8 posts in this topic

Posted (edited)

Hi,

As my first contribution, I would like to share a few edits which I have added to prevent abuse of territory owners. I really like the additions of some mods like Extended Base Mod or DP Addon, however, some items might be to overpower or just annoying if added a lot to bases. In order to prevent  this, I came with the idea of limiting the item building based on territory level and/or item count.

There are two files you gonna need to override:

  1. ExileClient_util_world_canBuildHere.sqf
  2. ExileServer_object_construction_network_buildConstructionRequest.sqf

DOWNLOAD: https://github.com/xalexslx/exilecontrib-buildrestrictions

To override these files, you just need to copy my already edited files to a folder like "Custom\Overrides" inside of your missionfolder and then, add the following likes to the section named "CfgExileCustomCode" in your config file. Example below:

class CfgExileCustomCode 
{   
    // Build Restriction
    ExileServer_object_construction_network_buildConstructionRequest    = "Custom\Overrides\ExileServer_object_construction_network_buildConstructionRequest.sqf"
    ExileClient_util_world_canBuildHere                                 = "Custom\Overrides\ExileClient_util_world_canBuildHere.sqf"
};

After that, just add the following into your CfgTerritories section:

    buildRestrictions[] =
    {
        // Classname                       Base Level,  Max Objects
        {"Land_Cargo_House_V2_F",                   1,              1},
        {"Land_Cargo40_light_green_F",              1,              1}
    };

Done.

Edited by alexslx
5 people like this

Share this post


Link to post
Share on other sites
Advertisement

Thanks for sharing, trying it out now.  I was just thinking last night that I need a way to limit some of the items from Extended Base Mod.

Share this post


Link to post
Share on other sites
4 hours ago, Shadow said:

Thanks for sharing, trying it out now.  I was just thinking last night that I need a way to limit some of the items from Extended Base Mod.

Yeah, I've used both EBM and DP Addon and had the same feeling about some items which are nice, but can turn the server into trash if some base owner decide to spawn it 100 times. Feel free to share your limits :)

Share this post


Link to post
Share on other sites
7 minutes ago, ProdigalCB said:

Would this allow me to limit the number if safes a player has?
 

Yes. 

1 person likes this

Share this post


Link to post
Share on other sites

Alright I'm having a problem getting this to work I've tried a few different things I can't figure out why its not working here it what I got below

class CfgTerritories
{
	// Base Cost / Radius
	// Level 1 is allways for Pop Tabs, >= 2 for Respect
	prices[] = 
	{
		{10000,					15,			30 		},
		{20000,					25,			50 		},
		{30000,					35,			70 		},
		{40000,					45,			90		},
		{50000,					55,			110		},
		{60000,					65,			130		},
		{70000,					75,			150		},
		{80000,					85,			170		},
		{90000,					95,			190		},
		{100000,				105,		210		}
	};

	// A shortcut of the above maximum radius
	maximumRadius = 105;
	maximumSafes = 5;
	// The above * 2 plus coverving the 20m you can move while placing things
	minimumDistanceToOtherTerritories = 325; 

	// Maximum number of territories a player can own
	maximumNumberOfTerritoriesPerPlayer = 1;

	/**
	 * Defines the minimum distance to safe zones / trader cities where players
	 * cannot build territories
	 */
	minimumDistanceToTraderZones = 1000;

	/**
	 * Defines the minimum distance to spawn zones where players
	 * cannot build territories
	 */
	minimumDistanceToSpawnZones = 1000;

	// Amount of pop tabs or respect per object to pay
	popTabAmountPerObject = 10;
	respectAmountPerObject = 5;
	
    /**
     * Territory build restrictions - by alexslx
     *
     * Usage:
     * {"classname", limit},
     * {"classname", limit} // <- Remember the last doesn't have comma
     */
	buildRestrictions[] =
    {
        // Classname                       Base Level,  Max Objects
        {"Exile_Container_Safe",						1,              1},
        {"Exile_Container_Safe",						2,              2},
        {"Exile_Container_Safe",						3,              3},
        {"Exile_Container_Safe",						4,              4},
        {"Exile_Container_Safe",						5,              5},
        {"Exile_Container_Safe",						6,              6},
        {"Exile_Container_Safe",						7,              7},
        {"Exile_Container_Safe",						8,              8},
        {"Exile_Container_Safe",						9,              9},
        {"Exile_Container_Safe",						10,             10}
	};
};
class CfgExileCustomCode 
{
	//Extra Logging files Player + Vehicle + Container history log
	ExileServer_object_player_event_onMpKilled = "Logging\ExileServer_object_player_event_onMpKilled.sqf";
	
	ExileServer_object_vehicle_event_onMPKilled = "Logging\ExileServer_object_vehicle_event_onMPKilled.sqf";
	
	ExileServer_object_container_event_onMPKilled = "Logging\ExileServer_object_container_event_onMPKilled.sqf";
	
	ExileServer_object_lock_network_lockToggle = "Logging\ExileServer_object_lock_network_lockToggle.sqf";
	
	ExileClient_object_lock_toggle = "Logging\ExileClient_object_lock_toggle.sqf";
	
	ExileServer_system_trading_network_sellItemRequest = "Logging\ExileServer_system_trading_network_sellItemRequest.sqf";
	
	ExileServer_system_trading_network_wasteDumpRequest =
	"Logging\ExileServer_system_trading_network_wasteDumpRequest.sqf";
	
	ExileServer_system_trading_network_purchaseVehicleRequest = "Logging\ExileServer_system_trading_network_purchaseVehicleRequest.sqf";
	
	ExileServer_system_trading_network_purchaseVehicleSkinRequest =
	"Logging\ExileServer_system_trading_network_purchaseVehicleSkinRequest.sqf";
	
	ExileServer_system_trading_network_purchaseItemRequest = "Logging\ExileServer_system_trading_network_purchaseItemRequest.sqf";
	
	ExileServer_object_construction_database_delete = "Logging\ExileServer_object_construction_database_delete.sqf";
	
	ExileServer_system_trading_network_sendMoneyRequest = "Logging\ExileServer_system_trading_network_sendMoneyRequest.sqf";
	
	ExileServer_system_network_dispatchIncomingMessage = "Logging\ExileServer_system_network_dispatchIncomingMessage.sqf";
	
	// XM8 Apps
	ExileClient_gui_xm8_slide_apps_onOpen = "xm8Apps\ExileClient_gui_xm8_slide_apps_onOpen.sqf";

	// Build Restriction
    ExileServer_object_construction_network_buildConstructionRequest    = "Custom\Overrides\ExileServer_object_construction_network_buildConstructionRequest.sqf";
    ExileClient_util_world_canBuildHere                                 = "Custom\Overrides\ExileClient_util_world_canBuildHere.sqf";

};	

 

Share this post


Link to post
Share on other sites

has anyone got an update for the newest release?

Edited by Crazy Mike

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.