Jump to content
Sign in to follow this  

Recommended Posts

Yesterday I've managed to make this simple script:

_Heli = _This select 0

_group = _This select 1

;ferma l'elicottero

_heli forcespeed 0

@ ( (speed _heli) < 1)

_units = ( units _group )

_i = (count _units) - 1

_Heli Flyinheight 1

@ ((getpos _heli) select 2 ) < 2

#Lp

~.5

If (_i != 0) Then {unassignVehicle (_units select _i); (_units select _i) action ["EJECT",_Heli]; _i = _i - 1; goto "Lp"} else {_heli forcespeed 40; _heli flyinheight 50; _heli domove [((position player) select 0) + 500, ((position player) select 1) + 500]; exit}

exit

This script make disembark a group from a chopper.

It is called by the foollowing sintax:

[Name chopper, group] exec "stopheli.sqs"

name chopper = name of the chopper

Group = group in the chopper

Note. Group is a team group (in the int field of the leader --> A = group this; {_x moveincargo namechopper} foreach units A). It is indipendent from the chopper itself (in other words, they're 2 differents group).

Now, the strange thing huh.gif

After the chopper disembark the team, it flies away

{_heli forcespeed 40; _heli flyinheight 50; _heli domove [((position player) select 0) + 500, ((position player) select 1) + 500]; exit} <-- Last line of the script

Strangely, the group will follow the chopper considering it as it's own leader.

I've tried to put my player inside the group, and the pilot of the chopper is considered as the leader of the team.

Is this an Arma Bug or a Fault in my script?

Share this post


Link to post
Share on other sites

If I'm understandign you correctly,  you may have to unassign the units from the chopper.  They think they are supposed to be following their leader.

Share this post


Link to post
Share on other sites

Yes , once you have them board the helo they join the helo group, therefore you have to unassign them from the group again when they disembark.

This could have been easily fiound when using the search function of the forum and make use of the old Flashpoint mission editing topic.

I´m somewhat confused that more and more people label something easily as a bug when they haven´t looked up the issue first.

Share this post


Link to post
Share on other sites
Yes , once you have them board the helo they join the helo group, therefore you have to unassign them from the group again when they disembark.

This could have been easily fiound when using the search function of the forum and make use of the old Flashpoint mission editing topic.

No. wink_o.gif

It was my fault.

This is where I've mistaken:

Lp

~.5

If (_i != 0) Then {unassignVehicle (_units select _i); (_units select _i) action ["EJECT",_Heli]; _i = _i - 1; goto "Lp"} else {_heli forcespeed 40; _heli flyinheight 50; _heli domove [((position player) select 0) + 500, ((position player) select 1)

+ 500]; exit}

Try to guess...

What happen when _i == 0 ?

The script exit but...

_i = 0 is, in fact, the leader of the team crazy_o.gif

In other words, the leader weren't disembarked. I've just solved yesterday evening.

@ Balschoiw

Quote[/b] ]

I´m somewhat confused that more and more people label something easily as a bug when they haven´t looked up the issue first.

Some time it happens to be mistaken... wink_o.gif

It's happened even to Bis.

smile_o.gif

Share this post


Link to post
Share on other sites

I think this could work:

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

_allunits = crew _Heli;

_cargounits = _allunits - [driver _Heli,gunner _Heli];

{(_x) action["EJECT",_Heli]; unassignvehicle _x} foreach _cargounits;

Not tested though. If foreach doesn't work on multiple commands, use "action" and "unassignvehicle" in 2 foreach lines. smile_o.gif

Share this post


Link to post
Share on other sites
)rStrangelove @ Mar. 07 2007,16:39)]I think this could work:

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

_allunits = crew _Heli;

_cargounits = _allunits - [driver _Heli,gunner _Heli];

{(_x) action["EJECT",_Heli]; unassignvehicle _x} foreach _cargounits;

Not tested though. If foreach doesn't work on multiple commands, use "action" and "unassignvehicle" in 2 foreach lines.  smile_o.gif

Thank you wink_o.gif

I've managed to solve the problem in a different way.

Your suggestion is good but creates a strange effect:

all unit are removed immediatly from the chopper. It is a bit unrealistic, in my opinio.

Thanks however.

smile_o.gif

Share this post


Link to post
Share on other sites

i'm no good at scripting but made a eject.sqs using other peoples work, inc part of your script smile_o.gif, i wanted a script for para drops that would work for any group that executes it instead of 1 seperate script for each named group...

it works though it could maybe be better...

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Heli = _This select 0

_group = _This select 1

_aunits = (units _group)

_heli setspeedmode "limited"

~2

_heli flyinheight 130

~1

@ ((getpos _heli) select 2 ) > 100

_i = 0

_j = count _aunits

#Here

(_aunits select _i) action ["EJECT",_heli]

unassignvehicle (_aunits select _i)

_i=_i+1

~0.5

?_j>_i:goto "Here"

_heli forcespeed 80

~2

_heli setspeedmode "normal"

#exit

exit

again this isn't my work i just took a couple of bits from other people scripts and put it together to suit my mission smile_o.gif

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  

×