Dwarfer

Disable Building In Some Areas / Near Objects

48 posts in this topic

8 hours ago, BetterDeadThanZed said:

Doesn't matter, as you can place a no build zone in the editor now with the Exile Eden plugin. Problem solved! 

What! I'll check that out..

 

Share this post


Link to post
Share on other sites
Advertisement
11 hours ago, Crazy Mike said:

basically this is what exiles addon to the editor will produce


class Item1 //<-- Changethis 
	    {
	        position[]={1976,0,9138};
	        name = "ExileMarker45";
	        text = "";
	        markerType = "ELLIPSE";
	        type = "ExileNonConstructionZone";
	        colorName = "ColorBlack";
	        fillName = "Border";
	        alpha = 0;
	        a = 1500;
	        b = 1500;
	        drawBorder = 1;
	        id = 145;
	        atlOffset = 0;
	    };

 

you dont even need to use the editor for your mission.sqm as the vanilla exile mission files altis tanoa namalsk ALL contain every single marker exile has, you just need to copy them, replace the coordinates and put them in your new mission.sqm, but you can also create the entire mission, initserver, and initplayer from the editor in one go aswell, (ill advised if you lose the file and need to make small changes)

Thanks for that. 
So is the only important part of that :

type = "ExileNonConstructionZone";

Or am I limited to all those parameters?

Share this post


Link to post
Share on other sites

There seems to be several options to the problem. Has anyone used this with 1.0.2, and the latest updates?

What would be the easiest (headache free, if there is such a thing :D) to prevent building in certain areas?
The thing is, if you use the "prevent building near certain objects", and you use the Extended Base Mod, and you add one of those
objects to your base, now what? You can't build in your own base? Maybe I'm over thinking this.

All I'm trying to avoid, is guys building bases by attaching onto existing buildings, and thus reducing the amount of areas where loot spawns.

I could just make a rule that any flags within 400m of any existing building will be deleted by an admin. But, that's just more work of finding them.

o.O

Share this post


Link to post
Share on other sites

Ok. I'm still struggling with this (big time). :(

Here's the the code I used in the sqf file. But, like I mentioned, there are many version of this floating around, and I'm not
sure which will work with the latest version of Exile / and Arma, with Tanoa.

Spoiler

/**
 * 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["_itemClassName","_cantBuildNear"];
_itemClassName = _this select 0;
if( isClass(configFile >> "CfgMagazines" >> _itemClassName >> "Interactions" >> "Constructing") ) then
{
    if (findDisplay 602 != displayNull) then
    {
        (findDisplay 602) closeDisplay 2;
    };
    try
    {
        if !((vehicle player) isEqualTo player) then { throw "ConstructionVehicleWarning"; };
        if ((getPosATL player) call ExileClient_util_world_isTraderZoneNearby) then { throw "ConstructionTraderZoneWarning"; };
        if ((getPosATL player) call ExileClient_util_world_isSpawnZoneNearby) then { throw "ConstructionSpawnZoneWarning"; };

        //Stops Building In Towns
        _cnt = count nearestLocations [getPosATL player, ["NameVillage","NameCity","NameCityCapital"], 500];
        if (_cnt > 0 ) then { throw "ConstructionAbortedInformation"; };        
        
        /* PREVENT BUILDING NEAR CERTAIN TYPES OF BUILDING */
        _cantBuildNear = [
            "Land_Dome_Big_F",
            "Land_Dome_Small_F",
            "Land_Barracks_ruins_F",
            "Land_i_Barracks_V1_F",
            "Land_i_Barracks_V1_dam_F",
            "Land_i_Barracks_V2_F",
            "Land_i_Barracks_V2_dam_F",
            "Land_u_Barracks_V2_F",
            "Land_Hospital_main_F",
            "Land_Hospital_side1_F",
            "Land_Hospital_side2_F",
            "Land_MilOffices_V1_F",
            "Land_TentHangar_V1_F",
            "Land_Hangar_F",
            "Land_Airport_Tower_F",
            "Land_Cargo_House_V1_F",
            "Land_Cargo_House_V3_F",
            "Land_Cargo_HQ_V1_F",
            "Land_Cargo_HQ_V2_F",
            "Land_Cargo_HQ_V3_F",
            "Land_Cargo_Patrol_V1_F",
            "Land_Cargo_Patrol_V2_F",
            "Land_Cargo_Tower_V1_F",
            "Land_Cargo_Tower_V1_No1_F",
            "Land_Cargo_Tower_V1_No2_F",
            "Land_Cargo_Tower_V1_No3_F",
            "Land_Cargo_Tower_V1_No4_F",
            "Land_Cargo_Tower_V1_No5_F",
            "Land_Cargo_Tower_V1_No6_F",
            "Land_Cargo_Tower_V1_No7_F",
            "Land_Cargo_Tower_V2_F",
            "Land_Cargo_Tower_V3_F",
            "Land_Radar_F"
        ];
        _cantBuildDist = 500;
        if ({typeOf _x in _cantBuildNear} count nearestObjects[player, _cantBuildNear, _cantBuildDist] > 0) then { throw "ConstructionAbortedInformation"; };
        
        /* PREVENT BUILDING NEAR KEY MILITARY AND INDUSTRIAL LOCATIONS */

/* The following coords are for a small town in Tanoa for testing purposes*/
        if ((player distance [7429.49,8535.95, 0]) < 500) then { throw "ConstructionAbortedInformation"; };
       
        /* PREVENT BUILDING ON ROADS */
        if (isOnRoad getPosATL player) then { throw "ConstructionAbortedInformation"; };         

        if(_itemClassName isEqualTo "Exile_Item_Flag") then { throw "FLAG"; };
        [_itemClassName] call ExileClient_construction_beginNewObject;
    }
    catch
    {
        if(_exception isEqualTo "FLAG")then
        {
            call ExileClient_gui_setupTerritoryDialog_show;
        }
        else
        {
            if(_exception isEqualTo "ConstructionAbortedInformation")then{
                [_exception,"Building Permit Denied"] call ExileClient_gui_notification_event_addNotification;
            }else{
                [_exception] call ExileClient_gui_notification_event_addNotification;
            };
        };    
    };
};
true

So, I put in some coords for a small town in Tanoa. And I can't put a flag down there, so I know i'm close. But, it does not show
that the construction was aborted, nor does it give a reason why you can't build there.

Also, I was able to put a flag right by a concrete mixer. So I don't believe this to work for the latest Exile and Arma.

Basically, running the Tanoa map. And I wish to prevent building near the typical places (concrete mixer, trader, spawn, etc).
Only, in addition, I wish to prevent building in towns, cities, industrial areas, etc.

Ultimately my goal is to prevent anyone from building in areas that spawn loot.

If I restrict building near buildings and objects instead, what will end up happening when someone uses Extended Mod base to build,
is that if they place an object or building that you are prevented from building by, they will no longer be able to build anymore on their base.

Anyone using Tano, that has implemented something like this, that will also give reason why you weren't allowed to build, that works?

Edited by 5niper

Share this post


Link to post
Share on other sites

This is the closest thing I have found, for what I need, that works with the latest Exile, Arma, Apex Tanoa.

http://pastebin.com/3wudN2sM

Spoiler

/**
 * ExileClient_object_item_construct
 *
 * 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["_itemClassName","_minimumDistanceToTraderZones","_minimumDistanceToSpawnZones","_maximumNumberOfTerritoriesPerPlayer","_numberOfTerritories"];
_itemClassName = _this select 0;
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
    {
        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.";
        };
        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.";
        };
        ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////        
        // PREVENT BUILDING NEAR MILITARY

        
        _cantBuildNear  = [    "Land_TentHangar_V1_F","Land_Hangar_F","Land_Airport_Tower_F","Land_Cargo_House_V1_F",
                            "Land_Cargo_House_V3_F","Land_Cargo_HQ_V1_F","Land_Cargo_HQ_V2_F","Land_Cargo_HQ_V3_F",
                            "Land_u_Barracks_V2_F","Land_i_Barracks_V2_F","Land_i_Barracks_V1_F","Land_Cargo_Patrol_V1_F",
                            "Land_Cargo_Patrol_V2_F","Land_Cargo_Tower_V1_F","Land_Cargo_Tower_V1_No1_F","Land_Cargo_Tower_V1_No2_F",
                            "Land_Cargo_Tower_V1_No3_F","Land_Cargo_Tower_V1_No4_F","Land_Cargo_Tower_V1_No5_F","Land_Cargo_Tower_V1_No6_F",
                            "Land_Cargo_Tower_V1_No7_F","Land_Cargo_Tower_V2_F","Land_Cargo_Tower_V3_F","Land_MilOffices_V1_F",
                            "Land_Radar_F","Land_budova4_winter","land_hlaska","Land_Vysilac_FM","land_st_vez","Land_ns_Jbad_Mil_Barracks",
                            "Land_ns_Jbad_Mil_ControlTower","Land_ns_Jbad_Mil_House","land_pozorovatelna","Land_vys_budova_p1",
                            "Land_Vez","Land_Mil_Barracks_i","Land_Mil_Barracks_L","Land_Mil_Barracks",
                            "Land_Hlidac_budka","Land_Ss_hangar","Land_Mil_ControlTower","Land_a_stationhouse",
                            "Land_Farm_WTower","Land_Mil_Guardhouse","Land_A_statue01","Land_A_Castle_Gate",
                            "Land_A_Castle_Donjon","Land_A_Castle_Wall2_30","Land_A_Castle_Stairs_A",
                            "Land_i_Barracks_V1_dam_F","Land_Cargo_Patrol_V3_F","Land_Radar_Small_F","Land_Dome_Big_F",
                            "Land_Dome_Small_F","Land_Army_hut3_long_int","Land_Army_hut_int","Land_Army_hut2_int",
                            // Additional Buildings
                            "Land_Barracks_01_camo_F","Land_Barracks_01_grey_F","land_AII_last_floor","land_AII_middle_floor",
                            "land_AII_upper_part","Land_Ind_IlluminantTower","Land_Misc_deerstand","Land_ns_Jbad_A_Stationhouse",
                            "Land_Airport_01_controlTower_F","Land_Airport_01_terminal_F","Land_Airport_02_controlTower_F",
                            "Land_Airport_02_terminal_F","Land_Cargo_House_V4_F","Land_Cargo_HQ_V4_F","Land_Cargo_Patrol_V4_F",
                            "Land_Cargo_Tower_V4_F"
                        ];         

        // PREVENT BUILDING NEAR ROADS
        _NearRoad = (position player) nearRoads 15;
        _TooNearRoads = _NearRoad select 0;
        if (!isNil "_TooNearRoads") then { throw "You cannot build too close to roads"; };          
        
        // PREVENT BUILDING NEAR AI BASE
        _AIBasepos = [0,0,0];
        _MinRange = 1;
        
        if(worldName == 'Altis')then
        {
            _AIBasepos = [12571,14337,0]; // Location of AI Base Mission
            _MinRange = 1250; // Min distance to AI Base
            _cantBuildDist = 200; // Min distance to military buildings
            _maxSafes = 5;
            _nearAIBase = (getPosATL player) distance _AIBasepos;
            if (_nearAIBase < _MinRange) then {    throw "You cannot build near the AI base"; };                    
        };
        if(worldName == 'Chernarus')then
        {
            _AIBasepos = [3810,8887,0]; // Location of AI Base Mission
            _MinRange = 1100; // Min distance to AI Base
            _cantBuildDist = 200; // Min distance to military buildings
            _maxSafes = 5;
            _nearPVPZone = (getPosATL player) distance [1174,2516,0];
            if (_nearPVPZone < 1000) then {    throw "You cannot build too close to the PVP zone"; };
            _nearAIBase = (getPosATL player) distance _AIBasepos;
            if (_nearAIBase < _MinRange) then {    throw "You cannot build near the AI base"; };                    
        };
        if(worldName == 'Namalsk')then
        {
            _AIBasepos = [3926,7523,0]; // Location of AI Base Mission
            _MinRange = 750; // Min distance to AI Base
            _cantBuildDist = 250; // Min distance to military buildings
            _maxSafes = 5;
            _nearAIBase = (getPosATL player) distance _AIBasepos;
            if (_nearAIBase < _MinRange) then {    throw "You cannot build near the AI base"; };                    
        };
        if(worldName == 'Napf')then
        {
            _AIBasepos = [2377,7710,0];     // Location of AI Base Mission
            _MinRange = 1250;                 // Min distance to AI Base
            _cantBuildDist = 350;             // Min distance to military buildings
            _maxSafes = 2;        
            _nearAIBase = (getPosATL player) distance _AIBasepos;
            if (_nearAIBase < _MinRange) then {    throw "You cannot build near the AI base"; };            
        };
        if(worldName == 'Tanoa')then
        {
            _AIBasepos = [0,0,0];
            _MinRange = 1;
            _cantBuildDist = 200; // Min distance to military buildings
            _maxSafes = 5;                
        };    
    
        
        if ({typeOf _x in _cantBuildNear} count nearestObjects[player, _cantBuildNear, _cantBuildDist] > 0) then { throw "You cannot build within 500m of military buildings"; };

        if(_itemClassName isEqualTo "Exile_Container_Safe") then
        {
            //Check if _maxSafes safes in range already
            _nearSafes = count (player nearObjects ["Exile_Container_Safe", 150]);
            if (_nearSafes > (_maxSafes - 1)) then { throw "You cannot build more than 5 safes";  };            
        };            
        
        ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////        

        
        if(_itemClassName isEqualTo "Exile_Item_Flag") then
        {
            if([position player, 300] call ExileClient_util_world_isTerritoryInRange) then { throw "You are too close to another territory"; };
            _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


Actually, close to perfection. :D

Nice Job @second_coming 

Edited by 5niper

Share this post


Link to post
Share on other sites
On 12/13/2016 at 10:43 PM, 5niper said:

This is the closest thing I have found, for what I need, that works with the latest Exile, Arma, Apex Tanoa.

http://pastebin.com/3wudN2sM

  Reveal hidden contents

/**
 * ExileClient_object_item_construct
 *
 * 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["_itemClassName","_minimumDistanceToTraderZones","_minimumDistanceToSpawnZones","_maximumNumberOfTerritoriesPerPlayer","_numberOfTerritories"];
_itemClassName = _this select 0;
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
    {
        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.";
        };
        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.";
        };
        ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////        
        // PREVENT BUILDING NEAR MILITARY

        
        _cantBuildNear  = [    "Land_TentHangar_V1_F","Land_Hangar_F","Land_Airport_Tower_F","Land_Cargo_House_V1_F",
                            "Land_Cargo_House_V3_F","Land_Cargo_HQ_V1_F","Land_Cargo_HQ_V2_F","Land_Cargo_HQ_V3_F",
                            "Land_u_Barracks_V2_F","Land_i_Barracks_V2_F","Land_i_Barracks_V1_F","Land_Cargo_Patrol_V1_F",
                            "Land_Cargo_Patrol_V2_F","Land_Cargo_Tower_V1_F","Land_Cargo_Tower_V1_No1_F","Land_Cargo_Tower_V1_No2_F",
                            "Land_Cargo_Tower_V1_No3_F","Land_Cargo_Tower_V1_No4_F","Land_Cargo_Tower_V1_No5_F","Land_Cargo_Tower_V1_No6_F",
                            "Land_Cargo_Tower_V1_No7_F","Land_Cargo_Tower_V2_F","Land_Cargo_Tower_V3_F","Land_MilOffices_V1_F",
                            "Land_Radar_F","Land_budova4_winter","land_hlaska","Land_Vysilac_FM","land_st_vez","Land_ns_Jbad_Mil_Barracks",
                            "Land_ns_Jbad_Mil_ControlTower","Land_ns_Jbad_Mil_House","land_pozorovatelna","Land_vys_budova_p1",
                            "Land_Vez","Land_Mil_Barracks_i","Land_Mil_Barracks_L","Land_Mil_Barracks",
                            "Land_Hlidac_budka","Land_Ss_hangar","Land_Mil_ControlTower","Land_a_stationhouse",
                            "Land_Farm_WTower","Land_Mil_Guardhouse","Land_A_statue01","Land_A_Castle_Gate",
                            "Land_A_Castle_Donjon","Land_A_Castle_Wall2_30","Land_A_Castle_Stairs_A",
                            "Land_i_Barracks_V1_dam_F","Land_Cargo_Patrol_V3_F","Land_Radar_Small_F","Land_Dome_Big_F",
                            "Land_Dome_Small_F","Land_Army_hut3_long_int","Land_Army_hut_int","Land_Army_hut2_int",
                            // Additional Buildings
                            "Land_Barracks_01_camo_F","Land_Barracks_01_grey_F","land_AII_last_floor","land_AII_middle_floor",
                            "land_AII_upper_part","Land_Ind_IlluminantTower","Land_Misc_deerstand","Land_ns_Jbad_A_Stationhouse",
                            "Land_Airport_01_controlTower_F","Land_Airport_01_terminal_F","Land_Airport_02_controlTower_F",
                            "Land_Airport_02_terminal_F","Land_Cargo_House_V4_F","Land_Cargo_HQ_V4_F","Land_Cargo_Patrol_V4_F",
                            "Land_Cargo_Tower_V4_F"
                        ];         

        // PREVENT BUILDING NEAR ROADS
        _NearRoad = (position player) nearRoads 15;
        _TooNearRoads = _NearRoad select 0;
        if (!isNil "_TooNearRoads") then { throw "You cannot build too close to roads"; };          
        
        // PREVENT BUILDING NEAR AI BASE
        _AIBasepos = [0,0,0];
        _MinRange = 1;
        
        if(worldName == 'Altis')then
        {
            _AIBasepos = [12571,14337,0]; // Location of AI Base Mission
            _MinRange = 1250; // Min distance to AI Base
            _cantBuildDist = 200; // Min distance to military buildings
            _maxSafes = 5;
            _nearAIBase = (getPosATL player) distance _AIBasepos;
            if (_nearAIBase < _MinRange) then {    throw "You cannot build near the AI base"; };                    
        };
        if(worldName == 'Chernarus')then
        {
            _AIBasepos = [3810,8887,0]; // Location of AI Base Mission
            _MinRange = 1100; // Min distance to AI Base
            _cantBuildDist = 200; // Min distance to military buildings
            _maxSafes = 5;
            _nearPVPZone = (getPosATL player) distance [1174,2516,0];
            if (_nearPVPZone < 1000) then {    throw "You cannot build too close to the PVP zone"; };
            _nearAIBase = (getPosATL player) distance _AIBasepos;
            if (_nearAIBase < _MinRange) then {    throw "You cannot build near the AI base"; };                    
        };
        if(worldName == 'Namalsk')then
        {
            _AIBasepos = [3926,7523,0]; // Location of AI Base Mission
            _MinRange = 750; // Min distance to AI Base
            _cantBuildDist = 250; // Min distance to military buildings
            _maxSafes = 5;
            _nearAIBase = (getPosATL player) distance _AIBasepos;
            if (_nearAIBase < _MinRange) then {    throw "You cannot build near the AI base"; };                    
        };
        if(worldName == 'Napf')then
        {
            _AIBasepos = [2377,7710,0];     // Location of AI Base Mission
            _MinRange = 1250;                 // Min distance to AI Base
            _cantBuildDist = 350;             // Min distance to military buildings
            _maxSafes = 2;        
            _nearAIBase = (getPosATL player) distance _AIBasepos;
            if (_nearAIBase < _MinRange) then {    throw "You cannot build near the AI base"; };            
        };
        if(worldName == 'Tanoa')then
        {
            _AIBasepos = [0,0,0];
            _MinRange = 1;
            _cantBuildDist = 200; // Min distance to military buildings
            _maxSafes = 5;                
        };    
    
        
        if ({typeOf _x in _cantBuildNear} count nearestObjects[player, _cantBuildNear, _cantBuildDist] > 0) then { throw "You cannot build within 500m of military buildings"; };

        if(_itemClassName isEqualTo "Exile_Container_Safe") then
        {
            //Check if _maxSafes safes in range already
            _nearSafes = count (player nearObjects ["Exile_Container_Safe", 150]);
            if (_nearSafes > (_maxSafes - 1)) then { throw "You cannot build more than 5 safes";  };            
        };            
        
        ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////        

        
        if(_itemClassName isEqualTo "Exile_Item_Flag") then
        {
            if([position player, 300] call ExileClient_util_world_isTerritoryInRange) then { throw "You are too close to another territory"; };
            _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


Actually, close to perfection. :D

Nice Job @second_coming 

i tried this and the only thing that didnt work is the not building near military buildings. here a pastebin of what i have in: https://pastebin.com/YGdJCcE7 i dont know if im missing anything your not

Share this post


Link to post
Share on other sites

@]TPG[ Spectre this is an old post. What is it you are trying to accomplish?
If you want to disallow building in a certain area, easiest way (today) is probably to use this:

Spoiler

  class Item26 //added for disallowing building near "enter your base name here"
        {
            dataType = "Marker";
            position[] = {23300, 0, 18800};
            name = "AIBaseMission";
            text = "AI Base Mission";
            markerType = "ELLIPSE";
            type = "ExileNonConstructionZone";
            colorName = "ColorBlack";
            fillName = "Border";
            alpha = 0;
            a = 800;
            b = 800;
            drawBorder = 1;
            id = 100;
            atlOffset = 0;
        };
      

Just add this to your mission.sqm
*note: class item number has to be changed to the number of "items= "  +1, and the name="AIBaseMission" has to be unique in case you're
adding this code multiple times.

Remember that if you use a different method, like disallowing building around a particular building class name, it will disallow it
for anywhere on the map that building is located. Some people who use extended base mod will add a military building or such,
and next thing you know, they can't figure out why they can't build there any longer after placing it.

  • Like 2

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.