Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // nul = [zone list, zone radius, zone density, zone value, zone randomized value, zone randomized value range, resource object type, mark objects, use marker size] call BTH_fnc_GenResZones_RTS;
- // zone list:------------------- Array - Array containing all marker names for resource area markers.
- // zone radius:---------------- Number - Radius from the center marker to use as zone area.
- // zone density:--------------- Number - The amount of resource objects that will be created in each zone.
- // zone value:----------------- Number - The value (in resources) each resource object is worth. Doubles as the minimum value if random value is enabled.
- // zone randomized value:-------- Bool - Determines whether or not to randomize the value of the resource objects.
- // zone randomized value range: Number - The range of randomization allowed, value is max possible value.
- // resource object type:------- String - Classname of object to use as resource object.
- // mark objects:----------------- Bool - Determines whether or not to create markers where the resource objects can be found on the map.
- // use marker size:-------------- Bool - Determines whether or not to get the radius from the size of the marker. For use with elliptical area markers. Only uses x-axis value.
- // Debug Example: nul = [["TestMarker0"], 50, 5, 50, true, 50, "Land_PaperBox_closed_F", false, true] call BTH_fnc_GenResZones_RTS;
- params [
- ['_zoneList', [], [[]]],
- ['_zoneRadius', 0, [0]],
- ['_zoneDensity', 0, [0]],
- ['_zoneValue', 0, [0]],
- ['_zoneRndVal', true, [true]],
- ['_zoneRndRng', 0, [0]],
- ['_resType', "Land_PaperBox_closed_F", [""]],
- ['_resMark', false, [true]],
- ['_markRadius', false, [true]]
- ];
- _zoneDensity = _zoneDensity - 1;
- {
- private _mrk = _x;
- private _pos = getMarkerPos _mrk;
- for "_i" from 0 to _zoneDensity do
- {
- if (_markRadius) then {
- private _markSize = getMarkerSize _mrk;
- _zoneRadius = (_markSize select 0);
- };
- private _newPos = _pos getPos [_zoneRadius * sqrt random 1, random 360];
- if (_resMark) then {
- private _markPos = createMarker [str _i, _newPos];
- private _markPos setMarkerShape "ICON";
- private _markPos setMarkerType "mil_dot";
- };
- if (_zoneRndVal) then {
- private _newValue = _zoneValue + round(random _zoneRndRng);
- [_newValue, _resType, _newPos, true] call BTH_fnc_ResourceObject_RTS;
- } else {
- [_zoneValue, _resType, _newPos, true] call BTH_fnc_ResourceObject_RTS;
- };
- };
- } forEach _zoneList;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement