Jump to content
dlegion

make an array with all buildings

Recommended Posts

hello guys...i'm trying to make an array with all buildings avaible in arma3...how can this be done ?
for example i'm actually making an array with all units of a side like this:

_allINDEPENDENT = "(getNumber (_x >> 'scope') == 2) and {(getNumber (_x >> 'side') == 2)}" configClasses (configFile >> "CfgVehicles");

...but i dont know how make it for buildings!

thanks for any idea!

  • Like 1

Share this post


Link to post
Share on other sites

...well its a bit extreme, but this works :
_allHouses = "true" configClasses (configFile >> "CfgVehicles");

_allHouses = "true" configClasses (configFile >> "CfgVehicles");

while i still search suggestion for a more efficient way, like filtering only "houseBase" , the next problem is how get the object from this array of configs, to use it to scan for "buildingpos ".
thanks for any help!

Share this post


Link to post
Share on other sites

What are you trying to do?

If you want to access building positions just use the buildingPos command, way faster than storing all buildings and positions in an array, if that's what you want to do.

 

Cheers

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

heyy GOM !
well i'm trying to define an array with all buildings avaible in game, filter them so they are enterable (have buildingpos > 0 i suppose),
then spawn a randomly choosen building , and populate it!
thanks for your interest!

Share this post


Link to post
Share on other sites

i've menaged to get the result, but its horribly optimized, i need to filter in the initial array only the house buildings (right now it use EVERY thing in game!)
 

//if (isServer) then {

KILLhouse = TRUE;
//KILLhouse = FALSE;
_allHouses = "true" configClasses (configFile >> "CfgVehicles");       // WORKS
_allINDEP = "(getNumber (_x >> 'scope') == 2) and {(getNumber (_x >> 'side') == 2)} and {configName _x isKindOf 'CAManBase'}" configClasses (configFile >> "CfgVehicles");
_countH = count _allHOUSES;str (_countH) + " HOUSES IN ARRAY" remoteExecCall ["hint"];       // DEBUG
uiSleep 2;

while {uiSleep 0.5;TRUE} do {
if (KILLhouse) then {
   _HtypeN = selectRandom _allHOUSES;
   _Htype = configName _HtypeN;
   _HtypeA = [_Htype];

   _house = _Htype createVehicle (getpos housePOS);

   _Bpos = _TEMPhouse buildingPos -1;
   _Bpp = count _Bpos;
   if (_Bpp > 4) then {
      KILLHOUSE = FALSE;

{
_DtypeN = selectRandom _allINDEP;_Dtype = configName _DtypeN;_DtypeA = [_Dtype];
if (_Dtype isKindOf "CAManBase") then {

   _Mactive = selectRandom _Bpos;
   _Tgrp = [getposATL _Mactive, EAST,_DtypeA,[],[],[],[],[],(random 360)] call BIS_fnc_spawnGroup;
   {_x setVariable ["NOT_remove",true,false];(vehicle _x) setVariable ["NOT_remove",true,false];} forEach (units _Tgrp);
   _Tgrp deleteGroupWhenEmpty true;
   {_x disableAI "PATH";_x setUnitPos "MIDDLE";if ((random 5) < 3) then {_x setUnitPos "UP"};} foreach (units _Tgrp);

};        // if - then CLOSE
} count _Bpos;

} else {uiSleep 0.5;deleteVehicle _TEMPhouse};       // if _Bpp > 4 then   CLOSE

};       // if KILLhouse  CLOSE
};       // while CLOSE
//};       // if ISserver CLOSE

 

Share this post


Link to post
Share on other sites
12 minutes ago, dlegion said:

heyy GOM !
well i'm trying to define an array with all buildings avaible in game, filter them so they are enterable (have buildingpos > 0 i suppose),
then spawn a randomly choosen building , and populate it!
thanks for your interest!

Well all houses/buildings are vehicles, so you need to filter CfgVehicles accordingly:

 

_allHouses = "configName _x isKindOf 'House'" configClasses (configFile >> "CfgVehicles");

You need to filter for either "House" or "Building", since one of them has positions, the other has not.

You can also filter current objects on the map, in case you run with mods and don't want to spawn a mosque in Chernarus.

 

Cheers

  • Like 1
  • Thanks 2

Share this post


Link to post
Share on other sites

thanks GOM !
you nailed it perfectly!
it works like a charm , really thanks man !

Share this post


Link to post
Share on other sites

to make the script more efficient, i wish to know if is possible discriminate the buildings that have more than 4 "buildingPos" before actually create them and count...
here is my full script:
 

Spoiler

if (isServer) then {

if (KILLhouse) then {

{if (!isNil {_x getVariable "killH"}) then {deleteVehicle _x};} forEach (allMissionObjects "");

//KILLhouse = TRUE;
//_allHouses = "true" configClasses (configFile >> "CfgVehicles");       // WORKS
_allHouses = "configName _x isKindOf 'HouseBase'" configClasses (configFile >> "CfgVehicles");

_allINDEP = "(getNumber (_x >> 'scope') == 2) and {(getNumber (_x >> 'side') == 2)} and {configName _x isKindOf 'CAManBase'}" configClasses (configFile >> "CfgVehicles");
_countH = count _allHOUSES;str (_countH) + " HOUSES IN ARRAY" remoteExecCall ["hint"];       // DEBUG
uiSleep 2;

while {uiSleep 0.3;KILLhouse} do {
if (KILLhouse) then {

   _HtypeN = selectRandom _allHOUSES;
   _Htype = configName _HtypeN;
   _HtypeA = [_Htype];

   _house = _Htype createVehicle (getpos housePOS);
   _house setVariable ["killH",true,false];

   _Bpos = _house buildingPos -1;
   _Bpp = count _Bpos;
   if (_Bpp > 4) then {
      KILLHOUSE = FALSE;

{
_DtypeN = selectRandom _allINDEP;_Dtype = configName _DtypeN;_DtypeA = [_Dtype];
if (_Dtype isKindOf "CAManBase") then {

   _Mactive = selectRandom _Bpos;
   _Tgrp = [_Mactive, EAST,_DtypeA,[],[],[],[],[],(random 360)] call BIS_fnc_spawnGroup;
   {_x setVariable ["killH",true,false];(vehicle _x) setVariable ["killH",true,false];} forEach (units _Tgrp);
   _Tgrp deleteGroupWhenEmpty true;
   {_x disableAI "PATH";_x setUnitPos "MIDDLE";if ((random 5) < 3) then {_x setUnitPos "UP"};} foreach (units _Tgrp);

};        // if - then CLOSE
} count _Bpos;

_TA = [];
{if (!isNil {_x getVariable "killH"}) then {_TA pushBack _x};} forEach allUnits;

waitUntil {uiSleep 9;{alive _x} count _TA == 0};
str " KILLHOUSE CLEAR! ...cleaning in 30 seconds!" remoteExecCall ["hint"];

//uiSleep 30;
//if (!KILLhouse) then {{if (!isNil {_x getVariable "killH"}) then {deleteVehicle _x};} forEach (allMissionObjects "");};
//KILLhouse = TRUE;         // comment in DWAR to not spam units

} else {uiSleep 0.3;deleteVehicle _house};       // if _Bpp > 4 then   CLOSE

};       // if KILLhouse  CLOSE
};       // while CLOSE
} else {str "TRAINING KILLHOUSE DISABLED, ask an ADMIN to enable it with: KILLhouse = TRUE; in console!" remoteExecCall ["hint"];};       // if KILLhouse = TRUE then CLOSE
};       // if ISserver CLOSE

 

you may notice that i have to actually spawn an house, then count the buildingPos, and then decide if keep it or repeat process with a random new one. quite inefficient right now :(
thanks !

Share this post


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

to make the script more efficient, i wish to know if is possible discriminate the buildings that have more than 4 "buildingPos" before actually create them and count...
you may notice that i have to actually spawn an house, then count the buildingPos, and then decide if keep it or repeat process with a random new one. quite inefficient right now :(
thanks !

 

No way to grab this from the config, as far as I know.

Try this:

GOM_fnc_buildingsWithPositions = [];
GOM_fnc_grabAllBuildingPositions = {
	_initTime = diag_tickTime;
	_allHouses = "configName _x isKindOf 'HouseBase'" configClasses (configFile >> "CfgVehicles") apply {configName _x};
	_allHouses resize 50;//just for testing, delete this line if you want to check all houses
	systemChat str count _allHouses;
	_allHouses apply {
	_house = _x createVehicle [0,0,0];
	_positions = _house buildingPos -1;
	if (count _positions >= 4) then {GOM_fnc_buildingsWithPositions pushBack _house};
		deleteVehicle _house;
	};
	copyToClipboard str GOM_fnc_buildingsWithPositions;
	systemchat format ["Data evaluated in %1s.",diag_tickTime - _initTime];
};
[] call GOM_fnc_grabAllBuildingPositions;

Be aware this will take forever for around 900 vanilla buildings.

If anyone else knows a way to grab building positions from config would be great to know...

 

Edit: Run this once to get all valid buildings that have more than 3 positions, the array of building classnames will be stored in the clipboard, simply paste it to a file and define it as an array for later in game use.

 

Cheers

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
2 hours ago, Grumpy Old Man said:

Be aware this will take forever for around 900 vanilla buildings.

 

The main idea , is to get all the building positions from the configs or just from the current map in use ?

 

I'm saying this because , why to search the whole configs?

 

 

Share this post


Link to post
Share on other sites

the idea is to get all buildings from config, so it automatically works with any new DLC or MOD.
the problem is that i didnt found the buildingPos setting in config, so the only solution is the one suggested by GOM, 
spawn all building, check each one,  and populate an array with the "good ones".
 

Share this post


Link to post
Share on other sites

the buildingpos are worldposition dependend, they have the world format, not the model format... so i think they can be obtained from only the one building object itself. it returns the absolute map position in positionATL format of the buildingpos. it is converted... like modelToWorld do

 

anyway i think it should not be run by the server everytime... on my rig it takes about 3  seconds to catch about 18,000 buildings (not filtered) on chernarus redux (old version).

its better to make it once for every map by hand.

try to count buildingpos at your array loop and select those u want to be written to the list.

  • Like 1

Share this post


Link to post
Share on other sites

Im not sure of what you mean...there are only around 1100 "houseBase" objects in arma3, to doublecheck i repeat that im not trying to use map buildings, i just need to filtrate every possible building avaible in arma3, unrelated to the map run (im testing in virtual reality for example)

The GOM solution is the only one for now, being buildingPos linked to model and not in config !

Share this post


Link to post
Share on other sites

Something like:

(" getNumber (_x >> 'scope') == 2 && ['EdCat_Structures', getText (_x >> 'editorCategory')] call bis_fnc_inString" configClasses (configfile >> 'CfgVehicles' )) apply {configName _x};

 

You can play with the number of doors or ladders:

("getnumber (_x >> 'numberOfDoors')  >= 1 or !(getarray (_x >> 'Ladders')  isEqualTo [])" configClasses (configfile >> 'CfgVehicles' )) apply {configName _x};

 

(returns only structures with at least 1 door or 1 ladder:   339 structures in Vanilla)

 

 

  • Like 1
  • Thanks 2

Share this post


Link to post
Share on other sites

@pierremgi this could work on recent maps, just consider takistan where rarely any building has doors while still having positions.

 

On 9/9/2018 at 11:08 PM, Funkdoc said:

the buildingpos are worldposition dependend, they have the world format, not the model format... so i think they can be obtained from only the one building object itself. it returns the absolute map position in positionATL format of the buildingpos. it is converted... like modelToWorld do

 

anyway i think it should not be run by the server everytime... on my rig it takes about 3  seconds to catch about 18,000 buildings (not filtered) on chernarus redux (old version).

its better to make it once for every map by hand.

try to count buildingpos at your array loop and select those u want to be written to the list.

I'm sure @dlegion wants something different.

18000 buildings? There's only 900+ unique buildings with positions in vanilla a3.

 

On 9/10/2018 at 9:48 AM, dlegion said:

Im not sure of what you mean...there are only around 1100 "houseBase" objects in arma3, to doublecheck i repeat that im not trying to use map buildings, i just need to filtrate every possible building avaible in arma3, unrelated to the map run (im testing in virtual reality for example)

The GOM solution is the only one for now, being buildingPos linked to model and not in config !

You can also try to grab the snippet above, put it in a function of your own function library and call it from preInit, should increase processing times significantly (this goes for any function that should be run only once and is very CPU intensive).

Did it right now along with a comparison:

Function:

//getBuildingsWithPositions.sqf in mission root, adjust positions parameter to find houses with at least given number of positions
GOM_fnc_buildingsWithPositions = [];
_initTime = diag_tickTime;
	_allHouses = "configName _x isKindOf 'HouseBase'" configClasses (configFile >> "CfgVehicles") apply {configName _x};
	systemChat str count _allHouses;
	_allHouses apply {
	_house = _x createVehicle [0,0,0];
	_positions = _house buildingPos -1;
	if (count _positions >= 4) then {GOM_fnc_buildingsWithPositions pushBack _x};
		deleteVehicle _house;
	};
	copyToClipboard str ([format ["Data evaluated in %1s. Found %2 valid buildings",diag_tickTime - _initTime,count GOM_fnc_buildingsWithPositions]] + GOM_fnc_buildingsWithPositions);

description.ext

class CfgFunctions
{
	class GOM
	{
		class preInit
		{
			class getBuildingsWithPositions{file = "getBuildingsWithPositions.sqf";postInit = 1};
		}
	}
}

 

Tests:

During mission runtime:
"Data evaluated in 68.312s. Found 322 valid buildings"

preInit:
"Data evaluated in 65.945s. Found 322 valid buildings"

postInit:
"Data evaluated in 2.651s. Found 322 valid buildings"

For some reason running this during postInit is happening at ludicrous speed, you can test it for yourself in this demo mission, simply change preInit to postInit in the description.ext and paste the results to a file.

Running this from postInit shouldn't be noticeable at all, so that should work fine and would even take into account mod buildings etc.

 

List of all vanilla buildings with at least 4 positions:

Spoiler

["Land_Chapel_V1_F","Land_Chapel_V2_F","Land_Offices_01_V1_F","Land_Hospital_main_F","Land_Hospital_side1_F","Land_Hospital_side2_F","Land_LightHouse_ruins_F","Land_LightHouse_F","Land_Lighthouse_small_F","Land_WIP_ruins_F","Land_WIP_F","Land_i_Addon_03_V1_F","Land_Addon_04_V1_ruins_F","Land_i_Addon_04_V1_F","Land_Metal_Shed_F","Land_House_Big_01_V1_ruins_F","Land_i_House_Big_01_V1_F","Land_i_House_Big_01_V1_dam_F","Land_i_House_Big_01_V2_F","Land_i_House_Big_01_V2_dam_F","Land_i_House_Big_01_V3_F","Land_i_House_Big_01_V3_dam_F","Land_u_House_Big_01_V1_F","Land_u_House_Big_01_V1_dam_F","Land_House_Big_02_V1_ruins_F","Land_i_House_Big_02_V1_F","Land_i_House_Big_02_V1_dam_F","Land_i_House_Big_02_V2_F","Land_i_House_Big_02_V2_dam_F","Land_i_House_Big_02_V3_F","Land_i_House_Big_02_V3_dam_F","Land_u_House_Big_02_V1_F","Land_u_House_Big_02_V1_dam_F","Land_d_House_Big_02_V1_F","Land_i_Shop_01_V1_F","Land_i_Shop_01_V1_dam_F","Land_i_Shop_01_V2_F","Land_i_Shop_01_V2_dam_F","Land_i_Shop_01_V3_F","Land_i_Shop_01_V3_dam_F","Land_u_Shop_01_V1_F","Land_u_Shop_01_V1_dam_F","Land_d_Shop_01_V1_F","Land_Shop_02_V1_ruins_F","Land_i_Shop_02_V1_F","Land_i_Shop_02_V1_dam_F","Land_i_Shop_02_V2_F","Land_i_Shop_02_V2_dam_F","Land_i_Shop_02_V3_F","Land_i_Shop_02_V3_dam_F","Land_u_Shop_02_V1_F","Land_u_Shop_02_V1_dam_F","Land_i_House_Small_01_V1_F","Land_i_House_Small_01_V1_dam_F","Land_i_House_Small_01_V2_F","Land_i_House_Small_01_V2_dam_F","Land_i_House_Small_01_V3_F","Land_i_House_Small_01_V3_dam_F","Land_u_House_Small_01_V1_F","Land_u_House_Small_01_V1_dam_F","Land_d_House_Small_01_V1_F","Land_i_House_Small_02_V1_F","Land_i_House_Small_02_V1_dam_F","Land_i_House_Small_02_V2_F","Land_i_House_Small_02_V2_dam_F","Land_i_House_Small_02_V3_F","Land_i_House_Small_02_V3_dam_F","Land_u_House_Small_02_V1_F","Land_u_House_Small_02_V1_dam_F","Land_d_House_Small_02_V1_F","Land_i_House_Small_03_V1_F","Land_i_House_Small_03_V1_dam_F","Land_i_Stone_HouseBig_V1_F","Land_i_Stone_HouseBig_V1_dam_F","Land_i_Stone_HouseBig_V2_F","Land_i_Stone_HouseBig_V2_dam_F","Land_i_Stone_HouseBig_V3_F","Land_i_Stone_HouseBig_V3_dam_F","Land_d_Stone_HouseBig_V1_F","Land_i_Stone_HouseSmall_V1_F","Land_i_Stone_HouseSmall_V1_dam_F","Land_i_Stone_HouseSmall_V2_F","Land_i_Stone_HouseSmall_V2_dam_F","Land_i_Stone_HouseSmall_V3_F","Land_i_Stone_HouseSmall_V3_dam_F","Land_d_Stone_HouseSmall_V1_F","Land_Unfinished_Building_01_ruins_F","Land_Unfinished_Building_01_F","Land_Unfinished_Building_02_ruins_F","Land_Unfinished_Building_02_F","Land_Airport_left_F","Land_Airport_right_F","Land_Airport_Tower_ruins_F","Land_Airport_Tower_F","Land_Airport_Tower_dam_F","Land_Hangar_F","Land_CarService_F","Land_Crane_F","Land_dp_bigTank_F","Land_Factory_Main_ruins_F","Land_Factory_Main_F","Land_Shed_Ind_ruins_F","Land_i_Shed_Ind_F","Land_u_Shed_Ind_F","Land_spp_Tower_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_Cargo_House_V1_ruins_F","Land_Cargo_House_V2_ruins_F","Land_Cargo_House_V3_ruins_F","Land_Cargo_HQ_V1_ruins_F","Land_Cargo_HQ_V1_F","Land_Cargo_HQ_V2_ruins_F","Land_Cargo_HQ_V2_F","Land_Cargo_HQ_V3_ruins_F","Land_Cargo_HQ_V3_F","Land_Cargo_Tower_V1_ruins_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_ruins_F","Land_Cargo_Tower_V2_F","Land_Cargo_Tower_V3_ruins_F","Land_Cargo_Tower_V3_F","Land_Medevac_house_V1_ruins_F","Land_Medevac_HQ_V1_ruins_F","Land_Medevac_HQ_V1_F","Land_MilOffices_V1_F","Land_Radar_F","Land_Pier_F","Land_Pier_small_F","Land_Research_house_V1_ruins_F","Land_Research_HQ_ruins_F","Land_Research_HQ_F","Land_GH_Gazebo_ruins_F","Land_GH_Gazebo_F","Land_GH_House_ruins_F","Land_GH_House_1_F","Land_GH_House_2_F","Land_GH_MainBuilding_left_F","Land_GH_MainBuilding_middle_F","Land_GH_MainBuilding_right_F","Land_Stadium_p4_F","Land_Stadium_p5_F","Land_Stadium_p9_F","Land_FireEscape_01_short_F","Land_FireEscape_01_tall_F","Land_GarageShelter_01_F","Land_House_Big_01_ruins_F","Land_House_Big_01_F","Land_House_Big_02_F","Land_House_Big_03_F","Land_House_Big_04_F","Land_House_Native_01_F","Land_House_Native_02_F","Land_House_Small_01_ruins_F","Land_House_Small_01_F","Land_House_Small_02_ruins_F","Land_House_Small_02_F","Land_House_Small_03_F","Land_House_Small_04_F","Land_House_Small_05_F","Land_House_Small_06_F","Land_School_01_F","Land_Shed_02_ruins_F","Land_Shed_02_F","Land_Shed_03_F","Land_Shed_05_ruins_F","Land_Shed_05_F","Land_Slum_01_F","Land_Slum_02_F","Land_Slum_03_F","Land_Addon_04_F","Land_FuelStation_01_shop_F","Land_FuelStation_01_workshop_F","Land_FuelStation_02_workshop_F","Land_Hotel_01_F","Land_Hotel_02_F","Land_MultistoryBuilding_01_F","Land_MultistoryBuilding_03_F","Land_MultistoryBuilding_04_F","Land_Shop_City_02_F","Land_Shop_City_04_F","Land_Shop_City_05_F","Land_Shop_City_06_F","Land_Shop_City_07_F","Land_Shop_Town_01_F","Land_Shop_Town_03_F","Land_Shop_Town_05_F","Land_Supermarket_01_F","Land_Warehouse_03_F","Land_Cathedral_01_F","Land_Mausoleum_01_F","Land_Temple_Native_01_F","Land_ContainerLine_01_F","Land_ContainerLine_02_F","Land_ContainerLine_03_F","Land_DryDock_01_end_F","Land_DryDock_01_middle_F","Land_GuardHouse_01_F","Land_MobileCrane_01_F","Land_MobileCrane_01_hook_F","Land_StorageTank_01_large_F","Land_StorageTank_01_small_F","Land_Warehouse_01_F","Land_Warehouse_02_F","Land_SY_01_conveyor_end_F","Land_SY_01_crusher_F","Land_SY_01_reclaimer_F","Land_SY_01_shiploader_arm_F","Land_SY_01_shiploader_F","Land_SCF_01_boilerBuilding_F","Land_SCF_01_clarifier_F","Land_SCF_01_condenser_F","Land_SCF_01_crystallizer_F","Land_SCF_01_crystallizerTowers_F","Land_SCF_01_diffuser_F","Land_SCF_01_feeder_F","Land_SCF_01_generalBuilding_F","Land_SCF_01_heap_bagasse_F","Land_SCF_01_chimney_F","Land_SCF_01_storageBin_big_F","Land_SCF_01_storageBin_medium_F","Land_SCF_01_storageBin_small_F","Land_SCF_01_washer_F","Land_SM_01_shed_F","Land_SM_01_shed_unfinished_F","Land_Airport_01_controlTower_F","Land_Airport_01_hangar_F","Land_Airport_01_terminal_F","Land_Airport_02_controlTower_F","Land_Airport_02_hangar_left_F","Land_Airport_02_hangar_right_F","Land_Airport_02_terminal_F","Land_Barracks_01_camo_F","Land_Barracks_01_grey_F","Land_Barracks_01_dilapidated_F","Land_Cargo_House_V4_ruins_F","Land_Cargo_HQ_V4_ruins_F","Land_Cargo_HQ_V4_F","Land_Cargo_Tower_V4_ruins_F","Land_Cargo_Tower_V4_F","Land_PierWooden_01_16m_F","Land_PierWooden_01_dock_F","Land_PierWooden_01_platform_F","Land_PierWooden_02_16m_F","Land_PierWooden_02_hut_F","Land_House_Big_01_b_blue_ruins_F","Land_House_Big_01_b_brown_ruins_F","Land_House_Big_01_b_pink_ruins_F","Land_House_Big_01_b_yellow_ruins_F","Land_i_House_Big_01_b_blue_F","Land_i_House_Big_01_b_brown_F","Land_i_House_Big_01_b_pink_F","Land_i_House_Big_01_b_white_F","Land_i_House_Big_01_b_whiteblue_F","Land_i_House_Big_01_b_yellow_F","Land_House_Big_02_b_blue_ruins_F","Land_House_Big_02_b_brown_ruins_F","Land_House_Big_02_b_pink_ruins_F","Land_House_Big_02_b_yellow_ruins_F","Land_i_House_Big_02_b_blue_F","Land_i_House_Big_02_b_brown_F","Land_i_House_Big_02_b_pink_F","Land_i_House_Big_02_b_white_F","Land_i_House_Big_02_b_whiteblue_F","Land_i_House_Big_02_b_yellow_F","Land_i_House_Small_01_b_blue_F","Land_i_House_Small_01_b_brown_F","Land_i_House_Small_01_b_pink_F","Land_i_House_Small_01_b_white_F","Land_i_House_Small_01_b_whiteblue_F","Land_i_House_Small_01_b_yellow_F","Land_i_House_Small_02_b_blue_F","Land_i_House_Small_02_b_brown_F","Land_i_House_Small_02_b_pink_F","Land_i_House_Small_02_b_white_F","Land_i_House_Small_02_b_whiteblue_F","Land_i_House_Small_02_b_yellow_F","Land_i_House_Small_02_c_blue_F","Land_i_House_Small_02_c_brown_F","Land_i_House_Small_02_c_pink_F","Land_i_House_Small_02_c_white_F","Land_i_House_Small_02_c_whiteblue_F","Land_i_House_Small_02_c_yellow_F","Land_i_Stone_House_Big_01_b_clay_F","Land_Unfinished_Building_01_noLadder_F","Land_Shop_02_b_blue_ruins_F","Land_Shop_02_b_brown_ruins_F","Land_Shop_02_b_pink_ruins_F","Land_Shop_02_b_yellow_ruins_F","Land_i_Shop_02_b_blue_F","Land_i_Shop_02_b_brown_F","Land_i_Shop_02_b_pink_F","Land_i_Shop_02_b_white_F","Land_i_Shop_02_b_whiteblue_F","Land_i_Shop_02_b_yellow_F","Land_Supermarket_01_malden_F","Land_Barn_01_brown_ruins_F","Land_Barn_01_brown_F","Land_Barn_01_grey_ruins_F","Land_Barn_01_grey_F","Land_Shed_08_brown_F","Land_Shed_08_grey_F","Land_Lighthouse_01_noLight_F","Land_Lighthouse_03_green_F","Land_Lighthouse_03_red_F","Land_Bunker_01_big_F","Land_Bunker_01_HQ_F","Land_Bunker_01_small_F","Land_Bunker_01_tall_F","Land_Cargo_House_V3_derelict_F","Land_Cargo_HQ_V3_derelict_F","Land_Cargo_Tower_V3_derelict_F"]

:yay:

 

Cheers

  • Like 1
  • Thanks 2

Share this post


Link to post
Share on other sites
8 hours ago, Grumpy Old Man said:

@pierremgi this could work on recent maps, just consider takistan where rarely any building has doors while still having positions.

 

 

 

Did you test it? It works not so bad on CUP maps like Takistan.

("getnumber (_x >> 'numberOfDoors')  >= 1 or !(getarray (_x >> 'Ladders')  isEqualTo [])" configClasses (configfile >> 'CfgVehicles' )) apply {configName _x}; will return plenty of houses with building positions

(very most of them have ladder or door). You avoid all BI "house" classes like pipelines,bilboards,ruins...

Just try this in Takistan:

0 = [] spawn {

    _buildings = ("getnumber (_x >> 'numberOfDoors')  >= 1 or !(getarray (_x >> 'Ladders')  isEqualTo [])" configClasses (configfile >> 'CfgVehicles' )) apply {configName _x};

   {

      _mk = createMarker ["mk"+str(_forEachIndex),getpos _x];

      _mk setMarkerType "mil_dot";

       if (typeOf _x in _buildings) then {_mk setMarkerColor "colorGreen"} else {

         if ( count (_x buildingPos -1) >0) then {_mk setMarkerColor "colorRed" }

       }

  } forEach nearestTerrainObjects  
   [
     [worldSize/2, worldSize/2],  
     ["house"],  
     worldSize,  
    false
   ];

};

 

in black, all houses without position (not detected by my filter) like pipelines, in green the working classes with filter, in red the "houses" with position(s) omitted by the filter. Most of them are ruins.

Some missing classes like: land_shed_Ind02 (CUP didn't declare the numberOfDoors), land_fortified_nest_big_02 or land_House_L_1_EP1  (they have positions but neither door nor ladder)

 

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×