Forum Jump :

Author Message


Posts: 5
Rank:


Level: Member

Country: de
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2013-03-19 17:07        
     

Helicopter Extraction Script


Description
This Scripts spawns helicopters to extract units in the given group.

Features
  • Spawns helicopters randomly at given positions
  • Helicopters fly to extraction Zone and wait for all units in the given group
  • Dynamic helicopter count based on the helicopter type and the ammount of units to extract
  • Helicopter(s) will move to the extraction target after units got in
  • Callbacks can get passed to the script. They can get executed after spawning, landing at extraction point and landing at extraction target.

Usage
Put the extraction.sqf in your mission folder.

Script arguments:
[group, heli spawnposition, extraction point, extraction target, heli classname, (Option) Landing Mode ,(Optional) Callbacks] execVM "extraction.sqf";

Example:

[group player, (getMarkerPos "HeliSpawn"), (getMarkerPos "ExtractionPoint"), (getMarkerPos "ExtractionTarget"), "B_MH9_F"] execVM "extraction.sqf";

Example (with landing mode):

[group player, (getMarkerPos "HeliSpawn"), (getMarkerPos "ExtractionPoint"), (getMarkerPos "ExtractionTarget"), "B_MH9_F", "GET IN"] execVM "extraction.sqf";

Example (with landing mode and callbacks):

[group player, (getMarkerPos "HeliSpawn"), (getMarkerPos "ExtractionPoint"), (getMarkerPos "ExtractionTarget"), "B_MH9_F", "GET IN", [{ hintSilent "SPAWNED!"; }, { hintSilent "LANDED AT EXTRACTION POINT!"; }, { hintSilent "LANDED AT EXTRACTION TARGET!"; }]] execVM "extraction.sqf";

More details in the script file.

Update 1.1:

I've added ability to pass callbacks to the script which will get executed after:
-Spawning
-Landed at extraction point
-Landed at extraction target

So, anyone can easily customize this script, ex. for ignoring AI.
It is now also possible to change the landing mode (More details in Script file).

Example mission (script test) included.
Video of this script test mission:
http://www.youtube.com/watch?v=ePLI8fUE8GI


This post was edited by kennux (2013-03-22 17:52, ago)


Author Message


Posts: 20277
Rank:


Level: Super Admin

Country: nl
Location: The Netherlands
Occupation:
Age: 41
In-game name: Foxhound

 
#2 Posted at 2013-03-20 08:41        
     
Thanks for posting the release here :-)
News is on the frontpage and you can find our mirror here:



Visit my family webshop desteigerhoutshop.nl.

Advertisement


Author Message


Posts: 9
Rank:


Level: Member

Country: de
Location:
Occupation:
Age:
In-game name: wolfenswan

 
#3 Posted at 2013-03-20 15:13        
     
How reliable is this with (hostile) AI around in ARMA 3? I

I remember trying something similar in ARMA2. Although it worked fine when testing locally and in a "clean" environment, as soon as bullets where whizzing (they didn't even have to target the heli) the landing would be botched.


Author Message


Posts: 5
Rank:


Level: Member

Country: de
Location:
Occupation:
Age:
In-game name:

 
#4 Posted at 2013-03-20 17:32        
     
I made a short test and placed 3 Opfor Rifleman in the test mission (Made myself also to opfor, to don't get shot).

First time i tested he was going down after shooting started a bit more slowly, then the pilot got hit ^^
The second time i tested it, the helicopter just landed like without AI enemies.

There also should be a way to make the AI ignore enemies with the disableAI command or similar.

Do a test by yourself, if you find any problems post them and i'll have a look into it :-)


Author Message


Posts: 9
Rank:


Level: Member

Country: de
Location:
Occupation:
Age:
In-game name: wolfenswan

 
#5 Posted at 2013-03-20 18:16        
     
Yes iirc I had some success with disableAI "Autotarget"/"Target" or setting the helicopter to is setCaptive true.


Author Message

Tajin  



Posts: 433
Rank:


Level: Member

Country: de
Location: Bavaria
Occupation: Communications Designer
Age: 33
In-game name: Tajin

 
#6 Posted at 2013-03-21 09:42        
     
Pretty nice script.

Haven't tested that yet, but adding the following lines after your "BIS_fnc_spawnVehicle line" should give your pilots a "I don't give a fuck"-attitude.

(driver _helicopter) setSkill ["spotDistance", 0];
(driver _helicopter) setSkill ["spotTime", 1];
(driver _helicopter) setBehaviour "CARELESS";
(driver _helicopter) disableAI "AUTOTARGET";

There are a lot of very capable people on this forum, willing to spend some of their time to help you out. So if you have a problem, it surely isn't too much to ask that you atleast take the time to describe it properly. Thanks.

Author Message


Posts: 5
Rank:


Level: Member

Country: de
Location:
Occupation:
Age:
In-game name:

 
#7 Posted at 2013-03-21 19:32        
     
I did a few other tests today with more enemy units.

The Helicopter just lands and instantly starts again when there is enemy fire, then it hovers just at about 50 meters and does nothing.

I tried your code, Tajin.
It doesn't affect what ai does at all, i also search a bit with google and found similar codes, i tried them but no success.
I also took a look at the bi wiki and searched for the unit control commands.
I've tried some things like disabling the FSM Scripts, disabling Movement after landing, setting combat mode to "blue", etc.
Nothing changed anything.

However, i'll keep searching for an solution and post here if i found one :)


Author Message


Posts: 9
Rank:


Level: Member

Country: de
Location:
Occupation:
Age:
In-game name: wolfenswan

 
#8 Posted at 2013-03-22 11:18        
     
Hey,

I've seen some success with:
while { ( (alive helo ) && !(unitReady helo ) ) } do
{
       sleep 1;
};
hint "LANDING";
if (alive helo ) then
{
       helo land "LAND";
};

waituntil { isTouchingGround  helo};
hint "GOGOGO";
{
doGetOut  _x;
unassignVehicle _x;
} foreach assignedCargo helo;
waituntil { count (assignedCargo helo) == 0 };
helo land "NONE";
helo move (getpos away);

Video

All credits to head.


Author Message


Posts: 5
Rank:


Level: Member

Country: de
Location:
Occupation:
Age:
In-game name:

 
#9 Posted at 2013-03-22 17:48        
     
I've just updated my script, new link in first post.

I've added ability to pass callbacks to the script which will get executed after:
-Spawning
-Landed at extraction point
-Landed at extraction target

So, anyone can easily customize this script, ex. for ignoring AI.

It is now also possible to change the landing mode (More details in Script file).


Author Message


Posts: 1
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#10 Posted at 2013-08-06 05:31        
     
I know I'm going to sound like a noob, but I'm having a little problem. I put the extraction.sqf in my mission folder, when go into editor and load the mission and go into communications it doesn't show. Any help would be appreciated.