Forum Jump :

Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 59
In-game name: Kobayashi Maru

 
#196235 Posted at 2017-02-10 14:29        
     
Yes, but you need to define them. Two ways:
- your own marker or trigger areas;
- looking for some locations on map, native or added by script.
The second one is useful for spawning units, but too poorly "military area oriented" in Arma3 for your purpose.
You can also define polygons, very accurate but it's more CPU expensive than markers or triggers.

So, imho, best usage is ellipse or rectangle markers (useful to check the spawn while their alpha color is > 0, then 0 during the game).
the aim is an array of marker areas:
myMarkers = ["mrk1","mrk2"...}; 
// or any filter on allMapMarkers
Don't forget to add this array in the script.
Then, you just have to add a condition for building presence:
The above script:
while {true} do {
  {_building = nearestBuilding _x;
    _buildings pushback _building;
  _building_array = _buildings arrayintersect _buildings} forEach allPlayers;
  ....

becomes:
while {true} do {
  {_building = nearestBuilding _x;
   if ({if (_building inArea _x) exitWith {1}} count myMarkers >0) then {
    _buildings pushback _building};
  _building_array = _buildings arrayintersect _buildings} forEach allPlayers;
  ...

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS