VasyaHuy 1 Posted August 17, 2012 Hello! I am new to ARMA 2, I need help with one thing: where I can find coordinates of all buildings on the map (custom modification)? I check all reachable configs in the .pbo files, but unsuccessfully - all that I found, was some kind of landmark and various thrash - dead bodies, destroyed vehicles etc. And second question - where I can find size of the whole map (10000x10000 for example)? Thanks. Share this post Link to post Share on other sites
VasyaHuy 1 Posted August 18, 2012 Any thoughs? It is impossible? Share this post Link to post Share on other sites
mondkalb 1087 Posted August 19, 2012 You'll need an algorithm that uses nearestObjects or nearestBuilding to store all structures of the desired type. Then write an algorithm that runs the building-finder only in specific areas when called, to avoid massive lag when calling it those commands with radii bigger than 2km. So ideally you iterate through all square kilometres of the map and store the data that is acquired within that. Very basic script Example: /* --- Params --- */ _gridSize = 1000; // in m, defines the size per scanned interval _mapSize = 8000; //in m, total width/length of map /* --- Script params--- */ _cursorX = 0; _cursorY = 0; _limit = _mapSize/_gridSize; _allBuildingPosition = []; while {_cursorY < _limit} do { // Get new grid center position _curX = _cursorX * _gridSize + 0.5 * _gridSize; _curY = _cursorY * _gridSize + 0.5 * _gridSize; // Store all positions of all found buildings { _allBuildingPosition = _allBuildingPosition + [position _X]; } forEach nearestObjects [[_curX,_curY,0], ["house"], _gridSize]; // Iterate X cursor (rows) _cursorX = _cursorX + 1; // If X cursor exceeds the limit, start a new colums if (_cursorX > _limit) then { _cursorX = 0; _cursorY = _cursorY + 1; }; sleep 0.1; }; I haven't tested this code (It's Sunday evening. :P), but if you know the basics of scripting, you should be able to work on from here. _allBuildingPosition is the variable that will then contain all building positions of all iterated tiles. Here a picture of what the script does. Maybe it helps you understanding the code. :) Note: The nearestObjects covers circles, not squares, so this current script above will not cover the entire map. You will have to double the radius for the nearestObjects command and come up with an efficient system that avoids counting building positions twice. The entire mapsize is currently readable via a script command. You can try hacking your way around it by sending "a probe" northwards originating from [0,0,0] and checking the iterating position's surface type and compare it to the surface defined for the outside terrain (The dynamic terrain generated outside of the actual map). However this approach is very complex and requires you to understand not only the basics of scripting, but also the advanced quirks and shortcuts. You can probably reuse code that you may write for the building finder. Anyways, all this is off the top of my head. I'm too lazy to actually test it, but hopefully if you work this out on your own with some help, you'll understand the scripting language very fast. Share this post Link to post Share on other sites
Sealife 22 Posted August 19, 2012 To find size simply put player on edge of map (turn texture on so you don't place on procedural land) put waypoint opposite side and bingo width and height of map. In early maps grid size is in config . For buildings , houses can be obtained but unfortunately because not all are configged in bis terrains , gettext model is not as simple as it should be . Share this post Link to post Share on other sites
VasyaHuy 1 Posted August 25, 2012 So, I get list of buildings. I guess, it is better to ask here, since questions are related: I get list of buildings looks like this: "house_c_1_ep1";6972.3;6290.58;0;-1; "house_c_1_ep1";6801.02;6505.95;0;90; "house_c_1_ep1";6798.01;5916.1;0;179.421; But in the config files, and in class lists like this: http://community.bistudio.com/wiki/ArmA_2:_CfgVehicles I can find matches only for SOME of this buildings, for example, for small set of this: "housev2_02_interier";6399.12;5773.68;0;91.1991; "housev2_02_interier";6837.97;6092.97;0;-89.3807; "housev2_02_interier";5724.07;4634.34;0;-1.32664; "housev2_02_interier";599.561;4642.43;0;99.0343; "housev2_02_interier";1846.37;655.56;0;-176.554; "housev2_03";7344.14;1906;0;-17.8095; "housev2_03";3038.87;5853.76;0;179.79; "housev2_03";3577.87;1318.87;0;89.7149; "housev2_03";5150.97;7332.87;0;1.76651; "housev2_03b";6540.89;5594.33;0;0.173444; "housev2_03b";7010.1;6345.74;0;-1.03268; "housev_1i2";3623.22;6430.7;0;-93.0912; "housev_2i";6072.94;7264.25;-0.0649164;108.485; "housev_2i";1856.84;818.678;-13.0859;11.4847; "housev_2l";4547.77;5583.25;0;82.8375; "housev_2t1";4104.83;4579.39;0;87.5833; "housev_2t1";4361.88;2270.56;0;127.887; "housev_2t1";3795.39;6417.83;0;-0; "housev_2t1";7585.71;2982.61;0;86.4031; "housev_3i1";6479.01;5599.67;0;88.7949; "housev_3i2";3853.31;2387.27;0;-178.227; "housev_3i2";3615.99;6113.27;0;-54.3257; "housev_3i2";5260.5;6930.98;0;92.4348; "housev_3i2";7088.94;4613.92;0;95.8853; "housev_3i2";7508.21;2641.13;0;170.361; This building have matches in config: class Land_HouseV2_02_Interier : Residential { lootPos[] = {{7.23096, 5.37207, -5.53067}, {8.55005, 0.754883, -5.53067}, {5.20166, -1.54004, -5.53067}, {3.34912, 1.9707, -5.53067}, {-3.62598, 3.05371, -5.53067}, {-5.4812, -0.0292969, -5.53067}, {-5.83325, 3.26563, -5.53067}, {-5.71045, 5.49414, -5.53067}}; }; And some others: class Land_HouseV_3I4 : Residential { maxRoaming = 3; lootPos[] = {}; }; class Land_Shed_W4 : Residential { maxRoaming = 3; lootPos[] = {}; }; class Land_HouseV_3I1 : Residential { maxRoaming = 3; lootPos[] = {}; }; class Land_HouseV_1L2 : Residential { maxRoaming = 3; lootPos[] = {}; }; class Land_HouseV_1T : Residential { maxRoaming = 3; lootPos[] = {}; }; So, question: where I can try to find classes which describes other buildings, like house_c_1_ep1? Sorry for the messy description. Share this post Link to post Share on other sites
Cards525 10 Posted August 26, 2012 Pretty sure ARMATEC released a giant-cluster of classnames somewhere, google it :) Share this post Link to post Share on other sites