Jump to content

scottb613

Member
  • Content Count

    731
  • Joined

  • Last visited

  • Medals

Posts posted by scottb613


  1. Hi Gunter,

     

    Are you sure about the tanks thing with ALiVE ??? I've worked pretty heavily with IFA3/ALiVE and used the tanks/mechanized/motorized units - you just need to use their faction name from the ALiVE wiki - no ??? You can use more than one faction per side and I've had plenty of tanks running around on custom ALiVE missions with infantry (I'll gladly post if desired - nothing fancy - just sandbox stuff)... I've been thoroughly enjoying that mission posted above by @autigergrad  - and it has tanks as well... The physics of the tanks seem a little bit off as they sometimes zip around like a swarm of bees - so fast they roll over on occasion - but they are present... Granted ORBAT gives you the ability to customize your faction to your hearts content...

     

    Regards,
    Scott

     

     


  2. Hi Das (oddball - great movie),

     

    Thanks so much for taking the time writing this all up - big help I think - I'm getting a grasp on all this and I have more things to try when I get home... I wish my laptop could handle enough ArmA just to some basic testing while I travel - but it can't... I just came across that "diag_log" command and included it in my diag routine - so I can start writing to the log file - seems far better than trying to catch the hint windows... I'll probably add GOM's system chat messages as well... I'll be sure to read your reference... 

     

    I've got most of the other errors in my script cleared except one towards the end - a simple WP sync - that seemed to work fine in A2... The WP's look valid to me - I'll have to play with this some more as well... 

     

    • _wpSlkUn synchronizeWaypoint _wpChkUn;

     

    Appreciate the help...

     

    Regards,
    Scott

     

    Updated Script:

    Spoiler
    
    
    //============================//
    // SLICKS - SCO Launch Script //
    //============================//
    
    // Note: Only tested in Single Player
    
    // Given: 1 to 4 helicopters preloaded with crew - units named in assets.
    // Given: Infantry squads (chalkx) will be loaded as cargo into helicopter (slickx) with respect to number when _loadChk = 1. 
    // Given: Helicopters will assault LZ with defined helipads - drop troops - RTB to home helipads.
    // Given: User can define manual path with up to four inbound markers "inb1-inb4" if desired - else direct to LZ pad.
    // Given: User can define manual path with up to four outbound markers "out1-out4" if desired - else direct to BS pad.
    // Given: Example Flight Path - [BsPad1 -> inb1 -> inb2 -> inb3 -> inb4 -> LzPad1 -> out1 -> out2 -> BsPad1].
    // Given: In order to have outbound waypoints work - you need at least one inbound waypoint specified.
    // Given: Even though helicopters are individual units - they will maintain a diamond formation along flight path.
    
    // Named Asset: [OPTIONAL] ("s1" - player unit)
    // Named Asset: ("slick1" - slick helo) ("slick2" - slick helo) ("slick3" - slick helo) ("slick4" - slick helo)
    // Named Asset: ("chalk1" - inf squad) ("chalk2" - inf squad) ("chalk3" - inf squad) ("chalk4" - inf squad)
    // Named Marker: ("lz1" - lz pad marker) ("lz2" - lz pad marker) ("lz3" - lz pad marker) ("lz4" - lz pad marker)
    // Named Marker: [OPTIONAL] ("inb1" - inbound marker) ("inb2" - inbound marker) ("inb3" - inbound marker) ("inb4" - inbound marker) 
    // Named Marker: [OPTIONAL] ("out1" - outbound marker) ("out2" - outbound marker) ("out3" - outbound marker) ("out4" - outbound marker)
    
    // Classname: ("Land_HelipadEmpty_F" - invisible helipad)
    // Classname: ("Land_HelipadCircle_F" - visible helipad)
    
    hint "Slicks GO GO GO";
    sleep 2;
    
    private ["_slkUnt","_slkGrp","_LzPad1","_LzPad2","_LzPad3","_LzPad4","_BsPad1","_BsPad2","_BsPad3","_BsPad4","_wpCnt","_wpPlus","_wpSlkLz","_wpSlkIp","_wpChkUn","_wpChkMv","_wpSlkBs","_arrX","_arrY","_arrZ","_arrXn","_arrYn","_wpSlkUn","_chkGrp","_chkGp1","_chkGp2","_chkGp3","_chkGp4","_strLnd","_strHgt","_formDis","_formOff","_fcFormWp","_fcDist","_fcOffs","_fcStrP","_fcEndP","_fcHead","_mkrZero","_mkrHold","_inbCnt","_inbArr","_inb0","_inb1","_inb2","_inb3","_inb4","_out0","_out1","_out2","_out3","_out4","_inbName","_outCnt","_outArr","_outName","_slkname","_slkhold","_slkzero","_slkdist","_slkArr","_debug","_debugTime","_spaceTime","_loadChk"];
    
    // var - misc controls //
    _debug = 1;
    _debugTime = 10;
    _spaceTime = 5;
    _loadChk = 1;
    
    // var - waypoints //
    _wpSlkLz = nil;
    _wpSlkIp = nil;
    _wpChkUn = nil;
    _wpChkMv = nil;
    _wpSlkBs = nil;
    _wpSlkUn = nil;
    
    // var - position array //
    _arrX = nil;
    _arrY = nil;
    _arrZ = nil;
    _arrXn = nil;
    _arrYn = nil;
    
    //var - position calculations //
    _fcHead = nil;
    _fcDist = nil;
    _fcOffs = nil;
    _fcStrP = nil;
    _fcEndP = nil;
    
    // var - inbound manual marker positions //
    _inbName = ["inb1","inb2","inb3","inb4"];
    _mkrZero = [0,0,0];
    _inbCnt = 0;
    _inbArr = [];
    _inb0 = [];
    _inb1 = getMarkerPos "inb1";
    _inb2 = getMarkerPos "inb2";
    _inb3 = getMarkerPos "inb3";
    _inb4 = getMarkerPos "inb4";
    
    // var - outbound manual marker positions //
    _outName = ["out1","out2","out3","out4"];
    _outCnt = 0;
    _outArr = [];
    _out0 = [];
    _out1 = getMarkerPos "out1";
    _out2 = getMarkerPos "out2";
    _out3 = getMarkerPos "out3";
    _out4 = getMarkerPos "out4";
    
    // function - calulate formation positions per leg flown - args [distance, angle offset, start point, end point] //
    _fcFormWp = {
    	_fcDist = _this select 0;
    	_fcOffs = _this select 1;
    	_fcStrP = _this select 2;
    	_fcEndP = _this select 3;
    	
    	_arrX = _fcEndP select 0;
    	_arrY = _fcEndP select 1;
    	_arrZ = _fcEndP select 2;
    
    	_fcHead = [_fcEndP, _fcStrP] call BIS_fnc_dirTo;
    	_fcHead = _fcHead + _fcOffs;
    	if (_fcHead > 360) then {_fcHead = _fcHead - 360};
    	if (_fcHead < 0) then {_fcHead = _fcHead + 360};
    	_arrXn = ((sin _fcHead) * _fcDist) + _arrX;
    	_arrYn = ((cos _fcHead) * _fcDist) + _arrY;
    	[_arrXn,_arrYn,_arrZ];
    	};
    
    // test for the existance of "slicks" - slick1,slick2,slick3,slick4 //
    _slkArr = [slick1,slick2,slick3,slick4] select {!isNull "_x"};
    
    //@@@@@//
    if  (_debug = 1) then 
    {
    hint format["Slick Array = %1",_slkArr];
    diag_log format ["SCO: Slick Array = %1",_slkArr];
    sleep _debugTime;
    };
    //@@@@@//
    
    // test for the existance of "inbound" waypoints - inb1,inb2,inb3,inb4 //
    {
    	_mkrHold = getMarkerPos _x;
    	_mkrDist = _mkrHold distance _mkrZero;
    	if ( _mkrDist != 0 ) then
    	{
    	[_inbArr,_x] call BIS_fnc_arrayPush;
    	};
    } foreach _inbName;
    
    // test for the existance of "outbound" waypoints - out1,out2,out3,out4 //
    {
    	_mkrHold = getMarkerPos _x;
    	_mkrDist = _mkrHold distance _mkrZero;
    	if ( _mkrDist != 0 ) then
    	{
    	[_outArr,_x] call BIS_fnc_arrayPush;
    	};
    } foreach _outName;
    
    // get marker counts //
    _inbCnt = count _inbArr;
    _outCnt = count _outArr;
    
    //@@@@@//
    if  (_debug = 1) then 
    {
    hint format ["Inbound=%1 Outbound=%2",_inbArr,_outArr];
    diag_log format ["SCO: Inbound=%1 Outbound=%2",_inbArr,_outArr];
    sleep _debugTime;
    };
    //@@@@@//
    
    // add inb0 (slick starting posit) to array //
    if (_inbCnt < 0) then 
    {
    	_mkrHold = _inbArr;
    	_inbArr = ["inb0"];
    	[_inbArr,_mkrHold] call BIS_fnc_arrayPushStack;
    	_inbCnt = count _inbArr;
    };
    
    // add out0 (slick lz posit) to array //
    if (_outCnt < 0) then 
    {
    	_mkrHold = _outArr;
    	_outArr = ["out0"];
    	[_outArr,_mkrHold] call BIS_fnc_arrayPushStack;
    	_outCnt = count _outArr;
    	_out0 = getPos _x;
    };
    
    // for each slick loop ///
    {
    	// get slick LZ and Base waypoint - get respective troop var //
    	switch (_x) do {
            case slick1: {
    						// create base helipad //
    						_BsPad1 = "Land_HelipadCircle_F" createVehicle position slick1,[],0,"CAN_COLLIDE";
    						_BsPad1 = getPos _BsPad1;
    						// create lz helipad //
    						_LzPad1 = "Land_HelipadCircle_F" createVehicle getMarkerPos "lz1";
    						_LzPad1 = getPos _LzPad1;
    						_slkUnt = slick1;
    						_slkGrp = group slick1;
    						_wpSlkLz = _LzPad1;
    						_wpSlkBs = _BsPad1;
    						_chkGrp = chalk1;
    						_strLnd = "slick1 land 'LAND'";
    						_strHgt = "slick1 flyInHeight 20";
    						_formDis = 100;
    						_formOff = 180;
    						_inb0 = _BsPad1;
    						_out0 = _LzPad1;
    						// troop delete all waypoints //
    						while {(count (waypoints _chkGrp)) > 0} do
    						{		
    							deleteWaypoint ((waypoints _chkGrp) select 0);
    						};
    						// slick delete all waypoints //
    						while {(count (waypoints _slkGrp)) > 0} do
    						{
    							deleteWaypoint ((waypoints _slkGrp) select 0);
    						};						
    					};
            case slick2: {
    						// create base helipad //		
    						_BsPad2 = "Land_HelipadCircle_F" createVehicle position slick2,[],0,"CAN_COLLIDE";
    						_BsPad2 = getPos _BsPad2;
    						// create lz helipad //
    						_LzPad2 = "Land_HelipadCircle_F" createVehicle getMarkerPos "lz2";
    						_LzPad2 = getPos _LzPad2;
    						// set vars //
    						_slkUnt = slick2;
    						_slkGrp = group slick2;
    						_wpSlkLz = _LzPad2;
    						_wpSlkBs = _BsPad2;
    						_chkGrp = chalk2;
    						_strLnd = "slick2 land 'LAND'";
    						_strHgt = "slick2 flyInHeight 22";
    						_formDis = 100;
    						_formOff = 45;
    						_inb0 = _BsPad2;
    						_out0 = _LzPad2;
    						// troop delete all waypoints //
    						while {(count (waypoints _chkGrp)) > 0} do
    						{		
    							deleteWaypoint ((waypoints _chkGrp) select 0);
    						};
    						// slick delete all waypoints //
    						while {(count (waypoints _slkGrp)) > 0} do
    						{
    							deleteWaypoint ((waypoints _slkGrp) select 0);
    						};
    					};
    		case slick3: { 	
    						// create base helipad //
    						_BsPad3 = "Land_HelipadCircle_F" createVehicle position slick3,[],0,"CAN_COLLIDE";
    						_BsPad3 = getPos _BsPad3;
    						// create lz helipad //
    						_LzPad3 = "Land_HelipadCircle_F" createVehicle getMarkerPos "lz3";
    						_LzPad3 = getPos _LzPad3;
    						// set vars //
    						_slkUnt = slick3;
    						_slkGrp = group slick3;
    						_wpSlkLz = _LzPad3;
    						_wpSlkBs = _BsPad3;
    						_chkGrp = chalk3;
    						_strLnd = "slick3 land 'LAND'";
    						_strHgt = "slick3 flyInHeight 19";
    						_formDis = 100;
    						_formOff = -45;
    						_inb0 = _BsPad3;
    						_out0 = _LzPad3;
    						// troop delete all waypoints //
    						while {(count (waypoints _chkGrp)) > 0} do
    						{		
    							deleteWaypoint ((waypoints _chkGrp) select 0);
    						};
    						// slick delete all waypoints //
    						while {(count (waypoints _slkGrp)) > 0} do
    						{
    							deleteWaypoint ((waypoints _slkGrp) select 0);
    						};
    					};
    		case slick4: { 
    						// create base helipad //
    						_BsPad4 = "Land_HelipadCircle_F" createVehicle position slick4,[],0,"CAN_COLLIDE";
    						_BsPad4 = getPos _BsPad4;
    						// create lz helipad //
    						_LzPad4 = "Land_HelipadCircle_F" createVehicle getMarkerPos "lz4";
    						_LzPad4 = getPos _LzPad4;
    						// set vars //
    						_slkUnt = slick4;
    						_slkGrp = group slick4;
    						_wpSlkLz = _LzPad4;
    						_wpSlkBs = _BsPad4;
    						_chkGrp = chalk4;
    						_strLnd = "slick4 land 'LAND'";
    						_strHgt = "slick4 flyInHeight 21";
    						_formDis = 100;
    						_formOff = 0;
    						_inb0 = _BsPad4;
    						_out0 = _LzPad4;
    						// troop delete all waypoints //
    						while {(count (waypoints _chkGrp)) > 0} do
    						{		
    							deleteWaypoint ((waypoints _chkGrp) select 0);
    						};
    						// slick delete all waypoints //
    						while {(count (waypoints _slkGrp)) > 0} do
    						{
    							deleteWaypoint ((waypoints _slkGrp) select 0);
    						};
    					};
        };
    	
    	// load chalk into slick //
    	if (_loadFlg = 1) then
    	{
    		{_x moveInCargo _slkUnt} foreach units _chkGrp;
    	};
    	
    	// if manual waypoint exist - else auto waypoint //
    	_wpCnt = 0;
    	if (_inbCnt > 0) then
    	{
    		// add "inbound" waypoint for manual marker - with offsets //
    		{
    			_formStr = call compile format ["_inb%1",_wpCnt];
    			_wpPlus = _wpCnt + 1;
    			_formEnd = call compile format ["_inb%1",_wpPlus];
    
    //@@@@@//
    if  (_debug = 1) then 
    {
    hint format ["FunCall-1 dis=%1 off=%2 str=%3 end=%4",_formDis,_formOff,_formStr,_formEnd];
    diag_log format ["SCO: FunCall-1 dis=%1 off=%2 str=%3 end=%4",_formDis,_formOff,_formStr,_formEnd];
    sleep _debugTime;
    };
    //@@@@@//
    
    			_wpForm = [_formDis,_formOff,_formStr,_formEnd] call _fcFormWp;
    			_wpSlkMv = _slkGrp addWaypoint [_wpForm,0];
    			_wpSlkMv setWaypointType "MOVE";
    			_wpSlkMv setWaypointBehaviour "CARELESS";
    			_wpCnt = _wpCnt + 1;
    		} foreach _inbArr;
    		
    		// add waypoint to lz //
    		_wpSlkUn = _slkGrp addWaypoint [_wpSlkLz,0];
    		_wpSlkUn setWaypointType "TR UNLOAD";
    		
    		// add "outbound" waypoint for manual marker - with offsets //
    		if (_outCnt > 0) then
    		{	
    			_wpCnt = 0;
    			{
    				_formStr = call compile format ["_out%1",_wpCnt];
    				_wpPlus = _wpCnt + 1;
    				_formEnd = call compile format ["_out%1",_wpPlus];	
    
    //@@@@@//
    if  (_debug = 1) then 
    {				
    hint format ["FunCall-2 dis=%1 off=%2 str=%3 end=%4",_formDis,_formOff,_formStr,_formEnd];
    diag_log format ["SCO: FunCall-2 dis=%1 off=%2 str=%3 end=%4",_formDis,_formOff,_formStr,_formEnd];
    sleep _debugTime;
    };
    //@@@@@//
    
    				_wpForm = [_formDis,_formOff,_formStr,_formEnd] call _fcFormWp;
    				_wpSlkMv = _slkGrp addWaypoint [_wpForm,0];
    				_wpSlkMv setWaypointType "MOVE";
    				_wpSlkMv setWaypointBehaviour "CARELESS";
    				_wpCnt = _wpCnt + 1;
    			} foreach _outArr;
    		};
    		
    		// add final waypoint to base //
    		_wpSlkBs = _slkGrp addWaypoint [_wpSlkBs,0];
    		_wpSlkBs setWaypointType "MOVE";
    		_wpSlkBs setWaypointStatements ["true", _strLnd];
    	}
    	else 
    	{
    		// get slick IP waypoint - bearing relative to start posit - COS and SIN reversed for BIS //
    		_formDis = 0;
    		_formOff = 0;
    
    //@@@@@//
    if  (_debug = 1) then 
    {
    hint format ["FunCall-3 dis=%1 off=%2 str=%3 end=%4",_formDis,_formOff,_wpSlkBs,_wpSlkLz];
    diag_log format ["SCO: FunCall-3 dis=%1 off=%2 str=%3 end=%4",_formDis,_formOff,_wpSlkBs,_wpSlkLz];
    sleep _debugTime;
    };
    //@@@@@//
    
    		_wpSlkIp = [_formDis,_formOff,_wpSlkBs,_wpSlkLz] call _fcFormWp;
    		
    		// create slick waypoints //
    		_wpSlkIp = _x addWaypoint [_wpSlkIp,0];
    		_wpSlkUn = _x addWaypoint [_wpSlkLz,0];
    		_wpSlkBs = _x addWaypoint [_wpSlkBs,0];
    		
    		_wpSlkIp setWaypointType "MOVE";
    		_wpSlkUn setWaypointType "TR UNLOAD";
    		_wpSlkUn setWaypointSpeed "LIMITED";
    		_wpSlkBs setWaypointType "MOVE";
    		_wpSlkBs setWaypointSpeed "NORMAL";
    		_wpSlkBs setWaypointBehaviour "CARELESS";
    		_wpSlkBs setWaypointCompletionRadius 50;
    		_wpSlkBs setWaypointStatements ["true", _strLnd];	
    	};
    	
    	// get LZ position and break down array //
    	_arrX = _wpSlkLz select 0;
    	_arrY = _wpSlkLz select 1;
    	_arrZ = _wpSlkLz select 2;
    	
    	// get chalk UNLOAD waypoint //
    	_arrXn = _arrX + 5;
    	_wpChkUn = [_arrXn,_arrY,_arrZ];
    	
    	// get chalk MOVE waypoint //
    	_arrXn = _arrX - 50;
    	_arrYn = _arrY + 50;
    	_wpChkMv = [_arrXn,_arrYn,_arrZ];
    	
    	// create chalk waypoints //
    	_wpChkUn = _chkGrp addWaypoint [_wpChkUn,0];
    	_wpChkMv = _chkGrp addWaypoint [_wpChkMv,0];
    
    	_wpChkUn setWaypointType "GETOUT";
    	_wpChkMv setWaypointType "MOVE";
    	_wpChkMv setWaypointBehaviour "COMBAT";
    	//_wpChkMv setWaypointSpeed "LIMITED";
    	_wpChkMv setWaypointFormation "WEDGE";
    	_wpChkMv	setWaypointCombatMode "RED";
    	
    	// sync unload waypoints - slick and chalk //
    
    //@@@@@//
    if  (_debug = 1) then 
    {	
    hint format ["_wpSlkUn=%1 _wpChkUn=%2",_wpSlkUn,_wpChkUn];
    diag_log format ["SCO: WP Sync _wpSlkUn=%1 _wpChkUn=%2",_wpSlkUn,_wpChkUn];
    sleep _debugTime;
    };
    //@@@@@//
    	
    	_wpSlkUn synchronizeWaypoint _wpChkUn;
    	
    	// sleep for spacing of slicks //
    	sleep _spaceTime;
    
    } foreach _slkArr;

     

     

     


  3. 1 hour ago, pierremgi said:

    if (!isNil "_x") then {hint format["slick = %1",_x]};

     

    Thanks Pierre - I'll give that a shot...

     

    I didn't have a chance to test - but looking at the WIKI - it seems that isNil  is looking specifically for a variable - - - while @jshock's - - - isNull is looking for an object - perhaps that's the cause of my error ??? "slick1" is a named asset in the editor so I would assume that's an object... I won't have a chance to try it until next weekend - but that's on the list now too...

     

    Regards,
    Scott


  4. Hi Folks,

     

    Just messing with my Air Assault script over the weekend (latest production build of ArmA) - successfully landing - dropping troops - then departing the area - all AI... This is all I'm setting... I do create invisible landing pads... Perhaps try "CARELESS" mode...

     

    _wpSlkUn setWaypointType "TR UNLOAD";
    _wpSlkUn setWaypointSpeed "LIMITED";
    _wpSlkUn setWaypointBehaviour "CARELESS";

     

    Regards,

    Scott


  5. That's weird, I just double checked if my -showScriptErrors wasn't set for some reason, but it's showing errors when doing naughty stuff like dividing through zero.
    I'm not getting any error and the select command properly returns all currently existing assets.
    Placed all 8 markers, copied your snippet all up to the point of the _slkarr with slick1 and slick2 present on the map, it returns both of them inside the array with no error.
    Try putting systemchat str _slkarr and see what it returns.
     
    Cheers
     


    Hi,

    Thanks - I really don't want to take too much of your time - really appreciate the extra mile - I'll try that system chat thing - never thought of that before - I always debug with hints which seem less than ideal... The hint I had does show the proper values for _slkarr = "slick1,slick2" and the helicopters will launch - strange you're not seeing the error...

    LOL - this is what happens when I try to improve the code...

    Regards,
    Scott




    Sent from my iPad using Tapatalk

  6. 7 hours ago, Grumpy Old Man said:

    If you know it's a finite amount of assets and you also know the name of all possible assets this will do:

    
    _existingSlicks = [slick1,slick2,slick3,slick4] select {!isNil "_x"};

    Cheers

     

    Hi,

     

    Re:

    • slick1 and slick2 exist;
    • slick 3 and slick 4 do not exist.

     

    I tried this - and like my earlier attempts - it works - but the script throws an error when it hits slick3; = "undefined variable" ???

     

    Complete Script:

    Spoiler
    
    
    //============================//
    // SLICKS - SCO Launch Script //
    //============================//
    
    // Note: Only tested in Single Player
    
    // Given: 1 to 4 helicopters preloaded with crew and infantry squads - units named in assets.
    // Given: Helicopters will assault LZ with defined helipads - drop troops - RTB to home helipads.
    // Given: User can define manual path with up to four inbound markers "inb1-inb4" if desired - else direct to LZ pad.
    // Given: User can define manual path with up to four outbound markers "out1-out4" if desired - else direct to BS pad.
    // Given: Example Flight Path - [BsPad1 -> inb1 -> inb2 -> inb3 -> inb4 -> LzPad1 -> out1 -> out2 -> BsPad1].
    // Given: In order to have outbound waypoints work - you need at least one inbound waypoint specified.
    // Given: Even though helicopters are individual units - they will maintain a diamond formation along flight path.
    
    // Named Asset: [OPTIONAL] ("s1" - player unit)
    // Named Asset: ("slick1" - slick helo) ("slick2" - slick helo) ("slick3" - slick helo) ("slick4" - slick helo)
    // Named Asset: ("chalk1" - inf squad) ("chalk2" - inf squad) ("chalk3" - inf squad) ("chalk4" - inf squad)
    // Named Marker: ("lz1" - lz pad marker) ("lz2" - lz pad marker) ("lz3" - lz pad marker) ("lz4" - lz pad marker)
    // Named Marker: [OPTIONAL] ("inb1" - inbound marker) ("inb2" - inbound marker) ("inb3" - inbound marker) ("inb4" - inbound marker) 
    // Named Marker: [OPTIONAL] ("out1" - outbound marker) ("out2" - outbound marker) ("out3" - outbound marker) ("out4" - outbound marker)
    
    // Classname: ("Land_HelipadEmpty_F" - invisible helipad)
    
    //@@@//
    hint "Slicks GO";
    sleep 2;
    //@@@//
    
    private ["_slkUnt","_slkGrp","_LzPad1","_LzPad2","_LzPad3","_LzPad4","_BsPad1","_BsPad2","_BsPad3","_BsPad4","_wpcnt","_wpplus","_wpslklz","_wpslkip","_wpchkul","_wpchkmv","_wpslkbs","_arrX","_arrY","_arrZ","_arrXn","_arrYn","_wpslkun","_chkgrp","_chkGp1","_chkGp2","_chkGp3","_chkGp4","_strlnd","_strhgt","_formdis","_formoff","_slkFrmWp","_dist","_offs","_strp","_endp","_head","_mkrzero","_mkrhold","_inbcnt","_inbarr","_inb0","_inb1","_inb2","_inb3","_inb4","_out0","_out1","_out2","_out3","_out4","_inbname","_outcnt","_outarr","_outname","_slkname","_slkhold","_slkzero","_slkdist","_slkarr","_debugTime"];
    
    _debugTime = 15;
    _counter = 0;
    
    // var - waypoints //
    _wpslklz = nil;
    _wpslkip = nil;
    _wpchkul = nil;
    _wpchkmv = nil;
    _wpslkbs = nil;
    _wpslkun = nil;
    
    // var - position array //
    _arrX = nil;
    _arrY = nil;
    _arrZ = nil;
    _arrXn = nil;
    _arrYn = nil;
    
    //var - position calculations //
    _head = nil;
    _dist = nil;
    _offs = nil;
    _strp = nil;
    _endp = nil;
    
    // var - manual marker positions //
    _mkrzero = [0,0,0];
    _inbcnt = 0;
    _inbarr = [];
    _inb0 = [];
    _inbname = ["inb1","inb2","inb3","inb4"];
    _inb1 = getMarkerPos "inb1";
    _inb2 = getMarkerPos "inb2";
    _inb3 = getMarkerPos "inb3";
    _inb4 = getMarkerPos "inb4";
    
    _outcnt = 0;
    _outarr = [];
    _outname = ["out1","out2","out3","out4"];
    _out0 = [];
    _out1 = getMarkerPos "out1";
    _out2 = getMarkerPos "out2";
    _out3 = getMarkerPos "out3";
    _out4 = getMarkerPos "out4";
    
    // function - calulate slick formation positions per leg flown - args [distance, angle offset, start point, end point] //
    _slkFrmWp = {
    	_dist = _this select 0;
    	_offs = _this select 1;
    	_strp = _this select 2;
    	_endp = _this select 3;
    	
    	_arrX = _endp select 0;
    	_arrY = _endp select 1;
    	_arrZ = _endp select 2;
    	
    	_head = [_endp, _strp] call BIS_fnc_dirTo;
    	_head = _head + _offs;
    	if (_head > 360) then {_head = _head - 360};
    	if (_head < 0) then {_head = _head + 360};
    	_arrXn = ((sin _head) * _dist) + _arrX;
    	_arrYn = ((cos _head) * _dist) + _arrY;
    	[_arrXn,_arrYn,_arrZ];
    	};
    
    // test for the existance of "slicks" - slick1,slick2,slick3,slick4 //
    
    _slkarr = [slick1,slick2,slick3,slick4] select {!isNil "_x"};
    
    //@@@//
    hint format["slick array = %1",_slkarr];
    sleep _debugTime;
    //@@@//
    	
    // test for the existance of "inbound" waypoints - inb1,inb2,inb3,inb4 //
    {
    	_mkrhold = getMarkerPos _x;
    	_mkrdist = _mkrhold distance _mkrzero;
    	if ( _mkrdist != 0 ) then
    	{
    	[_inbarr,_x] call BIS_fnc_arrayPush;
    	};
    } foreach _inbname;
    
    
    // test for the existance of "outbound" waypoints - out1,out2,out3,out4 //
    {
    	_mkrhold = getMarkerPos _x;
    	_mkrdist = _mkrhold distance _mkrzero;
    	if ( _mkrdist != 0 ) then
    	{
    	[_outarr,_x] call BIS_fnc_arrayPush;
    	};
    } foreach _outname;
    
    // get marker counts //
    _inbcnt = count _inbarr;
    _outcnt = count _outarr;
    
    //@@@//
    hint format ["inbound=%1 outbound=%2",_inbarr,_outarr];
    sleep _debugTime;
    //@@@//
    
    // add inb0 (slick starting posit) to array //
    if (_inbcnt < 0) then 
    {
    	_mkrhold = _inbarr;
    	_inbarr = ["inb0"];
    	[_inbarr,_mkrhold] call BIS_fnc_arrayPushStack;
    	_inbcnt = count _inbarr;
    };
    
    // add e0 (slick lz posit) to array // e0
    if (_outcnt < 0) then 
    {
    	_mkrhold = _outarr;
    	_outarr = ["out0"];
    	[_outarr,_mkrhold] call BIS_fnc_arrayPushStack;
    	_outcnt = count _outarr;
    	_out0 = getPos _x;
    };
    
    // slick delete all waypoints //
    while {(count (waypoints _x)) > 0} do
    {
    	deleteWaypoint ((waypoints _x) select 0);
    };
    	
    // troop delete all waypoints //
    while {(count (waypoints _chkgrp)) > 0} do
    {
    	deleteWaypoint ((waypoints _chkgrp) select 0);
    };
    
    // for each slick loop ///
    {
    	// get slick LZ and Base waypoint - get respective troop var //
    	switch (_x) do {
            case slick1: {
    						_BsPad1 = "Land_HelipadCircle_F" createVehicle position slick1,[],0,"CAN_COLLIDE";
    						_BsPad1 = getPos _BsPad1;
    						_LzPad1 = "Land_HelipadCircle_F" createVehicle getMarkerPos "lz1";
    						_LzPad1 = getPos _LzPad1;
    						_slkUnt = "slick1";
    						_slkGrp = group slick1;
    						_wpslklz = _LzPad1;
    						_wpslkbs = _BsPad1;
    						_chkgrp = chalk1;
    						_strlnd = "slick1 land 'LAND'";
    						_strhgt = "slick1 flyInHeight 20";
    						_formdis = 100;
    						_formoff = 180;
    						_inb0 = getPos slick1;
    						_out0 = _LzPad1;
    					};
            case slick2: {
    						_BsPad2 = "Land_HelipadCircle_F" createVehicle position slick2,[],0,"CAN_COLLIDE";
    						_BsPad2 = getPos _BsPad2;
    						_LzPad2 = "Land_HelipadCircle_F" createVehicle getMarkerPos "lz2";
    						_LzPad2 = getPos _LzPad2;						
    						_slkUnt = "slick2";
    						_slkGrp = group slick2;
    						_wpslklz = _LzPad2;
    						_wpslkbs = _BsPad2;
    						_chkgrp = chalk2;
    						_strlnd = "slick2 land 'LAND'";
    						_strhgt = "slick2 flyInHeight 22";
    						_formdis = 100;
    						_formoff = 45;
    						_inb0 = getPos slick2;
    						_out0 = _LzPad2;
    
    					};
    		case slick3: { 	
    						_BsPad3 = "Land_HelipadCircle_F" createVehicle position slick3,[],0,"CAN_COLLIDE";
    						_BsPad3 = getPos _BsPad3;
    						_LzPad3 = "Land_HelipadCircle_F" createVehicle getMarkerPos "lz3";
    						_LzPad3 = getPos _LzPad3;
    						_slkUnt = "slick3";
    						_slkGrp = group slick3;
    						_wpslklz = _LzPad3;
    						_wpslkbs = _BsPad3;
    						_chkgrp = chalk3;
    						_strlnd = "slick3 land 'LAND'";
    						_strhgt = "slick3 flyInHeight 19";
    						_formdis = 100;
    						_formoff = -45;
    						_inb0 = getPos slick3;
    						_out0 = _LzPad3;
    					};
    		case slick4: { 
    						_BsPad4 = "Land_HelipadCircle_F" createVehicle position slick4,[],0,"CAN_COLLIDE";
    						_BsPad4 = getPos _BsPad4;
    						_LzPad4 = "Land_HelipadCircle_F" createVehicle getMarkerPos "lz4";
    						_LzPad4 = getPos _LzPad4;
    						_slkUnt = "slick4";
    						_slkGrp = group slick4;
    						_wpslklz = _LzPad4;
    						_wpslkbs = _BsPad4;
    						_chkgrp = chalk4;
    						_strlnd = "slick4 land 'LAND'";
    						_strhgt = "slick4 flyInHeight 21";
    						_formdis = 100;
    						_formoff = 0;
    						_inb0 = getPos slick4;
    						_out0 = _LzPad4;
    					};
        };
    
    	// if manual waypoint exist - else auto waypoint //
    	_wpcnt = 0;
    	if (_inbcnt > 0) then
    	{
    		// add "inbound" waypoint for manual marker - with offsets //
    		{
    			_formstr = call compile format ["_inb%1",_wpcnt];
    			_wpplus = _wpcnt + 1;
    			_formend = call compile format ["_inb%1",_wpplus];
    			
    //@@@//
    hint format ["pos1 dis=%1 off=%2 str=%3 end=%4",_formdis,_formoff,_formstr,_formend];
    sleep _debugTime;
    //@@@//
    
    			_wpform = [_formdis,_formoff,_formstr,_formend] call _slkFrmWp;
    			_wpslik = _slkGrp addWaypoint [_wpform,0];
    			_wpslik setWaypointType "MOVE";
    			_wpslik setWaypointBehaviour "CARELESS";
    			_wpcnt = _wpcnt + 1;
    		} foreach _inbarr;
    		
    		// add waypoint to lz //
    		_wpslkun = _slkGrp addWaypoint [_wpslklz,0];
    		_wpslkun setWaypointType "TR UNLOAD";
    		
    		// add "outbound" waypoint for manual marker - with offsets //
    		if (_outcnt > 0) then
    		{	
    			_wpcnt = 0;
    			{
    				_formstr = call compile format ["_out%1",_wpcnt];
    				_wpplus = _wpcnt + 1;
    				_formend = call compile format ["_out%1",_wpplus];	
    
    //@@@//				
    hint format ["pos2 dis=%1 off=%2 str=%3 end=%4",_formdis,_formoff,_formstr,_formend];
    sleep _debugTime;
    //@@@//
    
    				_wpform = [_formdis,_formoff,_formstr,_formend] call _slkFrmWp;
    				_wpslik = _slkGrp addWaypoint [_wpform,0];
    				_wpslik setWaypointType "MOVE";
    				_wpslik setWaypointBehaviour "CARELESS";
    				_wpcnt = _wpcnt + 1;
    			} foreach _outarr;
    		};
    		
    		// add final waypoint to base //
    		_wpslkbs = _slkGrp addWaypoint [_wpslkbs,0];
    		_wpslkbs setWaypointType "MOVE";
    		_wpslkbs setWaypointStatements ["true", _strlnd];
    	}
    	else 
    	{
    		// get slick IP waypoint - bearing relative to start posit - COS and SIN reversed for BIS //
    		_formdis = 0;
    		_formoff = 0;
    
    //@@@//
    hint format ["pos3 dis=%1 off=%2 str=%3 end=%4",_formdis,_formoff,_wpslkbs,_wpslklz];
    sleep _debugTime;
    //@@@//
    		_wpslkip = [_formdis,_formoff,_wpslkbs,_wpslklz] call _slkFrmWp;
    	
    		// create slick waypoints //
    		_wpslkip = _x addWaypoint [_wpslkip,0];
    		_wpslkun = _x addWaypoint [_wpslklz,0];
    		_wpslkbs = _x addWaypoint [_wpslkbs,0];
    		
    		_wpslkip setWaypointType "MOVE";
    		_wpslkun setWaypointType "TR UNLOAD";
    		_wpslkun setWaypointSpeed "LIMITED";
    		_wpslkbs setWaypointType "MOVE";
    		_wpslkbs setWaypointSpeed "NORMAL";
    		_wpslkbs setWaypointBehaviour "CARELESS";
    		_wpslkbs setWaypointCompletionRadius 50;
    		_wpslkbs setWaypointStatements ["true", _strlnd];	
    	};
    	
    	// get LZ position and break down array //
    	_arrX = _wpslklz select 0;
    	_arrY = _wpslklz select 1;
    	_arrZ = _wpslklz select 2;
    	
    	// get chalk UNLOAD waypoint //
    	_arrXn = _arrX + 5;
    	_wpchkul = [_arrXn,_arrY,_arrZ];
    	
    	// get chalk MOVE waypoint //
    	_arrXn = _arrX - 50;
    	_arrYn = _arrY + 50;
    	_wpchkmv = [_arrXn,_arrYn,_arrZ];
    	
    	// create chalk waypoints //
    	_wpchkul = _chkgrp addWaypoint [_wpchkul,0];
    	_wpchkmv = _chkgrp addWaypoint [_wpchkmv,0];
    
    	_wpchkul setWaypointType "GETOUT";
    	_wpchkmv setWaypointType "MOVE";
    	_wpchkmv setWaypointBehaviour "COMBAT";
    	//_wpchkmv setWaypointSpeed "LIMITED";
    	_wpchkmv setWaypointFormation "WEDGE";
    	_wpchkmv	setWaypointCombatMode "RED";
    	
    	// sync unload waypoints - slick and chalk //
    	_wpslkun synchronizeWaypoint _wpchkul;
    	
    	// sleep for spacing of slicks //
    	sleep 5;
    
    } foreach _slkarr;

     

     

    Regards,

    Scott


  7. {//@@@//hint format["slick = %1",_x];sleep _debugTime;//@@@//if (!isNull _x) then{	_slkhold = getpos _x;	_slkdist = _slkhold distance _slkzero;	if ( _slkdist != 0 ) then	{		_slkarr pushBack _x;	};};} foreach _slkname;

    Firstly, I recommend the pushBack command, used above, instead of the BIS function. Secondly, I think you switch statement was redundant. Thirdly, the !isNull at the top checks if each object exists before running any code on it.

     

     

    Hi...

     

    Hah - "redundant" - so it is - yeah - it's a WIP - I had found commands I used later on required the group name instead of the asset name - so I was pulling the group name initially - I must have changed it - the distance check seemed to be working even though it was throwing the error when the asset didn't exist... I'll look at the command you suggested and take it on board... Half the battle is just finding the proper command to use on the wiki...

     

    Thank you !!!

     

    Regards,

    Scott

     

     

     

    Sent from my iPad using Tapatalk


  8. Hi Folks,

     

    How do you test to see if the asset exits - in my case a helicopter named "slick1" ? The end result I need an array with only those helicopters that exist...

     

    I started with checking the distance from 0-0-0 - a kludge I know...

     

    {
    
    //@@@//
    hint format["slick = %1",_x];
    sleep _debugTime;
    //@@@//
    
    	_slkhold = getpos _x;
    	_slkdist = _slkhold distance _slkzero;
    	if ( _slkdist != 0 ) then
    	{
    	switch (_x) do {
    		case slick1: { _slkGrp = slick1 };
    		case slick2: { _slkGrp = slick2 };
    		case slick3: { _slkGrp = slick3 };
    		case slick4: { _slkGrp = slick4 };
    	};
    	[_slkarr,_slkGrp] call BIS_fnc_arrayPush;
    	};
    } foreach _slkname;

     

    Then I tried isNull - which is not working at all:

     

    if (isNull slick4) then {hint "true"};
    sleep 10;

     

    The problem is if I try to call an asset that doesn't exist - the script throws an error on the screen...

     

    So how do I get an array with only those helicopters that exist out of a given list ???

     

    Thanks...

     

    Regards,
    Scott


  9. Hi Kludo,

     

    Yeah - we were all x-military defense contractors - so the camaraderie was good - just a bit tough on family life... The SEALS go through "hell week" out there - so always something interesting going on... I lasted four years before moving on to other things...

     

    All sounds good - love the Bahamas too...

     

    Regards,

    Scott

    • Like 1

  10. Hi MC,

     

    One other thought of minor importance if interested in constructive feedback - while I like the icon on the interface wheel for "Enhanced Movement" (very cool icon) - - - when it displays with your traditional placement icons on the terrain itself - it just kind of stands out like a sore thumb every time I see it - it doesn't seem to fit - I'd suggest finding an icon more along the lines (color shape) with those you already use - merely a look and feel aesthetic suggestion - so very low on the importance scale - take it for what it's worth...

     

    Regards,

    Scott

    • Like 1

  11. Hi Johnny,

    Just a coincidence - recently came across the video of your dog and was thoroughly amazed...

    Thanks for taking the time an posting this...

    Yeah - I wanted to stay away from the "capture" thing - as that's a one time only deal - I'd prefer a more modular script - where - with a few changes - it could used with a variety of boats at any beach...

    It seems we may have examples of both functions needed posted here - approach and egress - so maybe I can get something going - I'm just an intermediate level scripter though - LOL - so don't expect elegant... I'll post anything I figure out here... Probably more questions though - before a real answer... I can't test until the weekend...

    Regards,
    Scott






    Sent from my iPad using Tapatalk

    • Like 1

  12. Hi MC,

     

    Yeah - FHQ - yes - sorry - you nailed it...

     

    I followed Woofer's guidance in one of his videos - Careless - Hold Fire - FHQ Mod - etc etc etc - and they all seem to disengage and run with me if we have to move - no matter how bad the combat... It seems to work every time... All initiated by a single voice command...

     

    Thanks for the info...

     

    However you would see fit would be fine on boats - and appreciated... I've been messing with scripting them myself lately and all I'm trying to do is to get the AI to do a simple beach insertion on command - pull the bow up to the beach - disembark the shore party - then backup and leave the area - LOL - it's harder than it sounds - at least at my skill level...

     

    Regards,
    Scott

     

     

    • Like 1

  13. Hi MC,

     

    Thanks so much - sounds fantastic - using Voice Attack as well (don't know how I could play SP without it) - started with Woofer's most excellent profile but now most of it has been customized for my own needs... The combo of C2 and VA makes it feel like you are almost commanding real troops...

     

    Is the "autocombat" similar to the FWC AutoCombat Mod - meaning I could use C2 and delete the mod ? FWC seems to work pretty well at getting troops to disengage from combat when needed...

     

    What exactly does the "refresh groups" do ?

     

    I have read the manual and I didn't note any specifics...

     

    If you could ever improve AI boat ops - that would be most welcome as well...

     

    Appreciate all your efforts...

    :thumb:

     

    Regards,
    Scott


  14. Hi Folks,

     

    My mission/scripting question for this week - spent a few hours trying to get something that works - not much luck so far... So has anyone managed to get some form of AI Boat Beach Insertion working ??? Ideally - I'd like the boat to come charging up to the beach - until the bow contacts the beach - unload me and my AI Squad - then backup and peel away... LOL - like THAT's ever going to happen... Seems like the boat path finding is very bad - anytime it gets close to shore - it just stops an unrealistic distance away... I've tried just paralleling in at a shallow angle - same difference... I made sure the WP completion radius was very small - no joy... If I drive the boat into the beach myself - then script for AI to take over as driver and  add a waypoint - the AI isn't even capable of backing up to go back to sea... I can script at an intermediate level if needed and would welcome anyone's insights that may have worked something similar...

     

    Thanks...

     

    Regards,
    Scott


  15. Hi Folks,

     

    Question - I searched this thread and I see mention of a generic voice module - do any of the factions have voice enabled ? I was surprised to find out how much I rely on feedback from my AI squad ? I keep walking into ambushes now - it's WAY harder...

    :f:

     

    Regards,

    Scott

×