HellBz

[Release] Limited Safe,Crate,Tent and SupplyBoxes per Base Level

20 posts in this topic

7 minutes ago, HellBz said:

The Server Side File
ExileServer_object_construction_network_buildConstructionRequest
Calls in Line 25 This File from Client:


_canBuildHereResult = [configName _constructionConfig, (ASLtoAGL (ATLtoASL _objectPosition)), getPlayerUID _playerObject] call ExileClient_util_world_canBuildHere;


and the Result are The Throws ;)
And in LIne 81 the Exile Toast.

i Hope i can Help You @Alexis

I did in ExileClient_object_item_construct, I had everything the client thought, without questions to the server

Share this post


Link to post
Share on other sites

Nice modify btw, love it.

 

@HellBz

 

2 suggestions for config.cpp on github, since lot of users not aware of syntax and stuff.:

class CfgTerritories
{
	// Base Cost / Radius
	// Level 1 is allways for Pop Tabs, >= 2 for Respect
	prices[] = 
	{
		// Purchase Price       Radius      Number of Objects   Number of Safes     Number of Boxes     Number of Crates    Number of Tents
		{5000,                  15,         30,                 5,                  1,                   5,                   5                   }, // Level 1
		{10000,                 30,         60,                 7,                  2,                   5,                   5                   }, // Level 2 
		{15000,                 45,         90,                 9,                  3,                   5,                   5                   }, // Level 3
		{20000,                 60,         120,                11,                 4,                   5,                   5                   }, // Level 4
		{25000,                 75,         150,                14,                 5,                   10,                  10                  }, // Level 5
		{30000,                 90,         180,                16,                 6,                   10,                  10                  }, // Level 6
		{35000,                 105,        210,                18,                 7,                   10,                  10                  }, // Level 7
		{40000,                 120,        240,                20,                 8,                   15,                  15                  }, // Level 8
		{45000,                 135,        270,                22,                 9,                   15,                  15                  }, // Level 9
		{50000,                 150,        300,                25,                 10,                  15,                  15                  }  // Level 10
	};
};

 the last bracket here could really missleading some ppl, by just copy and paste that into their config.cpp. Same might go for the interaction - if you know what i mean :) Just a thought tho.

Edited by WURSTKETTE

Share this post


Link to post
Share on other sites
Advertisement

Thanks, I have just stated a new server and this is one of the first things am going to add in. ;)

 

Tested and works awesome!!

Edited by kidesh

Share this post


Link to post
Share on other sites

Could this wok by adding persistent  Mines into this?

This would be an awesome idea if it could be added in for base defences for when players are offline. 

Spoiler

class CfgTerritories
{
	// Base Cost / Radius
	// Level 1 is allways for Pop Tabs, >= 2 for Respect
	prices[] = 
	{
        // Purchase Price       Radius      Number of Objects   Number of Safes     Number of Boxes      Number of Crates     Number of Tents	Number of Mines
        {5000,                  15,         50,                 5,                  1,                   5,                   5                 2 					}, // Level 1
        {10000,                 30,         70,                 7,                  2,                   5,                   5                 4  					}, // Level 2 
        {15000,                 45,         110,                9,                 	3,                 	 5,                	  5                 6  					}, // Level 3
        {20000,                 60,         130,                11,                 4,                   5,                   5                 8 					}, // Level 4
        {25000,                 75,         170,                14,                 5,                   10,                  10                10  				}, // Level 5
        {30000,                 90,         190,                16,                 6,                   10,                  10                12				  	}, // Level 6
        {35000,                 105,        250,                18,                 7,                   10,                  10                14 					}, // Level 7
        {40000,                 120,        290,                20,                 8,                   15,                  15                16 					}, // Level 8
        {45000,                 135,        310,                22,                 9,                   15,                  15                18 					}, // Level 9
        {50000,                 150,        600,                25,                 10,                  15,                  15                20  				}  // Level 10
    };

 

 

Maybe something like this but obviously it would need code back it up?

But also could mines be made persistent?  

Edited by kidesh

Share this post


Link to post
Share on other sites
On 8/25/2017 at 3:17 PM, kidesh said:

Could this wok by adding persistent  Mines into this?

This would be an awesome idea if it could be added in for base defences for when players are offline. 

  Hide contents


class CfgTerritories
{
	// Base Cost / Radius
	// Level 1 is allways for Pop Tabs, >= 2 for Respect
	prices[] = 
	{
        // Purchase Price       Radius      Number of Objects   Number of Safes     Number of Boxes      Number of Crates     Number of Tents	Number of Mines
        {5000,                  15,         50,                 5,                  1,                   5,                   5                 2 					}, // Level 1
        {10000,                 30,         70,                 7,                  2,                   5,                   5                 4  					}, // Level 2 
        {15000,                 45,         110,                9,                 	3,                 	 5,                	  5                 6  					}, // Level 3
        {20000,                 60,         130,                11,                 4,                   5,                   5                 8 					}, // Level 4
        {25000,                 75,         170,                14,                 5,                   10,                  10                10  				}, // Level 5
        {30000,                 90,         190,                16,                 6,                   10,                  10                12				  	}, // Level 6
        {35000,                 105,        250,                18,                 7,                   10,                  10                14 					}, // Level 7
        {40000,                 120,        290,                20,                 8,                   15,                  15                16 					}, // Level 8
        {45000,                 135,        310,                22,                 9,                   15,                  15                18 					}, // Level 9
        {50000,                 150,        600,                25,                 10,                  15,                  15                20  				}  // Level 10
    };

 

 

Maybe something like this but obviously it would need code back it up?

But also could mines be made persistent?  

Mines be Only by Players,
if the Player Disconnects, de Mine will be despawn.

Will not Work.. i Think

Share this post


Link to post
Share on other sites

Thanks @HellBz great work. I think the script broke after the last Exile update with the "build here" call & they added a construction cool down timer during base raiding.

I found new players couldnt build it gave an error, "cannot build while in enemy territory" after they placed a flag.

I updated the script & everything works now:

ExileServer_object_construction_network_buildConstructionRequest.sqf

Spoiler

/**
 * ExileServer_object_construction_network_buildConstructionRequest
 *
 * 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["_sessionID", "_parameters", "_objectClassName", "_objectPosition", "_playerObject", "_constructionConfig", "_canBuildHereResult", "_flag", "_lastAttackedAt", "_constructionBlockDuration", "_object"];
_sessionID = _this select 0;
_parameters = _this select 1;
_objectClassName = _parameters select 0;
_objectPosition = _parameters select 1;
try
{
    _playerObject = _sessionID call ExileServer_system_session_getPlayerObject;
    if (isNull _playerObject) then 
    {
        throw "Player object is null!";
    };
    _constructionConfig = ("getText(_x >> 'previewObject') == _objectClassName" configClasses(configFile >> "CfgConstruction")) select 0;
    _canBuildHereResult = [configName _constructionConfig, ATLtoASL _objectPosition, getPlayerUID _playerObject] call ExileClient_util_world_canBuildHere;
    switch (_canBuildHereResult) do
    {
        case 1:
        {
            throw "You are not in your territory.";
        };
        case 11:
        {
            throw "You are too close to a concrete mixer.";
        };
        case 10:
        {
            throw "Building is blocked here.";
        };
        case 2:
        {
            throw "You are inside enemy territory.";
        };
        case 8:
        {
            throw "You are in a contaminated zone.";
        };
        case 3:
        {
            throw "This cannot be placed on roads.";
        };
        case 5:
        {
            throw "You are too close to a spawn zone.";
        };
        case 4:
        {
            throw "You are too close to traders.";
        };
        case 6:
        {
            throw "Maximum number of objects reached.";
        };
        case 7:
        {
            throw "This snap location is already being used.";
        };
        case 100:
        {
        throw "Maximum number of Safes reached.";
        };
        case 101:
        {
        throw "Maximum number of Storage Crates reached.";
        };
        case 102:
        {
        throw "Maximum number of Camo Tents reached.";
        };
    };
    _flag = _objectPosition call ExileClient_util_world_getTerritoryAtPosition;
    if !(isNull _flag) then
    {
        _lastAttackedAt = _flag getVariable ["ExileLastAttackAt", false];
        if !(_lastAttackedAt isEqualTo false) then 
        {
            _constructionBlockDuration = getNumber (missionConfigFile >> "CfgTerritories" >> "constructionBlockDuration");
            if (time - _lastAttackedAt < _constructionBlockDuration * 60) then
            {
                throw (format ["Territory has been under attack within the last %1 minutes.", _constructionBlockDuration]);
            };
        };
    };    
    _object = createVehicle[_objectClassName, _objectPosition, [], 0, "CAN_COLLIDE"];
    _object setPosATL _objectPosition;
    _object setVariable ["BIS_enableRandomization", false];
    _object setOwner (owner _playerObject);
    _object enableSimulationGlobal false;
    _object setVariable ["ExileOwnerUID", getPlayerUID _playerObject];
    _playerObject setVariable ["ExileConstructionObject", _object];
    [_object, _playerObject] call ExileServer_system_swapOwnershipQueue_add;
    [_sessionID, "constructionResponse", [netid _object]] call ExileServer_system_network_send_to;
}
catch
{
    [_sessionID, "toastRequest", ["ErrorTitleAndText", ["Construction aborted!", _exception]]] call ExileServer_system_network_send_to;
};
true
 

Thanks again for this great addition. I had one player that build a base wall just out of safes. This will put an end to that shit.

Edited by aussie battler
  • Like 1

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.