Forum Jump :

Author Message


Posts: 86
Rank:


Level: Member

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

 
#1 Posted at 2017-04-28 20:43        
     
How should one make a AI helicopter move accurately to a invisible H position on map so that it will hover above the invisible Helipad or any obj position? i have used "heli domove getpos h1" as well as move waypoints but the helicopter always stops a few meters away from the invisible H.


Author Message


Posts: 1473
Rank:


Level: Member

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

 
#2 Posted at 2017-04-28 22:11        
     
Sorry the method I was going to suggested only works in A3 sorry.


Advertisement


Author Message


Posts: 86
Rank:


Level: Member

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

 
#3 Posted at 2017-04-29 18:23        
     
This is the example script i m using with helicopter (heli) & H (h1) on map.
In waypoint or radio activation-
null = [heli,h1] execVM "moveheli.sqf";

_heli = _this select 0;
_Pos = _this select 1;

_heli setcombatmode "yellow";
_heli setbehaviour "aware";

sleep 1;
_heli domove getpos _pos;

waituntil {unitready _heli};

Can setvelocity be used to move the heli over the visible H after the unitready command so that it will stop and hover over the H.


Author Message


Posts: 1473
Rank:


Level: Member

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

 
#4 Posted at 2017-04-30 01:01        
     
It's a real pain that you can't control a chopper very accurately in this game. It seems that they ignore move/WP commands if the distance is too small around 50 meters give or take.

The same thing happens in A3 however but if you use the Drop Cargo WP they move to the exact location, you don't have that option in A2/OA.

Setvelocity could be made to work but I haven't mastered it yet.
I did get it to fly to an exact location but for some reason it flies backwards, I tried flipping the direction vector but that just gives strange results.

You can try it and see if you can do anything with it.
// place this in the choppers init box 
//nul=[player, this,0.999] execvm "fly.sqf"
target =  _this select 0;
obj    = _this select 1;
timer  = _this select 2;
onEachFrame
{
	obj setVelocityTransformation [
		getPosASL target, getPosASL obj, velocity target, velocity obj, vectorDir target,vectorDir obj, vectorUp target, vectorUp obj,timer];
		};