Home   Help Search Login Register  

Author Topic: Chopper lands, waits for a group to disembark, then flys away  (Read 1137 times)

0 Members and 1 Guest are viewing this topic.

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Hi

Basicly what the thread title says.

At the begining of the mission I have a UH-60MG flown by AI, and I also have a squad with a player as leader, and a mix of ai and players as soldiers inside the group. The whole squad is inside the blackhawk (I used moveincargo commands, but for AI do i need to assign them as cargo units? I can remember seeing this in another thread).

How would I make the blackhawk land at a location, wait for the group to disembark before flying away.

Thanks for your help  :D

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Quote
but for AI do i need to assign them as cargo units
Yes

Well if the whole of the group to get out is ai:
Place an H (Invisible) object where you want the chopper to land.  Give the chooper a Transport Unload waypoint at the same place, then give it a Move waypoint some distance away.  Give the infantry group a Get Out waypoint next the invisible H and synchronise this with the choppers Transoport Unload WL.   The problem with the player being the leader is that you cannot guarantee that the player will go to the Get Out Waypoint, and if he doesn't then the chopper will not take off again.

EDIT:

I have been playing around with this.  Just giving the chopper a Transport Unload WP (followed by a distant Move WP) sometimes works.  I only had a problem once out of several tries.  I suspect that if you place a trigger at the landing point that fires when the player leaves the trigger area and this is synchronised with the choppers WP then you might be getting somewhere.  It needs experimentation.






« Last Edit: 23 Aug 2006, 22:25:44 by THobson »

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Hey

Thanks for your reply.

I tested it by making units get in the chopper with waypoints. The pilot waited for my whole group to be embarked, which I thought was good. He flew over to the 'H' on the ground and landed. I was automaticly kicked out but the rest of my squad I had to manually disembark.

All good so far...

After I did the same thing that my mission does, using script to get players flying. This is where it went wrong.

Code: [Select]
this moveincargo uh60 ; this assignAsCargo uh60
uh60 is the name of my helicopter (yeh, i named it that) and all the pilot flew to the H he hoverd above it, but he wouldnt land. And unless we ejected, he wouldnt move (It was to low for eject).

Would it make a diffrence that the pilot was put into chopper manually aswell?
Code: [Select]
this moveindriver uh60 ; this assignAsdriver uh60
Thanks for your help.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
When I was playing with this yesterday evening I had the following in the init field of the player unit:

{_x moveInCargo ch1} forEach units group this

That is all.  You don't need to assignAsCargo if you are moving them in as cargo.  You only need the assign instruction if they are later instructed to get in and you want to control where they sit.


I called my chopper ch.  I avoid using names like tank, bmp etc that might confuse the OFP engine.

The chopper was set to Flying

And that was it.


Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Yep ive been playing around, and it now works :check:  :good:

Thanks for your help.  :)