Jump to content
Sign in to follow this  
rexehuk

DAC - Custom release & control script (SUITE)

Recommended Posts

Hello all,

This thread will eventually grow as the suite gets large and more complex, the idea of this script suite is greater control over DAC, utilising functions that SIOLA has been clever enough to implement in his script.

Release 1:

DAC Releaser script

What does it do?

The script is aimed at releasing a DAC zone and ordering the units within that zone to move to a WAYPOINT or an ARRAY of WAYPOINTS.

Whilst this script is in it's beginnings, it works well and has been tested as working on dedicated servers.

-----------------------------------------------------------------------------------

Why is this different from the releaseGroup function in DAC?

While the releaseGroup function is not very well documented, you will find that its not written down how to take units OUT of a dac zone, only insert and release groups you know the name of. This script solves that problem by allowing you to release groups from any zone you wish with ease! On top of that it gives you the functionality to control them once they exit.

-----------------------------------------------------------------------------------

Why have I released it now?

I am looking for feedback, testing and feature wishes for future versions.

-----------------------------------------------------------------------------------

How do I use it?

I have aimed to keep the INIT process similar to how DAC is done:

The script is initialised from a trigger normally, you're welcome to try other methods.

Trigger Setup

Condition: YOURCODE && isServer

OnAct: null = [["z1",z1_groups],["objective1","objective2","objective3","objective4"],0,0] execVM "removeDACgroup.sqf"

Explanation of the VARS

First Array: ZONENAME and GROUPHANDLER (assigned via DAC zone call)

-> Example: fun=["z1",[1,0,0],[4,3,100,10,"z1_groups"],[],[],[],[1,1,1,1]] spawn DAC_Zone

Second Array: Waypoint (ARRAY), use single value or multiple values. These are MARKERS to define the waypoint location.

Third value: 0 / 1 boolean - Used for (0 = ordered waypoint assignment and 1 = random waypoint assignment).

Fourth value: DAC zone removal once all groups are disbanded from it (0 = Keep / 1 = Delete).

-----------------------------------------------------------------------------------

Current Version: 0.2 A - debug = true; in INIT.sqf turns on debugging mode.

removeDACgroup.sqf

/*
****** DAC Releasing Scipt ******

Releases all units within a given DAC zone
and sends them to a designated waypoint.

Created by rexehuk

call:

null = [["z1",z1_group],["objective1","objective2","objective3"],X,Y] execVM "removeDACgroup.sqf";

X = 0 for ORDERED waypoint giving and 1 for randomised waypoint giving
Y = DAC zone deletion - 0 for KEEP zone - 1 for DELETE zone

Example:

 null = [["z1",z1_group],["objective1","objective2","objective3"],0,0] execVM "removeDACgroup.sqf";
*/

waituntil{DAC_Basic_Value == 1};

private ["_selectedArray","_waypointBank","_waypointIDX","_group","_aID","_zoneBoolean","_ZoneID","_waypointCount","_wayPoint"
,"_waypointOrder"];

_zoneArray = [];
_selectedArray = (_this select 0 select 1);
_waypointBank = (_this select 1);
_waypointCount = (count _waypointBank);
_waypointOrder = (_this select 2);
_zoneBoolean = (_this select 3);
_zoneID = (_this select 0 select 0);
_waypointIDX = 0;

if (debug) then
{
[-1, {
_selectedArray = _this select 0;
_zoneID = _this select 1;
_zoneBoolean = _this select 2;



hint format ["%1 and %2 and zoneboolean = %3",_selectedArray,_zoneID,_zoneBoolean];
},[_selectedArray,_zoneID,_zoneBoolean]] call CBA_fnc_globalExecute;
};


sleep 1.5;

// Release Groups from _selectedArray defined

{
	_group = _x;

	[_group] spawn DAC_fReleaseGroup;


	if (debug) then {[-1, {_selectedArray = _this select 0;	_group = _this select 1;hint format["Array is: %1 and Group is: 		%2",_selectedArray,_group];},[_selectedArray,_group]] call CBA_fnc_globalExecute;};

	waitUntil {_group getVariable ["DAC_Excluded", True]};

	if (_waypointOrder == 0) then
	{
		_wayPoint = _waypointBank select _waypointIDX;

		if (debug) then {hint format["Waypoint is %1 and there is %2 positions",_waypoint,_waypointCount];};
		sleep 5;
		_wp = _group addWaypoint [getMarkerPos _waypoint, 0];
		_wp setWaypointType "MOVE";
		_waypointIDX = _waypointIDX + 1;
		if (_waypointIDX == _waypointCount) then
		{
			_waypointIDX = 0;
		};
	} else {
		_wayPoint = _wayPointBank select (floor(random _waypointCount));

		if (debug) then {hint format["Waypoint is %1",_waypoint];};
		sleep 3;
		_wp = _group addWaypoint [getMarkerPos _waypoint, 0];
		_wp setWaypointType "MOVE";
		};

} forEach _SelectedArray;

// Cleans up DAC zone if user no longer requires it

if (_zoneBoolean == 1) then
{
	if (_zoneID in DAC_CheckZones) then
	{
		[_zoneID] call DAC_fDeleteZone;

if (debug) then {[-1, {hint "Successfully removed zone";}] call CBA_fnc_globalExecute;};

	};
} else
	{
		if (debug) then {
					[-1, {
					_zoneID = _this select 0;
					Hint format["Finished and left zone: %1",_zoneID];},[_zoneID]] call CBA_fnc_globalExecute;
		};

	};

Future Releases / Updates

Releaser Script:

- Implement Waypoint PARAMS other than MOVE and allow greater control over other waypoint parameters

Integrator Script:

A script to allow easier control over integrating groups into DAC zones and work somewhat in tandem with the releaser script.

Edited by rexehuk

Share this post


Link to post
Share on other sites

hey this is really good.. i know a few have been asking how to release DAC groups..

awesome!

Share this post


Link to post
Share on other sites

A few question to this sir,

1)

Condition: YOURCODE && isServer

I don't know what this is - what should I replace with "YOURCODE" o_O ?

2)

Will this script use DAC Zone Waypoints? As mentioned by the DAC Creater ? He described that a released group still can walk on specific Zone Waypoints ([group, [z1],1,8] spawn DAC_fReleaseGroup ) - Because I don't want loose the dynamics of DAC Zone Waypoint Sharing.

3)

When I use your script withing a new trigger (Condition: YOURCODE && isServer still in use cause I didn't knew if I have to change these) - It seems it just won't work.

4)

null = [["z1",z1_groups],["objective1","objective2","objective3","objective4 "],0,0] execVM "removeDACgroup.sqf"

you didnt explained what these objective_X are for?

Edited by Falke88

Share this post


Link to post
Share on other sites

Mmmmm...

Yourcode would be something like a globalVariable that you fire true when you want to exec the releaser.

As for number 2 I don't know, you would have to test that.

3. Not sure what you mean.

4. They are marker names, this is a pretty old version, I use one with script passes now so I exec CBA defend on them etc.

Share this post


Link to post
Share on other sites

Can i ask you to may create a example mission .pbo where you used DAC and your script? It's much easier to read out of a working mission then trying that on my own. Especially without much of a core knowledge

thx for the answers so far

Share this post


Link to post
Share on other sites

I can obviously see the benefits of this for releasing groups to GL4. Would there be a way to modify the script to change the released groups' group names to be prefixed with GL4 syntax? Eg you could have 3 release scripts - one for GL4 Defend Groups, one for Custom, one for Static. I presume that naming them like this after DAC release would be enough for GL4 to recognize them as specific group types within the context of GL4?

JJ

Edited by jiltedjock

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×