GMS_RC/@GMS/addons/GMS/Compiles/Functions/fn_findPositionsAlongARadius.sqf
Ghostrider [GRG] 315aaa67a8 Build 267 - Version 7.162
REQUIRES GMSCore
	version = 1.053;
	build = 36;
	buildDate = "10-01-23";

Or Later
2023-10-02 20:05:16 -04:00

36 lines
868 B
Plaintext

/*
GMS_fnc_findPositionsAlongARadius
Generates an array of equidistant positions along the circle of diameter _radius
for ghostridergaming
By Ghostrider [GRG]
Copyright 2016
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
*/
#include "\GMS\Compiles\Init\GMS_defines.hpp"
params["_center","_num","_minDistance","_maxDistance"];
private _locs = [];
private _startDir = round(random(360));
private _currentDir = _startDir;
private _Arc = 360/_num;
for "_i" from 1 to _num do
{
_currentDir = _currentDir + _Arc;
_dist = round(_minDistance + (random(_maxDistance - _minDistance)));
_newpos = _center getPos [_dist, _currentDir];
_locs pushback _newpos;
};
_locs