Jump to content
Sign in to follow this  
kittycat

Helicopter pickup

Recommended Posts

I want a AI blackhawk to land and wait for different squads (all human players) to get in and then fly away

How can I make this?

Share this post


Link to post
Share on other sites

For example with a trigger (Activation: Radio Alpha), so the chopper has to wait until this trigger is activated. So when all players are in, someone radios Alpha, what will activate the next waypoint for the chopper, so up he goes.

You can also automate the whole thing

It is a little bit more work, but nobody would have to send the radio message.

First you have to give a name to the chopper. Write in the name field for example "BH_1"

Then you write in the Init line of each player the following

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this assignAsCargo BH_1;

Place Object called H (Invisible) to the place where you want the chopper to pickup the players.

Give each player a “GetIn†waypoint and one of the Choppers waypoint has to be a of the “Load†type.

Write in the Init field of the Load Waypoint,

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">BH_1 flyInHeight 0;

Now you have to synchronize the GetIn Waypoints with the Load Waypoints, to make sure the chopper is waiting for everybody.

As soon as all players are in, the chopper continuous.

Share this post


Link to post
Share on other sites

If you have group, which you want to move into the chopper, write into the initfield of the group leader

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">"_x assginAsCargo BH_1" foreach units group this;

Share this post


Link to post
Share on other sites

I can not use a a get in waypoint because it will screw some things in the mission like if I get into a car it shows the get in thing even before the player should know about the helicopter.

I want the helicopter to move to waypoint, land and wait until all surviving members of different squads are in.

That radio call would be nice but how can I make sure that the group leader can call it (the 2nd leader too if leader dead)

Share this post


Link to post
Share on other sites

This script requires the following objects in the mission:

Soldiers named f1...f20

Game logics named: Server, raah, home

Chopper named heko (set flying without any waypoints)

Trigger to activate the script

Move Gamelogic raah where you want the chopper to pick up the squad and gamelogic home to where you want them to go.

Quote[/b] ]

? !(local server) : exit

; move chopper to Game Logic "raah"

heko doMove getpos raah

; determine soldiers in group to get in chopper

_group=[f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,f18,f19,f20]

; loop to get position of chopper and order it to land it near gamelogic

#posloop

? heko distance raah < 100 : goto "land"

~1

goto "posloop"

#land

heko land "GET IN"

;check who is alive and set the required amount of passangers to chopper

#getin

~2

_icount = 0

_num=0

"if (alive _x) then {_num = _num + 1}" foreach _group

; check if soldiers are in chopper

"if (vehicle _x == heko) then {_icount = _icount + 1}" foreach _group

? _icount == _num : goto "end"

;if not get back and check again

goto "getin"

#end

~2

hint "All men aboard. Lets get back home!"

; move chopper to gamelogic home

heko domove getpos home

var1=1

publicvariable 'var1'

exit

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
Sign in to follow this  

×