Jump to content
Sign in to follow this  
jagga99

Please help to get all positions for certain type of building on Altis Map

Recommended Posts

I'm newbie in scripting for Arma3.

Please help me to get all coordinates (markers on the map) of certain type of building on Altis Map.

I found a script which could help me but I dont know how to use it:

_i =  1;
{
                                          
      _name = format["m%1", _i];
      _foo = createmarker [_name, getPos _x];
      _foo setMarkerTypeLocal "mil_dot";
      _foo setMarkerColorLocal "ColorRed";
      _i = _i + 1;
      
} forEach nearestObjects [player, ["Cargo_Tower_base_F"], 5500];

I'm looking for markers on the map of all white sheds ("Land_i_Shed_Ind_F") on Altis map.

Thank you!

Share this post


Link to post
Share on other sites
getAllBuildings = {
_pos = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");
_blds= nearestobjects [_pos,["Cargo_Tower_base_F"], 25000]; // 25000 - 25km
_ary=[];
{_ary=_ary+[getpos _x]} foreach _blds;
hint str _ary;
copyToClipboard str _ary;
_blds;
};

Implement it somehow using forEach for all _blds that are returned by the function above.

 

Too bad I'm short on time to further code this. Untested.

  • Like 1

Share this post


Link to post
Share on other sites
getAllBuildings = {
_pos = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");
_blds= nearestobjects [_pos,["Cargo_Tower_base_F"], 25000]; // 25000 - 25km
_ary=[];
{_ary=_ary+[getpos _x]} foreach _blds;
hint str _ary;
copyToClipboard str _ary;
_blds;
};

Implement it somehow using forEach for all _blds that are returned by the function above.

 

Too bad I'm short on time to further code this. Untested.

 

Stupid question: how to run this script? 

1. Run mission editor;

.. ?

Share this post


Link to post
Share on other sites

 You could probably run it by simply adding it to an init.sqf file. Simply copy that script into a text editor, name it init.sqf into the mission you are running and it will work. Other option is to make it its own script.sqf and call it via trigger in the game.

  • Like 1

Share this post


Link to post
Share on other sites

 You could probably run it by simply adding it to an init.sqf file. Simply copy that script into a text editor, name it init.sqf into the mission you are running and it will work. Other option is to make it its own script.sqf and call it via trigger in the game.

Thanks a lot. Just to clarify how to use a second option?

1. Create mission;

2. Put marker with trigger;

3. On trigger activation type above text?;

Share this post


Link to post
Share on other sites

 Well you would have to first create reason to call or Condition and you could either you just set it to True or call it with Radio Alpha etc

 

 On Activation you would add: nul = execVM "whateverNameScriptHere.sqf" -in quotation marks just like that.

 

 whatEverNameScript.sqf has to be created by you by texting above code into text editor, save it as whatEverNameScript.sqf and add it to your root mission file.

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
Sign in to follow this  

×