====== ArmA 2 Zone Markers ======
[[https://www.pmctactical.org/forum/viewforum.php?f=50|ArmA 2 Forum]], [[:arma2|ArmA 2 Home]], [[arma2:config|ArmA 2 Config]], [[arma2:file_formats|ArmA 2 File Formats]], [[arma2:missions|ArmA 2 Missions]], [[arma2:modeling|ArmA 2 3D Modeling]], [[arma2:scripting|ArmA 2 Scripting]], [[arma2:terrain|ArmA 2 Terrain]], [[arma2:texturing|ArmA 2 Texturing]], [[arma2:tools|ArmA 2 Tools]]
ArmA 2 warning zone markers creating script.
This script creates a ring of No Entry signs around a Zora trigger zone at 15m intervals. The trigger has to be a circle.
Run it from init.sqf as:
[BIS_Zora_0] execVM "zoraSigns.sqf";
zoraSigns.sqf:
_zoraZone = _this select 0;
_zoraPos = getPos _zoraZone;
_sizeZone = triggerArea _zoraZone;
_angle = _sizeZone select 2;
_radius = _sizeZone select 0; // needs to be a circle with equal a and b
_distanceBetweenPosts = 15; // meters
_count = round((2 * 3.14592653589793 * _radius) / _distanceBetweenPosts);
_step = 360/_count;
for "_x" from 0 to _count do
{
_a = (_zoraPos select 0)+(sin(_angle)*_radius);
_b = (_zoraPos select 1)+(cos(_angle)*_radius);
_pos = [_a,_b,_zoraPos select 2];
_angle = _angle + _step;
_post = "Sign_1L_Noentry_EP1" createVehicle _pos;
_post setPos _pos;
_relDir = [_post, _zoraZone] call BIS_fnc_DirTo;
_post setDir _relDir - 180;
};
_mrkCrossName = format["%1CrossMarker",_zoraZone];
_mrkCross = createMarker[_mrkCrossName,_zoraPos];
_mrkCross setMarkerShape "ELLIPSE";
_mrkCross setMarkerBrush "CROSS";
_mrkCross setMarkerColor "ColorRed";
_mrkCross setMarkerSize [_radius,_radius];
_mrkCross setMarkerAlpha 0.2;
_mrkBorderName = format["%1BorderMarker",_zoraZone];
_mrkBorder = createMarker[_mrkBorderName,_zoraPos];
_mrkBorder setMarkerShape "ELLIPSE";
_mrkBorder setMarkerBrush "BORDER";
_mrkBorder setMarkerColor "ColorRed";
_mrkBorder setMarkerSize [_radius,_radius];
_mrkBorder setMarkerAlpha 1;