Jump to content
zeroip

Get all building positions on map?

Recommended Posts

Hello,

 

I'm trying to use a custom script that places gear inside all of the listed building coordinates, but I'm using Lingor as the map and don't know how to simply get a list of all the coordinates the map has for buildings. Is this something I can do? Thanks!

Share this post


Link to post
Share on other sites

I came across this script a while ago by an unknown author.

 

It is called getAllBuildingPositions.sqf

 

It copies all enterable building positions to your clipboard. 

allpositionsarray = [];
_pos = [0,0];
randomweapon_buildings = nearestObjects [_pos, ["house"], 60000];
{
_building = _x;
_buildingpos = [];
_endloop = false;
_poscount = 0;
while {!_endloop} do {
if(((_building buildingPos _poscount) select 0) != 0 && ((_building buildingPos _poscount) select 1) != 0) then {
_buildingpos = _buildingpos + [_building buildingPos _poscount];
_poscount = _poscount + 1;
} else {
_endloop = true;
};
};


if (count _buildingpos > 0) then
{
for[{_r = 0}, {_r < count _buildingpos}, {_r = _r + 1}] do
{

_pos = _buildingpos select _r;
_posnew = _pos;
if(_pos select 2 < 0) then
{
_pos = [_pos select 0, _pos select 1, 1];
};
_z = 0;
_testpos = true;
while {_testpos} do {
if((!lineIntersects[ATLtoASL(_pos), ATLtoASL([_pos select 0, _pos select 1, (_pos select 2) - (0.1 * _z)])]) && (!terrainIntersect[(_pos), ([_pos select 0, _pos select 1, (_pos select 2) - (0.1 * _z)])]) && (_pos select 2 > 0)) then {
_posnew = [_pos select 0, _pos select 1, (_pos select 2) - (0.01 * _z)];
_z = _z + 1;
} else {
_testpos = false;
};
};
player setPos _posnew;
sleep 0.5;
waitUntil{velocity player select 0 == 0 && velocity player select 1 == 0 && velocity player select 2 == 0};
allpositionsarray = allpositionsarray + [getPos player];
};
};

}foreach randomweapon_buildings;

clipBoardString = "";
{
clipBoardString = clipBoardString + format["%1
",_x];
}foreach allpositionsarray;

copyToClipboard clipBoardString;

NOTES:

 

I suggest you use;

this allowDamage false;

on your player as I've died half way through running the script before. Nightmare on the larger maps!

 

Be patient and avoid touching your mouse and keyboard!

Give it time to return all building positions.

When you stop teleporting around the map then you're good to tab out and paste the returned positions into notepad.

Share this post


Link to post
Share on other sites

I came across this script a while ago by an unknown author.

 

It is called getAllBuildingPositions.sqf

 

It copies all enterable building positions to your clipboard. 

allpositionsarray = [];
_pos = [0,0];
randomweapon_buildings = nearestObjects [_pos, ["house"], 60000];
{
_building = _x;
_buildingpos = [];
_endloop = false;
_poscount = 0;
while {!_endloop} do {
if(((_building buildingPos _poscount) select 0) != 0 && ((_building buildingPos _poscount) select 1) != 0) then {
_buildingpos = _buildingpos + [_building buildingPos _poscount];
_poscount = _poscount + 1;
} else {
_endloop = true;
};
};


if (count _buildingpos > 0) then
{
for[{_r = 0}, {_r < count _buildingpos}, {_r = _r + 1}] do
{

_pos = _buildingpos select _r;
_posnew = _pos;
if(_pos select 2 < 0) then
{
_pos = [_pos select 0, _pos select 1, 1];
};
_z = 0;
_testpos = true;
while {_testpos} do {
if((!lineIntersects[ATLtoASL(_pos), ATLtoASL([_pos select 0, _pos select 1, (_pos select 2) - (0.1 * _z)])]) && (!terrainIntersect[(_pos), ([_pos select 0, _pos select 1, (_pos select 2) - (0.1 * _z)])]) && (_pos select 2 > 0)) then {
_posnew = [_pos select 0, _pos select 1, (_pos select 2) - (0.01 * _z)];
_z = _z + 1;
} else {
_testpos = false;
};
};
player setPos _posnew;
sleep 0.5;
waitUntil{velocity player select 0 == 0 && velocity player select 1 == 0 && velocity player select 2 == 0};
allpositionsarray = allpositionsarray + [getPos player];
};
};

}foreach randomweapon_buildings;

clipBoardString = "";
{
clipBoardString = clipBoardString + format["%1
",_x];
}foreach allpositionsarray;

copyToClipboard clipBoardString;

NOTES:

 

I suggest you use;

this allowDamage false;

on your player as I've died half way through running the script before. Nightmare on the larger maps!

 

Be patient and avoid touching your mouse and keyboard!

Give it time to return all building positions.

When you stop teleporting around the map then you're good to tab out and paste the returned positions into notepad.

Exactly what I needed, thank you! This'll come in huge help :p

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

×