ArmA 2 Zone Markers

ArmA 2 Forum, ArmA 2 Home, ArmA 2 Config, ArmA 2 File Formats, ArmA 2 Missions, ArmA 2 3D Modeling, ArmA 2 Scripting, ArmA 2 Terrain, ArmA 2 Texturing, 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;