Jump to content
nephros

[SP]SAINT 4-1: Helicopter Pilot Altis

Recommended Posts

[sP] SAINT 4-1: Helicopter Pilot Altis
 
Requirements:
 helicopters DLC
 
Brief: 
This is a dynamic task-based helicopter pilot game.  All base helicopter models and some variants are available in game.  Missions are randomly assigned by calling in for assignment via the radio menu.
 
Features:
-Choose a specific mission time, or random.
-Weather changes randomly with time changes.

-Mission type can be toggled to completey random vs. helicopter specific

-Missions can be cancelled.

-ambient helicopters and planes

-radio text chat can be toggled on/off (in cockpit - for those who want unobstructed view of instrument panel)
-Request team of 0-3 crew members for your helicopter, change as needed.
-29 mission types including transport, slingload, and attack varieties with random placement.

-Random enemy patrol presence around landing zones

-GPS coordinates of landing zones occasionally inaccurate, requiring player to search for troops

-Random enemy AA throughout map, location changes each mission.

-adjustable difficulty: no AA, light AA (one rocket each), regular AA (1-4 rockets each)
-Functional doors on some helicopter models.
-Artillery support available.
-In case of crash – must destroy helicopter, move to extract site, and call for extraction to airbase. Any troops currently in transport will disembark and wait for you to return.
-Rearm, repair, refuel helipads available at main airbase.

-Can dump fuel from cockpit menu to 25%, 50%, or 75%, which will change helicopter weight and thereby change slingloading weight capacity. Presence of crew members adds weigh to helicopters.

-Slingloading targets have variable weights, helicopters may require modification as above in order to slingload.

-Table of helicopter external weight limits vs. fuel tank level in map menu.
-Taru missions involve switching to correct loadout.

-medevac patient injury severity is random, deteriorates with time in flight
-Basic mission stats are kept in logbook.
 

Missions:

Troop transport
Medevac from field
Medevac from convoy hit by IED
Civilian Medevac
Patrol field insertion
Patrol field extraction
Nap of earth  patrol insertion
Nap of earth patrol extraction
Sniper team insertion
Sniper team extraction
Search and rescue - land
Search and rescue - water
Search and rescue civilians - water
Slingload supplies to base

slingload supplies to troops in field

slingload damaged vehicles from troops in field to base

Recovery damaged helicopter by slingloading
Fastrope insertion
Fly patrol - land
Fly patrol - water
Close air support
Seek and Destroy mortar position
Destroy convoy
Destroy Armor group

Destroy helicopter
Destroy target in building
Destroy enemy patrol


 
Available Helicopters:

MH-9 Hummingbird
AH-9 Pawnee
UH-80 Ghosthawk (black /camo)
CH-67 Huron (armed/unarmed)
AH-99 Blackfoot
CH-49 Mohawk
PO-30 Orca (armed, unarmed, whale)
Mi-48 Kajman (black/camo)
WY-55 Hellcat (armed/unarmed)
Mi-290 Taru (base/ammo/bench/box/covered/fuel/medevac/repair)


 
Mission Briefing:

Situation:
You are an all-purpose rotary wing aircraft pilot in squadron HMU-86 'Saints', callsign SAINT 4-1, stationed at Altis Airbase.
 
Mission:
Fly missions in support of NATO forces on Altis
 

Friendly Forces:
NATO has 5 bases, 6 airfields and 17 outposts strategically located across Altis. There are 3 hospitals in use for medevac at Pyrgos, Kavala, and Altis airbase.There are 10 NATO artillery sites stationed within bases/outposts.
 
Enemy Forces:
All areas outside of NATO bases should be considered hostile. Insurgents armed with anti-aircraft weapons are present within the civilian population, so you may be subject to enemy fire at any time and location.
 
Execution:
1) Use radio to request / cancel assignment.
2) Helicopter crew can be summoned personally at HQ or via radio when near HQ/helipads.
3) Helicopter loadout can be modified at that helicopter's landing pad.
 
Settings (can be customized at HQ at map stand):
1) Time (weather changes randomly with time)
2) Difficulty - 
    - no enemy AA
    - light AA (armed with 1 rocket each)
    - regular AA (armed with 1-4 rockets)
3) Mission Randomization - determines what kind of mission is assigned when requested from inside helicopter
    - Helicopter specific: Only missions your helicopter can fly will be chosen
    - Completely Random: Any mission may be chosen.
4) Turn Radio off/on: Toggles radiochat text (as seen in cockpit). Turn off for unimpeded view of instrument panel. 
 
Support:
1) Supply crates are at HQ. 
2) Medical supplies- Supply crates at HQ, and ambulances/medical supplies at each hospital
3) Rearm - helipad at Altis Airbase.
4) Refuel - helipad at Altis Airbase.
5) Repair - helipad at Altis Airbase.
6) Artillery - when requested via the radio menu you will activate the closest of 10 artillery sites, which will become available from your support menu. You will be notified what artillery types are in range of your current position.
7) Crash - If you crash, call in from the radio menu for instructions. When a crash has been reported, any troops you are currently transporting will disembark and wait for you to return in a functional helicopter.
8) Extraction - If you crash beyond walking distance from Altis Airbase, request extraction via the radio menu and follow the instructions. Beware of possible enemy infantry nearby!
9) Replace lost helicopter - if you lose a helicopter, a new one can be requisitioned from the appropriate branch of armed services at HQ, at the map stand.
 
Notes:
1) Door Guns: When boarding the CH-67 Huron, your crew will not automatically man the door guns. The pilot action menu contains an option to 'man door guns'.
2) Opening doors: The UH-80 GhostHawk, CH-49 Mohawk, and CH-67 Huron have moveable doors/ramps, which will need to be opened for troops to enter and exit the helicopter. This is done through the pilot action menu.
3) Fast roping / rescue winching: Some missions involve fast roping or rescue winching when helicopter landing is not possible (i.e. ocean rescue). These are done using the slingload function. The slingload assistant will display a 'slingloadable' target at the designated waypoint. Use the slingload command to deploy rope and hover over the target until the action is complete.
4) Anti-aircraft fire: avoid anti-aircraft fire by flying below 25m altitude.
5) There is an explosive charge in the cargo inventory of every helicopter.
6) Dump fuel: Fuel can be dumped to 75%, 50%, or 25% from cockpit action menu.
7) Logbook: In radio menu, keeps track of your mission details.
8) Weight table: Helicopter specific weight table listing maximum external load vs. fuel tank level found in map menu.
 
Tips:
2) Carry signalling smoke grenades, IR-strobe (at night), and an explosive charge when you fly in case you crash. Check your helicopter inventory.
3) Your journal has an overview of the mission and grid coordinates of the pertinent waypoints.
4) Navigate using GPS and waypoint coordinates, or shift left-mouse on map to create a real world waypoint marker. This is helpful for identifying a specific house within a city.
5) On Search and Rescue missions, your target will attempt to signal you with a smoke grenade, IR-strobe, or flare if they detect you are nearby.
6) Avoiding anti-aircraft fire: Drop your collective and nose down with hard right pedal while deploying chaff. Or fly below 25m.
7) Medevac patient injuries are random and worsen with time during flight.
8) Presence, position, and strength of any enemy near Landing zones is random.
9) GPS coordinates will occasionally be inaccurately relayed to you (up to 25% of the time), so if your troops aren't at the map marker, search for them!

 
Known Bugs:

  • If a mission “field†objective point is created very close to your starting location, enemy AA will fire at you even when below 25m.

 

Acknowledgements:

Thanks to TeTeT and MrAlfred for mission ideas and technical assistance

 

Download:                                                                                                
steam link: http://steamcommunity.com/sharedfiles/filedetails/?id=600926531
Armaholic mirror: http://www.armaholic.com/page.php?id=30206 

 

All Input on bugs, potential future mission types,  and game play are welcome.
Thanks!
 
Nephros

  • Like 2

Share this post


Link to post
Share on other sites

I accidentally uploaded a test version that only has one mission type active. I won't be able to fix it until I get home from work this afternoon, so I'd hold off on downloading until then. :angry:

 

EDIT -

 

I'm not terribly competent. I'm getting error message 'File not found' when attempting to replace upload with proper version, so I created a new submission. The link above has been corrected.

Share this post


Link to post
Share on other sites

Mission updated.

 

Changelog:

-fixed rearm/refuel/repair bug

-added option to dump fuel to 25%, 50%, 75% from helicopter cockpit action menu

-added ambient helicopters

-added adjustable difficulty settings at HQ. Options: no AA, light AA (armed with one rocket each), regular AA (armed with between 1-4 rockets each). Does not apply to NOE missions

-tweaked aesthetics in HQ map stand action menu

Share this post


Link to post
Share on other sites

Holy cow.  For helicopter fans, this is the most awesome set of missions I've seen yet.  Fantastic!  Love it.  Thank you so much.

 

Is there any chance of making it 2-4 player coop capable?

 

If multiplayer breaks some of the triggers, perhaps the live players could have the option to manually mark each mission a "success" or "failure", and then call another mission when the team is ready???

 

I think 2-4 player co-op with helo missions would be the ultimate ARMA 3.  You could have one player be the "rescue diver" and jump in the water to swim to the boat.  You could have a team of Spec Ops be inserted in enemy territory to intercept an enemy convoy, or locate a weapon cache, etc.  Stuff like that.  Small squad ops.  Small rescue team.  Small sling-load missions with live players telling you to fly "lower-lower-lower-left-left".  Small firefights in small villages (small numbers of enemy troops for these firefights = more frame-rate friendly gameplay?!?).

 

I would love to jump into ARMA 3 with one,two, or three friends and play a few missions like this each night.  Small group helicopter teamwork for 2 to 4 players would be spectacular.

 

-V

Share this post


Link to post
Share on other sites

This sounds awesome. I can't wait to try it! I was actually making something similar myself as a means to learn scripting.

Share this post


Link to post
Share on other sites

Holy cow.  For helicopter fans, this is the most awesome set of missions I've seen yet.  Fantastic!  Love it.  Thank you so much.

 

Is there any chance of making it 2-4 player coop capable?

 

If multiplayer breaks some of the triggers, perhaps the live players could have the option to manually mark each mission a "success" or "failure", and then call another mission when the team is ready???

 

I think 2-4 player co-op with helo missions would be the ultimate ARMA 3.  You could have one player be the "rescue diver" and jump in the water to swim to the boat.  You could have a team of Spec Ops be inserted in enemy territory to intercept an enemy convoy, or locate a weapon cache, etc.  Stuff like that.  Small squad ops.  Small rescue team.  Small sling-load missions with live players telling you to fly "lower-lower-lower-left-left".  Small firefights in small villages (small numbers of enemy troops for these firefights = more frame-rate friendly gameplay?!?).

 

I would love to jump into ARMA 3 with one,two, or three friends and play a few missions like this each night.  Small group helicopter teamwork for 2 to 4 players would be spectacular.

 

-V

 

You are the 3rd person to ask about co-op, so I suppose I should start looking into it.  :)

 

Unfortunately I don't know anything about multiplayer scripting yet, so it will probably take me a while. Thanks for the kind words!

Share this post


Link to post
Share on other sites

This sounds awesome. I can't wait to try it! I was actually making something similar myself as a means to learn scripting.

 

I've just had a quick play and it was good. One bug (though I might not have the controls and orders correct) is that after crashing with a section on board, there was no option to order them to disembark, so I had to blow them with the helicopter. We were only 10m from the target!

Share this post


Link to post
Share on other sites

I've just had a quick play and it was good. One bug (though I might not have the controls and orders correct) is that after crashing with a section on board, there was no option to order them to disembark, so I had to blow them with the helicopter. We were only 10m from the target!

 

I'll  make it so that calling in a crash also makes all units on that helicopter disembark. Perhaps I can also figure out how to make them board a new helicopter so you can return and complete the mission.  

Share this post


Link to post
Share on other sites

Mission updated:

 

-'Request Assignment' and 'Call out of current Assignment' only show up in your radio menu when they are available options
-added markers for player helipads, non-playable helipads to map
-Mission Randomization can now be toggled at HQ. When called from a helicopter it can either be helicopter specific, or completely random. This is so that if you want completely random missions you don't have to exit your helicopter after every mission before requesting a new one.
-slingload missions now have no enemy AA
-fixed patrol ID bug where it was giving patrols duplicate names
-On reporting crash, all passengers will disembark and wait for pickup so you can continue the mission if you wish. Medevac patients will probably be dead by then though :)
-Crew can be requested / changed via radio menu when in proximity to HQ, landing pads. When you land they will disembark, and new crew will spawn at HQ. So you don't have to go to HQ every time you change your crew.
-Reworked extraction - Now you pop smoke only when extraction helicopter is near the pickup site (but it still won't land without smoke/strobe), and it will automatically take you back to base.
-modified SAR mission so 25% of time the wreck doesn't smoke, for increased difficulty.
-added documentation to briefing- gps is sometimes reported inaccurately (up to 25%), so if your troops aren't at the waypoint you need to search around the area. And enemy patrols at LZs are random wrt presence and location.
-added ambient plane flight
-fixed order new heli bug
-added IR strobe / green flare to heli cargo
-added 5 airports as mission destinations
-refuel station will no longer drive away :)

Share this post


Link to post
Share on other sites

Wow.  That list of fixes is very impressive.  I really have a blast flying these missions.  Thank you sooooooo much Nephros!!!  I was hoping that BIS would create helicopter missions like this, but you've totally nailed it.  Thanks again.  You rock!

 

-V

 

PS.  I'm still hoping you can create these same missions for 2-4 player coop, but I fully understand that coop missions are a 100x more complex to get working right.  So even if you can't get coop working, I still love the single player stuff.  Flying super low to avoid AA missiles while flying these missions is just too much fun.

  • Like 1

Share this post


Link to post
Share on other sites

Mission updated:


 


- Patrol and attack missions include enemy helicopters


- Slingloading reworked: Slingloading targets have variable weights.  Helicopter weight changes dynamically based on fuel level and number of helicopter crew, which may require adjustment in order to slingload an item. A table of helicopter maximum external weight capacity vs. fuel tank level is found in the map menu, titled 'Weight Table'


- Added mission: Recover damaged helicopter via slingloading.


- Aesthetic changes:


    - Ambient helicopter helipads now flank player helipads on both sides, making take off and landing at base more challenging.


    - Player now starts game in HQ facing map of Altis, where mission settings can be adjusted, in order to minimize confusion.


  • Like 2

Share this post


Link to post
Share on other sites

I love this mission.

I'd like a little more ambient helo's and planes to take off work the pattern and land. Or takeoff land at another airport delay for a few minutes and come back to original destination.

This particular ambience could be used in other missions or editor for playing around.

Anyway you would share the ambient aircraft script you are using?

Any plans to add more ambience to the current mission?

Thanks for considering. I've spent hours already playing this.

Share this post


Link to post
Share on other sites

Thanks for the feedback.

 

For the ambient air I have 2 scripts running, one for helicopters and one for the plane.

The ambient scripts call 'masterArray', which is an array of multiple other arrays, and is called by almost all my scripts. It includes arrays of waypoints used for missions, sorted by type. These waypoints are invisible helipads placed on the map and given names listed in the arrays. Note that some of the waypoint arrays are nested arrays including both the location and a string name (base, fob, hospital, airport). The 'landat' codes for the different airports on Altis are also listed in my init for reference. Hopefully you can figure it out by looking through the scripts, but here is the code in my init that shows how 'masterArray' is built:

//List of helipad sites sorted by type, and id names for groupID random name generator
//aoArray radius 2500, waterArray radius 1000, deepwaterArray radius 2500
aoArray = [ao1, ao2, ao3, ao4, ao5, ao6, ao7, ao8, ao9, ao10, ao11, ao12, ao13, ao14, ao15, ao16, ao17, ao18, ao19, ao20, ao21, ao22];
idARRAY = ["ALPHA", 'BRAVO', 'CHARLIE', 'DELTA', 'ECHO', 'FOXTROT', 'GOLF', 'HOTEL', 'INDIA', 'KILO', 'LIMA', 'MIKE', 'NOVEMBER', 'OSCAR', 'PAPA', 'QUEBEC', 'ROMEO', 'SIERRA', 'TANGO', 'UNIFORM', 'VICTOR', 'WHISKEY', 'X-RAY', 'YANKEE', 'ZULU'];
baseArray = [[base1, "Altis Airfield"], [base2, "Camp Longhorn"], [base3, "Camp Sooner"], [base4, "Camp Red Raider"], [base5, "Camp Bear"], [planePad2, "AAC Airfield"], [planePad3, "Ammolofi airfield"], [planePad4, "Molos Airfield"], [planePad5, "Almyra Salt Lake Airstrip"], [planePad6, "Selakeno Airfield"]];
fobArray = [[fob1, "Outpost Horned Frog"], [fob2, "Outpost Cyclone"], [fob3, "Outpost Mountaineer"], [fob4, "Outpost Cowboy"], [fob5, "Outpost Jayhawk"], [fob6, "Outpost Wildcat"], [fob7, "Outpost Aggie"], [fob8, "Outpost Mustang"], [fob9, "Outpost Bruin"], [fob10, "Outpost Buckeye"], [fob11, "Outpost Trojan"], [fob12, "Outpost Gator"], [fob13, "Outpost Wolverine"], [fob14, "Outpost Irish"], [fob15, "Outpost Seminole"], [fob16, "Outpost Bronco"]];
waterArray = [w_1, w_2, w_3, w_4, w_5, w_6, w_7, w_8, w_9, w_10, w_11, w_12, w_13, w_14, w_15, w_16, w_17, w_18, w_19, w_20, w_21, w_22, w_23, w_24, w_25, w_26, w_27, w_28, w_29, w_30, w_31, w_32, w_33, w_34, w_35, w_36, w_37, w_38, w_39, w_40, w_41, w_42, w_43, w_44, w_45, w_46, w_47, w_48, w_49, w_50, w_51, w_52, w_53, w_54, w_55, w_56];
mountainArray = [m_1, m_2, m_3, m_4, m_5, m_6, m_7, m_8, m_9, m_10, m_11, m_12, m_13, m_14, m_15, m_16, m_17, m_18, m_19, m_20, m_21, m_22, m_23, m_24, m_25, m_26, m_27, m_28, m_29, m_30, m_31, m_32, m_33, m_34, m_35, m_36, m_37, m_38, m_39, m_40, m_41, m_42, m_43, m_44, m_45, m_46, m_47, m_48, m_49, m_50, m_51, m_52, m_53, m_54, m_55];
hospitalArray = [[med1, "Kavala Hospital"], [med2, "Altis Airbase Hospital"], [med3, "Pyrgos Hospital"]]; //6
slingloadArray = [dock, airportDepot, waterDock, huronSite]; 
artyArray = [arty1, arty2, arty3, arty4, arty5, arty6, arty7, arty8, arty9, arty10];
deepWaterArray = [dw_1, dw_2, dw_3, dw_4, dw_5, dw_6, dw_7, dw_8, dw_9, dw_10, dw_11, dw_12, dw_13, dw_14, dw_15, dw_16, dw_17, dw_18, dw_19];
airportArray = [[planePad2, "AAC Airfield"], [planePad3, "Ammolofi airfield"], [planePad4, "Molos Airfield"], [planePad5, "Almyra Salt Lake Airstrip"], [planePad6, "Selakeno Airfield"]];
//doesn't include altis airbase. Landat codes: altis 0, aac 1, ammolifi 2, selakeno 3, molos 4, almyra 5
masterArray = [baseArray, waterArray, mountainArray,  hospitalArray, idArray, fobArray, aoArray, slingloadArray, deepWaterArray, artyArray, airportArray];
//		  0	      1		    2		     3	 	4	 5	   6	      7			8	     9		10
 

For the ambient plane the following goes in the init:

-All ambient planes / helicopters are civilian and set friendly to opfor so they aren't shot down and don't shoot at opfor.

-deepwater array is an array of sites nearest to the edges of the map. The plane basically flies from the main airport in a random direction to a point near the edge of the map, then returns and lands at the airbase. Then repeats.

-You'll notice PlaneTypeList is an array with only one variable. It started with more, but other planes wobble strangely on takeoff so I removed them. More planes can be added to the array if you want random plane types to spawn on loading.

civHQ = createCenter CIVILIAN;
CIVILIAN setfriend [EAST, 1]; //keeps ambient air from shooting at opfor

//ambient Airplane init
PlaneTypeList = ["B_Plane_CAS_01_F"];
ambientPlaneGroup1 = createGroup CIVILIAN;
ambientPlaneLoop1 = [planeTypeList, deepWaterArray, ambientPlaneGroup1, 1]execVM "scripts\ambient\ambientPlane.sqf";

The script-  "scripts\ambient\ambientPlane.sqf"

-PlanePad1 is a position just north of Alikampos, where the plane spawns. If it spawns too close to the airport it can't execute the 'landat' code properly, so I  always have it return to this position prior to landing, about 2500m away on an approach heading to the airport. This is still buggy, in that occasionally the plane gets caught in a loop circling the airport.

-The scipt is set up so I can easily add a second plane by activating the inactive code, but I haven't tested this yet.

//"scripts\ambient\ambientPlane.sqf"
//2016 by Nephros
/* 
plane types
"B_Plane_CAS_01_F"
"I_Plane_Fighter_03_CAS_F"
"O_Plane_CAS_02_F"
*/

private ["_waypoint", "_startPos"];

//arguments
_planeTypeList = _this select 0;
_waypointArray = _this select 1; 
_group = _this select 2;
_selector = _this select 3;

_AltisAirbasePos = getPos planePad1;

//start pos
_startPos = getPos planePad1;

//sets plane 1 at altis, plane 2 at AAC //not used, but works if I want to add a second ambient plane. 
//If (_selector == 1) then 
//{_startPos = _AltisAirbasePos} else
//{_startPos = getPos ((_airportArray select 1) select 0); sleep 300};

_planeMaster = [_startPos, 0, "O_Plane_CAS_02_F", _group] call BIS_fnc_spawnVehicle;
_plane = _planeMaster select 0;
_crew = _planeMaster select 1;

while {(getDammage _plane) < 1} do
{
	_group move _AltisAirbasePos;
	waitUntil {unitReady _Plane};
	_plane landAt 0;	//landat code for altis airbase
	_waypoint = getPos (_waypointArray call BIS_fnc_selectRandom);
	_group move _waypoint;
	waitUntil {unitReady _Plane};
	_Plane setfuel 1;
};

//hint "ambient plane respawning";
deleteVehicle _plane;
{deleteVehicle _x} forEach units _group;
if (true) exitWith {ambientPlaneLoop1 = [planeTypeList, deepwaterArray, ambientPlaneGroup1, 1]execVM "scripts\ambient\ambientPlane.sqf"};

//switch (_group) do
//{
//	case ambientplaneGroup1: {ambientPlaneLoop1 = [planeTypeList, deepwaterArray, ambientPlaneGroup1, 1]execVM "scripts\ambient\ambientPlane.sqf";};
//	case ambientplaneGroup2: {ambientPlaneLoop2 = [planeTypeList, deepwaterArray, ambientPlaneGroup2, 2]execVM "scripts\ambient\ambientPlane.sqf";};
//};

ambient helicopters:

 

in init:

-ambientPad1 through 6 are invisible helipads at altis airbase corresponding to spawn sites.

-MasterArray is a master list that includes all map waypoints, as described above. 

civHQ = createCenter CIVILIAN;
CIVILIAN setfriend [EAST, 1]; //keeps ambient air from shooting at opfor

//ambient helicopter init
heliTypeList = ["B_Heli_Transport_01_F", "B_Heli_Light_01_F", "I_Heli_light_03_F", "B_Heli_Transport_03_F", "O_Heli_Transport_04_F", "I_Heli_Transport_02_F", "B_Heli_Attack_01_F", "O_Heli_Attack_02_F", "O_Heli_Light_02_F"];
ambientHeliGroup1 = createGroup CIVILIAN;
ambientHeliGroup2 = createGroup CIVILIAN;
ambientHeliGroup3 = createGroup CIVILIAN;
ambientHeliGroup4 = createGroup CIVILIAN;
ambientHeliGroup5 = createGroup CIVILIAN;
ambientHeliGroup6 = createGroup CIVILIAN;
ambientHeliLoop1 = [helitypeList, ambientPad1, ambientHeliGroup1, masterArray, 0]execVM "scripts\ambient\ambientheli.sqf";
ambientHeliLoop2 = [helitypeList, ambientPad2, ambientHeliGroup2, masterArray, 60]execVM "scripts\ambient\ambientheli.sqf";
ambientHeliLoop3 = [helitypeList, ambientPad3, ambientHeliGroup3, masterArray, 120]execVM "scripts\ambient\ambientheli.sqf";
ambientHeliLoop4 = [helitypeList, ambientPad4, ambientHeliGroup4, masterArray, 180]execVM "scripts\ambient\ambientheli.sqf";
ambientHeliLoop5 = [helitypeList, ambientPad5, ambientHeliGroup5, masterArray, 240]execVM "scripts\ambient\ambientheli.sqf";
ambientHeliLoop6 = [helitypeList, ambientPad6, ambientHeliGroup6, masterArray, 300]execVM "scripts\ambient\ambientheli.sqf";

script: "scripts\ambient\ambientheli.sqf"

-ambient helicopters spawn at ambientPads at Altis airbase. Each has a delay before it initially takes off. It is then assigned a random waypoint (which can include the players current waypoint), lands there for 60 seconds, flies to a second random waypoint, lands for 60 seconds, then retuns to it's altis airbase pad where it lands and sits anywhere from 1-5 minutes. It refuels and is repaired if damaged. Then the loop repeats. If one gets destroyed, it is deleted and a new one spawns.

//"scripts\ambient\ambientheli.sqf"
//2016 by Nephros

private ["_waypoint1", "_waypoint2"];

//arguments
_heliTypeList = _this select 0;
_helipad = _this select 1;
_group = _this select 2;
_masterArray = _this select 3;
_delay = _this select 4;

//notes - in my init masterArray, some waypoint types have names, others do not, so I have to modify the code as below depending on waypoint type. Most of this code can probably be simplified for use in other scenarios.
//format [location, name]
_baseArray = _masterArray select 0;
_hospitalArray = _masterArray select 3;
_fobArray = _masterArray select 5;

// format [location]
_mountainArray = _masterArray select 2;
_aoArray = _masterArray select 6;
_slingloadArray = _masterArray select 7;
_leftoverArray = [taruSite, huronSite, repairPad, rearmPad, refuelPad];

//helipads
_locationList1 = [_baseArray, _fobArray, (_hospitalArray - (_hospitalArray select 0))];
_locationList2 = [_mountainArray, _aoArray, _slingloadArray, _leftoverArray];

_heliMaster = [getPos _helipad, 0, (_heliTypeList call BIS_fnc_selectRandom), _group] call BIS_fnc_spawnVehicle;
_heli = _heliMaster select 0;
_crew = _heliMaster select 1;

_heli setPosATL [getPos _helipad select 0, getPos _helipad select 1, 0];
_heli setFuel 0;
_heli land "LAND";
sleep 1;
_heli setFuel 1;
//_heli allowdamage false;

sleep _delay;  //delay before helicopter takes off

while {(getDammage _heli) < 1} do
{
	//waypoint 1
	_randomizer = [1,2] call BIS_fnc_SelectRandom;
	If (_randomizer == 1) then 
	{_waypoint1 = ((_locationList1 call BIS_fnc_SelectRandom) call BIS_fnc_selectRandom) select 0} else
	{_waypoint1 = (_locationList2 call BIS_fnc_selectRandom) call BIS_fnc_SelectRandom};
	_group move getpos _waypoint1;
	waitUntil {unitReady _heli};
	_heli land "LAND";	
	sleep 60;

	//waypoint 2
	_randomizer = [1,2] call BIS_fnc_SelectRandom;
	If (_randomizer == 1) then 
	{_waypoint2 = ((_locationList1 call BIS_fnc_SelectRandom) call BIS_fnc_selectRandom) select 0} else
	{_waypoint2 = (_locationList2 call BIS_fnc_selectRandom) call BIS_fnc_SelectRandom};
	_group move getpos _waypoint2;
	waitUntil {unitReady _heli};
	_heli land "LAND";	
	sleep 60;

	//return to base
	_group move getPos _helipad;
	waitUntil {unitReady _heli};
	_heli land "LAND";
	sleep ((random 240) + 60);
	_heli setFuel 1;
	_heli setDamage 0;
};

deleteVehicle _heli;
{deleteVehicle _x} forEach units _group;
//hint "ambient heli respawning";

switch (_group) do
{
	case ambientHeliGroup1: {ambientHeliLoop1 = [helitypeList, ambientPad1, ambientHeliGroup1, masterArray, 60]execVM "scripts\ambient\ambientheli.sqf"};
	case ambientHeliGroup2: {ambientHeliLoop2 = [helitypeList, ambientPad2, ambientHeliGroup2, masterArray, 60]execVM "scripts\ambient\ambientheli.sqf"};
	case ambientHeliGroup3: {ambientHeliLoop3 = [helitypeList, ambientPad3, ambientHeliGroup3, masterArray, 60]execVM "scripts\ambient\ambientheli.sqf"};
	case ambientHeliGroup4: {ambientHeliLoop4 = [helitypeList, ambientPad4, ambientHeliGroup4, masterArray, 60]execVM "scripts\ambient\ambientheli.sqf"};
	case ambientHeliGroup5: {ambientHeliLoop5 = [helitypeList, ambientPad5, ambientHeliGroup5, masterArray, 60]execVM "scripts\ambient\ambientheli.sqf"};
	case ambientHeliGroup6: {ambientHeliLoop6 = [helitypeList, ambientPad6, ambientHeliGroup6, masterArray, 60]execVM "scripts\ambient\ambientheli.sqf"};
};

Share this post


Link to post
Share on other sites

This is great. I am a scripting noob. I like flying around the default maps, CUPs maps, and custom maps. Having some ambience would really add to the realism. I was wanting ambient fixed-wing and rotoring-wing to fly around any map, landing and taking off at any available airport, airstrip, and helipad; waiting for a set time then taking off and repeating at another random airport. This is only for ambience, these aircraft do not need to engage or be engaged, but the ability to change that would be nice. Having 5-30 aircraft in the sky would be great with the ability to change the number when needed.

 

This is working great so far. A few questions.

 

Can I include civilian aircraft and other mod aircraft (CUP)?

 

Would increasing the skill of the unit improve the flying ability?

 

How do I get multiple airplanes in the air, say 5-15 at one time?

 

I see the Helo script allows for up to 6, can this be increased?

 

How would I accomplish this with other maps?

 

How do I add these parameters to any aircraft for; collision lights, search light, speed, behavior, and flyinheight?

_vehicle domove getPos _endPad;
_vehicle flyinheight 120;
_vehicle setSpeedMode "Full";
_vehicle disableAi "TARGET";
_vehicle disableAi "AUTOTARGET";
_vehicle enableAttack false;
_vehicle setCombatMode "BLUE";
_vehicle setBehaviour "CARELESS";
_vehicle spawn { while {alive _this} do { player action ["lightOn",_this]; sleep 0.001};};
_vehicle setCollisionLight true;

Thank you very much for taking the time so far to educate myself. This is wonderful and really adds some depth to flying around the map.

 

Sincerely,

Jason

Share this post


Link to post
Share on other sites

This is great. I am a scripting noob. I like flying around the default maps, CUPs maps, and custom maps. Having some ambience would really add to the realism. I was wanting ambient fixed-wing and rotoring-wing to fly around any map, landing and taking off at any available airport, airstrip, and helipad; waiting for a set time then taking off and repeating at another random airport. This is only for ambience, these aircraft do not need to engage or be engaged, but the ability to change that would be nice. Having 5-30 aircraft in the sky would be great with the ability to change the number when needed.

 

This is working great so far. A few questions.

 

Can I include civilian aircraft and other mod aircraft (CUP)?

 

Yes, just add them into heliTypeList and planeTypeList arrays. Regardless of the plane type, it will be created as a civilian group so should ignore and be ignored by both sides.

 

Would increasing the skill of the unit improve the flying ability?

 

I don't know, but I don't think so.

 

How do I get multiple airplanes in the air, say 5-15 at one time?

 

I'll try to modify the ambient airplane script so you can customize it to as many as you want and add it later.

 

I see the Helo script allows for up to 6, can this be increased?

 

Yes. Just add ambientHeliGroup7, ambientHeliLoop7, ambientpad7 etc. into init and on map.

 

How would I accomplish this with other maps?

 

With helicopters you just need to create the waypoints on your map and it should transfer easily. For planes, you land them at airports using 'landAt', which requires you to know the landAt code for each airport, which will be map specific. You should be able to find those by googling. I only know the Altis ones off the top of my head. They are in the first script in my post above.

 

How do I add these parameters to any aircraft for; collision lights, search light, speed, behavior, and flyinheight?

_vehicle domove getPos _endPad;
_vehicle flyinheight 120;
_vehicle setSpeedMode "Full";
_vehicle disableAi "TARGET";
_vehicle disableAi "AUTOTARGET";
_vehicle enableAttack false;
_vehicle setCombatMode "BLUE";
_vehicle setBehaviour "CARELESS";
_vehicle spawn { while {alive _this} do { player action ["lightOn",_this]; sleep 0.001};};
_vehicle setCollisionLight true;

The planes/ helis are created as an array including the [vehicle, crew] when spawned with BIS_fnc_spawnVehicle

If you look in the ambientPlane script above, each plane is assigned the variable _planeMaster when it is created.

_plane = _planeMaster select 0;  identifies the vehicle.

In the script, you can substitute "_plane"  for "_vehicle" and I think it should work.

 

Thank you very much for taking the time so far to educate myself. This is wonderful and really adds some depth to flying around the map.

 

Sincerely,

Jason

 

I'll see if I can give you generic scripts that will work on any map. For the planes, read about 'landAt'.  I haven't played around with it all that much yet.

Share this post


Link to post
Share on other sites

Getting these errors. I didn't copy all of the .rpt, but there are several hundred of the same error with line 34 in sqf.

15:40:39 Error in expression <LIAN;
ambientHeliLoop1 = [helitypeList, ambientPad1, ambientHeliGroup1, masterAr>
15:40:39   Error position: <ambientPad1, ambientHeliGroup1, masterAr>
15:40:39   Error Undefined variable in expression: ambientpad1
15:40:39 File C:\Users\Jason Reed\Documents\Arma 3\missions\helo2.Altis\init.sqf, line 39
15:40:39 Error in expression <rrtd";
case "helicopterx": {

if (count _pos == 2) then {_pos set [2,0];};
_pos >
15:40:39   Error position: <_pos == 2) then {_pos set [2,0];};
_pos >
15:40:39   Error Undefined variable in expression: _pos
15:40:39 File A3\functions_f\spawning\fn_spawnVehicle.sqf, line 64
15:40:39 Error in expression <f (_precisePosition) then
{
_veh setPos _pos;
};


if (_sim == "airplanex") then>
15:40:39   Error position: <_pos;
};


if (_sim == "airplanex") then>
15:40:39   Error Undefined variable in expression: _pos
15:40:39 File A3\functions_f\spawning\fn_spawnVehicle.sqf, line 80
15:40:39 Error in expression <rp;
_newGrp = false;
};


if ((typeName _pos) != (typeName [])) exitWith {debugL>
15:40:39   Error position: <_pos) != (typeName [])) exitWith {debugL>
15:40:39   Error Undefined variable in expression: _pos
15:40:39 File A3\functions_f\spawning\fn_spawnVehicle.sqf, line 48
15:40:39 Error in expression <masterArray select 7;
_leftoverArray = [taruSite, huronSite, repairPad, rearmPad>
15:40:39   Error position: <taruSite, huronSite, repairPad, rearmPad>
15:40:39   Error Undefined variable in expression: tarusite
15:40:39 File C:\Users\Jason Reed\Documents\Arma 3\missions\helo2.Altis\scripts\ambient\ambientheli.sqf, line 23
15:40:39 Error in expression <
If (_selector == 1) then 
{_startPos = _AltisAirbasePos} else
{_startPos = getP>
15:40:39   Error position: <_AltisAirbasePos} else
{_startPos = getP>
15:40:39   Error Undefined variable in expression: _altisairbasepos
15:40:39 File C:\Users\Jason Reed\Documents\Arma 3\missions\helo2.Altis\scripts\ambient\ambientPlane.sqf, line 25
15:40:39 Error in expression <rrtd";
case "helicopterx": {

if (count _pos == 2) then {_pos set [2,0];};
_pos >
15:40:39   Error position: <_pos == 2) then {_pos set [2,0];};
_pos >
15:40:39   Error Undefined variable in expression: _pos
15:40:39 File A3\functions_f\spawning\fn_spawnVehicle.sqf, line 64
15:40:39 Error in expression <f (_precisePosition) then
{
_veh setPos _pos;
};


if (_sim == "airplanex") then>
15:40:39   Error position: <_pos;
};


if (_sim == "airplanex") then>
15:40:39   Error Undefined variable in expression: _pos
15:40:39 File A3\functions_f\spawning\fn_spawnVehicle.sqf, line 80
15:40:39 Error in expression <rp;
_newGrp = false;
};


if ((typeName _pos) != (typeName [])) exitWith {debugL>
15:40:39   Error position: <_pos) != (typeName [])) exitWith {debugL>
15:40:39   Error Undefined variable in expression: _pos
15:40:39 File A3\functions_f\spawning\fn_spawnVehicle.sqf, line 48
15:40:39 Error in expression <etDammage _plane) < 1} do
{
_group move _AltisAirbasePos;
waitUntil {unitReady _>
15:40:39   Error position: <_AltisAirbasePos;
waitUntil {unitReady _>
15:40:39   Error Undefined variable in expression: _altisairbasepos
15:40:39 File C:\Users\Jason Reed\Documents\Arma 3\missions\helo2.Altis\scripts\ambient\ambientPlane.sqf, line 34
15:40:39 Error in expression <etDammage _plane) < 1} do
_group move _AltisAirbasePos;
waitUntil {unitReady _>
15:46:11   Error position: <_AltisAirbasePos;
waitUntil {unitReady _>
15:46:11   Error Undefined variable in expression: _altisairbasepos
15:46:11 File C:\Users\Jason Reed\Documents\Arma 3\missions\helo2.Altis\scripts\ambient\ambientPlane.sqf, line 34
15:46:13 Attempt to override final function - bis_functions_list
15:46:13 Attempt to override final function - bis_functions_listpreinit
15:46:13 Attempt to override final function - bis_functions_listpostinit
15:46:13 Attempt to override final function - bis_functions_listrecompile
15:46:13 Attempt to override final function - bis_fnc_missiontaskslocal
15:46:13 Attempt to override final function - bis_fnc_missionconversationslocal
15:46:13 Attempt to override final function - bis_fnc_missionflow

Share this post


Link to post
Share on other sites

I don't know if you are still maintaining this mission, but I wanted to say that I am enjoying it very much and thanks for making it. I do have one bug to report. When I get a mission that requires me to dump fuel from a Taru, I really just have to restart the mission. I am unable to dump fuel from that specific helo. The option doesn't appear in the scroll. This occurs with or without mods installed. Even if this is never fixed, I will still be enjoying this mission for a long time. Thanks again!

Share this post


Link to post
Share on other sites

Khugan, thanks, I'll get that fixed.

 

Jnr487 - sorry, I haven't had time to look at that yet, bear with me.

Share this post


Link to post
Share on other sites

Cool mission!

I have a question.  I was flying Taru, had the bench pod from the previous mission, got a new mission to transport some guys from an outpost.  Was I supposed to know there would be 10 guys waiting for pickup?  I didn't see anything in the task brief, and I wasn't directed to the Taru pod zone to get the enclosed transport...  Eight of the guys loaded up on the bench, and then I felt really stuck.  There was no way to get the other two on board, and I couldn't take two trips because the dropoff zone wouldn't activate.
 

Share this post


Link to post
Share on other sites

Just tired this out, only played for a while but it's awesome so far, good job!

Share this post


Link to post
Share on other sites

Could we get this ported to Tanoa by any chance ... would be brilliant there !

  • Like 1

Share this post


Link to post
Share on other sites

Could we get this ported to Tanoa by any chance ... would be brilliant there !

^This, please!

  • Like 1

Share this post


Link to post
Share on other sites

Could we get this ported to Tanoa by any chance ... would be brilliant there !

Yes please!

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

×