Sign in to follow this  
Followers 0
Andrew_S90

[SOLVED] [BUG] Territory Build Limit

5 posts in this topic

Im not sure if the devs keep up with this section but here goes..

 

In Exile right now the most recent update put an object limit on max built objects in a territory. It works but it is broken..

 

 
class CfgTerritories
{
    // Base Cost / Radius
    // Level 1 is allways for Pop Tabs, >= 2 for Respect
    prices[] =
    {
        // Purchase Price         Radius         Number of Objects
        {5000,                    15,            30                     }, // Level 1
        {10000,                    30,            60                     }, // Level 2
        {15000,                    45,            90                     }, // Level 3
        {20000,                    60,            120                    }, // Level 4
        {25000,                    75,            150                    }, // Level 5
        {30000,                    90,            180                    }, // Level 6
        {35000,                    105,        210                    }, // Level 7
        {40000,                    120,        240                    }, // Level 8
        {45000,                    135,        270                    }, // Level 9
        {50000,                    150,        300                    }  // Level 10
    };
 
This is the default price/size/object cfg
 
Your territory size is correct, price is correct and it doesn't allow you to build any bigger then your radius.
 
However whats broken is that if I have a basic flag and I just built my territory I have 15m radius base and I am supposed to be able to only be able to build 30 objects. But the way its currently coded and a bug is that it selects the next territory up's building limit. So I have level 1 territory and it has 15m radius, cost me 5k respect and it allows 60 objects to be built, not 30 like it should.
 
Problem: Territory allows you to build the next level up limit of items.
Level 1: 15m, 60 items
Level 2: 30m, 90 items
So in theory the max level would have no object limit or error out. 
 
The reason it happens is because the check for objects is coded wrong, it gets your territorys level and selects the level for the config but the config starts at 0 not 1 like the territory levels. So the territory actual levels are 1, 2, 3 while in config they are 0, 1, 2, 3. 
 
Devs: The file in question that would need change would be ExileClient_util_canBuildhere.sqf or something. Midway through at select (getVariable ["Territorylevel", 0]) just do -1 after the last ) and it would be working fine!
 
If anyone can reproduce this on their own server that would be great!
 
I hope I made some sense, if anyone needs clarification let me know..
 
Sorry for any errors.. This was typed on my phone!
1 person likes this

Share this post


Link to post
Share on other sites

Looks like this is the code in question from ExileClient_util_world_canBuildHere.sqf

		{
			_radius = _x getVariable ["ExileTerritorySize", -1];
			if (((AGLtoASL _position) distance (getPosASL _x)) < _radius) then
			{
				_buildRights = _x getVariable ["ExileTerritoryBuildRights", []];
				if (_playerUID in _buildRights) then
				{
					_territoryLevelConfigs = getArray (missionConfigFile >> "CfgTerritories" >> "prices");
					_territoryLevelConfig = _territoryLevelConfigs select (_x getVariable ["ExileTerritoryLevel", 0]);
					_numberOfConstructionsAllowed = _territoryLevelConfig select 2;
					if ((_x getVariable ["ExileTerritoryNumberOfConstructions", 0]) >= _numberOfConstructionsAllowed) then
					{
						throw 6; 
					};
					throw 0;
				};
			};
			throw 2;
		}

 

Share this post


Link to post
Share on other sites
Advertisement
11 minutes ago, CEN said:

Looks like this is the code in question from ExileClient_util_world_canBuildHere.sqf


		{
			_radius = _x getVariable ["ExileTerritorySize", -1];
			if (((AGLtoASL _position) distance (getPosASL _x)) < _radius) then
			{
				_buildRights = _x getVariable ["ExileTerritoryBuildRights", []];
				if (_playerUID in _buildRights) then
				{
					_territoryLevelConfigs = getArray (missionConfigFile >> "CfgTerritories" >> "prices");
					_territoryLevelConfig = _territoryLevelConfigs select (_x getVariable ["ExileTerritoryLevel", 0]);
					_numberOfConstructionsAllowed = _territoryLevelConfig select 2;
					if ((_x getVariable ["ExileTerritoryNumberOfConstructions", 0]) >= _numberOfConstructionsAllowed) then
					{
						throw 6; 
					};
					throw 0;
				};
			};
			throw 2;
		}

 

That would be it!

The line here... Needs to be one level lower, maybe -1 at the end or something

_territoryLevelConfigs select (_x getVariable ["ExileTerritoryLevel", 0]);

Share this post


Link to post
Share on other sites
Advertisement
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.