Home   Help Search Login Register  

Author Topic: Mando Heliroute for ArmA2 (ACCEPTED)  (Read 7757 times)

0 Members and 1 Guest are viewing this topic.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Mando Heliroute for ArmA2 (ACCEPTED)
« on: 22 Aug 2009, 17:52:39 »
In case you need long range chopper trips and accurate landings anywhere whitout using any invisible or visible helipads  ;)

Mando Heliroute v1.3 for ArmA2

What probles does solve this script?
- If you give a destination really far away, ArmA engine stalls trying to solve the path and the chooper will refuse to move.
- If you order a chopper to land at destination, it will land anywhere except where you want it to land, much less on building roofs, between streets or at ship's decks.

Offline JamesF1

  • Editors Depot Staff
  • *****
    • JamesBurgess.co.uk
Re: Mando Heliroute for ArmA2 (ACCEPTED)
« Reply #1 on: 22 Aug 2009, 21:50:13 »
Ahh, the script I've been waiting for since release.  :good:  Can now use AI-based helo insertions/extractions in my missions again!

Thanks for all your hard work :)

Offline Sakura_Chan

  • Members
  • *
Re: Mando Heliroute for ArmA2 (ACCEPTED)
« Reply #2 on: 23 Aug 2009, 02:46:03 »
Here is the mission I was using, simply jump in the chopper before it can take off.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Mando Heliroute for ArmA2 (ACCEPTED)
« Reply #3 on: 23 Aug 2009, 03:21:51 »
Sakura Chan, you are passing wrong parameters:
Code: [Select]
scr = [this, getpos landing, 100, true] execvm "mando_heliroute_arma.sqf"
--> The second parameter is an array of one or more positions for the route, not just a position

Code: [Select]
scr = [this, [getpos landing], 100, true] execvm "mando_heliroute_arma.sqf"
Aside of that, you are using v1.2, not v1.3

Offline Sakura_Chan

  • Members
  • *
Re: Mando Heliroute for ArmA2 (ACCEPTED)
« Reply #4 on: 23 Aug 2009, 03:29:31 »
yes the init was off a bit, I didn't save it after I had corrected that problem.

Offline cleggy

  • OFPEC Patron
  • ****
Re: Mando Heliroute for ArmA2 (ACCEPTED)
« Reply #5 on: 30 Aug 2009, 20:18:09 »
Hi forumites

I'm getting a corrupted archive on download. Dont think its me - other stuff is OK.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Mando Heliroute for ArmA2 (ACCEPTED)
« Reply #6 on: 30 Aug 2009, 22:09:30 »
Link fixed, try again  ;)

Offline alimag

  • Contributing Member
  • **
  • I'm a llama!
Re: Mando Heliroute for ArmA2 (ACCEPTED)
« Reply #7 on: 31 Aug 2009, 18:23:33 »
Hi,

Wonderful script. The landing precision is simply amazing.

2 remarks if you dont mind:

1 - It would be nice if the engine could stay on for a fast pickup/dropout

2 - Talking about fast pickup/dropout it would also be nice to have the option to land a bit faster even if it looses some precision in the process. Usefull for hot LZs.

Hope you'll consider those additions. Your script would be perfect for any situation with them.

Fantastic work

Cheers

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Mando Heliroute for ArmA2 (ACCEPTED)
« Reply #8 on: 31 Aug 2009, 20:17:38 »
This is already considered, set to false the "land" parameter, the chopper will go to the indicated position and will keep there loitering, then you can trigger any rope script you want to use there.

Offline cleggy

  • OFPEC Patron
  • ****
Re: Mando Heliroute for ArmA2 (ACCEPTED)
« Reply #9 on: 31 Aug 2009, 21:34:04 »
Greetings

Thx for fixing the download Mandoble.
I'm using your script with a spawned helo. A couple of times its overshot the LZ and has had to come around for a second go at landing. Is there a minimum distance I should have between spawn point and LZ?

Also does the orientation of the destination logic have a bearing on the attitude of the helo when landing?

Finally, an observation: The helo stops a few feet (metres) off the ground and shuts down the engine. It then drops gracefully to the ground, just looks a bit odd.

Sorry if I seem picky, this script is, after all, a work of genius!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Mando Heliroute for ArmA2 (ACCEPTED)
« Reply #10 on: 31 Aug 2009, 21:56:19 »
Hi Cleggy,
about the chopper overshoting destination and then turning around to reach exact position, well, it is how ArmA2 pilots drive now, they are quite quite unnaccurate when you tell them to go to any place, they may overshot 50% of the times. This is something I cannot fix (BIS should do something about that). Once the chopper gets quite slow my "guiding" script triggers and moves the chopper to final destination, but not before (the effect would be too brutal and unreallistic).

And about the stopping engine when still on air, the problem is that if I leave the chopper go engine on till ground, then Arma2 makes the chopper to "JUMP" hight and keep there. So the trick consist into drive the chopper controlling its velocity vector till quite close to the ground, stop the engine there in a tight loop, because AI tries to switch it on all the time, and wait till the chopper is grounded end engine off. Just at this time the AI stops any interference, they dont try to switch on the engine and keep flying again by their own until commanded.

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Mando Heliroute for ArmA2 (ACCEPTED)
« Reply #11 on: 08 Sep 2009, 07:59:53 »
Hey Mandoble!

So I'm the guy who PM to you, but maybe this topic is already public.
Well - to the public - the problem is: the heli turn off the engine when land, but in a realistic insertation, the chopper doesn't turn off the engine.

I rewrite this area of youre code:
Code: [Select]
if (_landing) then
{
   _engineoff = false;
   while {(!_engineoff) && (alive _pilot) && (damage _heli < 0.5)} do
   {
      if ((getPos _heli select 2) > ((_endpos select 2) + 1)) then
      {
         _heli setDir _dir;
         if ((getPos _heli select 2) > ((_endpos select 2) + 5)) then
         {
            _heli setVelocity [0,0,-7];
         }
         else
         {
            _heli setVelocity [0,0,7*((getPos _heli select 2)-(_endpos select 2))/-5 min -1];
         };
      }
      else
      {
         _engineoff = true;
         _heli setVelocity [0,0,-0.5];
      };
      Sleep 0.01;
   };

   /*
   for [{_i = 0},{_i < 100},{_i = _i + 1}] do
   {
      _heli setVelocity [0,0,-0.2];
      Sleep 0.05;
   };
   */

   {unassignVehicle _x;} forEach units group player;

   while {!({_x in _heli} count units group player == 0)} do
   {
      _heli setVelocity [0,0,-0.5];
      Sleep 0.05;
   };

   if (!(alive _pilot) || (damage _heli >= 0.5)) exitWith {};

   _heli setVariable ["mando_heliroute", "waiting"];

}
else
{
   _heli setVariable ["mando_heliroute", "waiting"];
};

I replace the action ["ENGINEOFF"] to a local variable:  _engineoff.

And you mentioned that if you don't turn the engine off, the chopper - while wait - start to slowly rise. That's true. In my solution was a loop, what _heli setVelocity [0,0,-0.5]; while my men jump out from the heli.
Of course it's not a general solution, but enough for me.

I saw a tip in the "Tip of the month" topic to count the non-crew passenger in a vehicle. Maybe it could be general to check it in that loop. But I don1t know, because what if the designer want a team to get IN to the chopper.
Fix bayonet!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Mando Heliroute for ArmA2 (ACCEPTED)
« Reply #12 on: 08 Sep 2009, 08:57:29 »
The problem there is that it applies only to a very particular case  :scratch:

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Mando Heliroute for ArmA2 (ACCEPTED)
« Reply #13 on: 08 Sep 2009, 09:27:33 »
OK. I understand, but what is your opinion about an other global variable mando_heliroute_someting and if it's false, the script push the chopper down while this variable is true. And the mission designer can use this variable for anything what (s)he want.  :whistle:
Fix bayonet!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Mando Heliroute for ArmA2 (ACCEPTED)
« Reply #14 on: 09 Sep 2009, 11:14:45 »
The  new version, not public yet, has a parameter to determine who the "landing" will be and so far it admits two modes:
- As current one, chopper will land and will stop the engine just before touching down.
- Chopper will descend and will keep loitering 1m above ground.

The second way works fine for players, but not for AI. AI will refuse to board that chopper even being loitering still quite close to the ground. I may add a third option with your proposed landing procedure there too.

Offline bardosy

  • Honoured Contributor
  • ***
  • campaign designer
    • CartooDiv
Re: Mando Heliroute for ArmA2 (ACCEPTED)
« Reply #15 on: 09 Sep 2009, 11:20:50 »
Mando, it's maybe offtopic, but do you know why - in my version of your script above - player's group member don't get out from the heli by {unassignVehicle _x;} forEach units group player; Itás do nothing right now.
Not a big problem, because player can order his men to get out and it's work, but could be better an automatic get out.
Fix bayonet!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Mando Heliroute for ArmA2 (ACCEPTED)
« Reply #16 on: 09 Sep 2009, 11:54:01 »
In the mission example there is an automatic getout. When route is signaled as finished, the init.sqf GETS OUT all the group members. This is something that needs to be done by other scripts, not by the heliroute one. Heliroute has no idea about what do you want to do when the route is finished. You might have running in parallel a script that checks if player group leader is inside the chopper and add an action that, if activated, forces the getout of its entire group with action "getout".

Offline zonker3210

  • Members
  • *
Re: Mando Heliroute for ArmA2 (ACCEPTED)
« Reply #17 on: 17 Sep 2009, 03:53:13 »
Thanks, Mando, for another really great script. I could use a bit of help, though, as I'm a little stumped when it comes to having a chopper fly to a point and hover for a bit. For example, I placed a Game Logic marker on the map and can have the helo fly to it and land. No problems there. The problem comes when I try to get the chopper to hover 15 meters off the ground. If "pt1" is the game logic marker and "helo_insertion1" is the chopper, my first attempt didn't work at all...

Code: [Select]
_dropoff1 = [helo_insertion1,[(getPos pt1 select 0), (getPos pt1 select 1), 15],75, false]execVM"mando_heliroute_arma.sqf";
However, once I added brackets around each item in the "pt1" array, I was able to get the chopper to move to the appropriate point...

Code: [Select]
_csar1 = [helo_insertion1,[([getPos pt1] select 0), ([getPos pt1] select 1),15],75, false]execVM"mando_heliroute_arma.sqf";
(I'm posting the above code snippets in case anyone else runs into the same issue. I spent far too much time on something so simple! ;) )

Unfortunately, once the chopper arrives at the destination point, the status *never* seems to change to "not busy". For example, the code after this line...

Code: [Select]
waitUntil {helo_insertion1 getVariable "mando_heliroute" != "busy"};
...is never executed.

I'm sure that there's something which I am overlooking but I've reviewed everything I can think of and nothing seems amiss. Any and all constructive suggestions as to how I might resolve these issues are greatly appreciated.

Thank you!
 - z

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Mando Heliroute for ArmA2 (ACCEPTED)
« Reply #18 on: 17 Sep 2009, 11:59:49 »
Hi Zonker, the route parameter is an array of positions (one or more positions):
[pos1, pos2, pos3, ..., posn]
and each position is an array [x,y,z]

In your code you are not using arrays of positions, but single positions alone:
[(getPos pt1 select 0), (getPos pt1 select 1), 15]
->>>
[ [getPos pt1 select 0, getPos pt1 select 1, 15] ] <- Now this is an array with a single position inside.

In this other case:
[([getPos pt1] select 0), ([getPos pt1] select 1),15]
well, this is simply all wrong and will never work.

Check the script header for more info and examples.

Offline Nephris

  • Members
  • *
Re: Mando Heliroute for ArmA2 (ACCEPTED)
« Reply #19 on: 19 Oct 2009, 18:04:03 »
Hi friends,
sry for reactivating that thread here, but i have a question concerning this script.
I would like to create an AI-Helo-Taxing throughout a MP Misison with landings at Insertion Point and landings on Respawn point.
This taxiing shall circle, like waiting 2mins @respawn point - flying to insertion point,unloading for 20 sec and returning to respawn point and circle on.

But to be honest i ve no cluwe if this is possible by using Mandobles script or how to change the code to get it working that way.

Could you give me hint?
Greetz & cheerz