OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: CptBravo on 01 Feb 2004, 00:04:49

Title: To unload or not to unload is the question :)
Post by: CptBravo on 01 Feb 2004, 00:04:49
I have a simple problem ..

I have a group (M113+6 Infantry soldiers) The M113is the group leader. I want to move the group to some point on map then issue orders to the infantry when near combat zone. Now I am using

"a1 LeaveVehicle WT1; a2 LeaveVehicle WT1; a3 LeaveVehicle WT1; a4 LeaveVehicle WT1"
 where the a is the soldier in the group.
Now they do disembar .. along with the crew!! How do I get to make the crew stay in vehicle and only the infantry disembark?

I used  I used "unit name" assignAsDriver WT1 and
"unit name" assignAsGunner WT1 and still crew keeps disembarking?

Your help is greatly appreciated!!
Title: Re:To unload or not to unload is the question :)
Post by: Planck on 01 Feb 2004, 00:16:00
LeaveVehicle is for use with groups.

At least thzt is what the Comref suggests.

Try using unassignVehicle unit:

"unassignVehicle a1; unassignVehicle a2; unassignVehicle a3; unassignVehicle a4"

Of something similar.


Planck
Title: Re:To unload or not to unload is the question :)
Post by: deaddog on 01 Feb 2004, 00:16:03
Leavevehicle causes everyone to get out, as you found out :)

You can do this:

_u=crew wt1 - [driver wt1,gunner wt1]

{_x action ["eject",vehicle _x];unassignVehicle _x} foreach _u



Title: Re:To unload or not to unload is the question :)
Post by: Chris Death on 01 Feb 2004, 03:44:30
And to clear some things up, about groups and leaders
and his morons;

Long time ago, ppl figured out how to assign a groupname.
Then they wrote tutorials, and others started doing their
missons based upon these tutorials.

They wrote:

put into the leader's init field: groupname = group this

Now others reading that always think - it can only be the
groupleader, where this can be done.

That's not true

You can put it into any groupmember's init field, as group this
always refers to the group of given unit.

Now leaveVehicle works for groups, as already mentioned above correctly.

Now if you say: leader group leavevehicle blabla

the command will be taken for the group of the leader.

guy2ofthegroup leavevehicle blabla

will also be taken for the group of guy2, so it's again the
whole group.

Therefore do what deaddog said and it'll be fine.

hope these sentences did not cause more confusion than
explanation  :)

~S~ CD
Title: Re:To unload or not to unload is the question :)
Post by: CptBravo on 01 Feb 2004, 17:30:23
hey thanks guys very much for the quick response.

I did get it to work  with the unassignVehicle a1 .. so thanks Planck  ;D

deaddog I have one silly question .. where do I do I place

_u=crew wt1 - [driver wt1,gunner wt1]

{_x action ["eject",vehicle _x];unassignVehicle _x} foreach _u
 ?

In activation field in trig it gives me an error msg.

And thanks Chris Death  for clarifying the group leader name puzzle. I guess that explains why the whole group leaves when you order only one unit to leave.

Even when you use the leave vehicle command even the crew who is in different seperate group disembarks as well. I have tried this with an AAV7 where I had 2 groups of 24 soldiers in cargo and crew in a seperate third group, when I orderd leave vehcle for the two groups in cargo even the crew group ended up getting out  ??? so I guess I'll try unassign which should work ..  

But thanks again  ;D

Title: Re:To unload or not to unload is the question :)
Post by: deaddog on 01 Feb 2004, 17:36:12
You can do it in the activation field of a waypoint or trigger.  Change it to this instead:

{_x action ["eject",vehicle _x];unassignVehicle _x} foreach (crew wt1 - [driver wt1,gunner wt1])


The problem is you can't use a local variable (_u) in an activation field unless you do something like this:

call {_u=crew wt1 - [driver wt1,gunner wt1];{_x action ["eject",vehicle _x];unassignVehicle _x} foreach  _u}



Title: Re:To unload or not to unload is the question :)
Post by: CptBravo on 01 Feb 2004, 18:08:55
Thanks for the response! Your work now!!  ;D
Only observation for both the unssign and the eject methods:
Works perfect with . only difference is assign troops get out one by one and eject all at the same time. Both work perect except when vehicle is one unit instead of empty and have crew moveInGunner/Driver. Unassign will not work if it was an empty vehicle  with crew moved in. And with the eject .. tropps will eject but will get right back in  ??? Maybe I should unaassign each one indvidually ???  

But if empty vehicle used then both work perfect!

The odd world of OFP  ;D


 
Title: Re:To unload or not to unload is the question :)
Post by: deaddog on 01 Feb 2004, 21:30:27
You have to use "unassignvehicle" anytime you use the "eject" action, otherwise they try to get back in.

I know that they all get out at once, that's the way I wrote.  This was for demonstration purposes.  If you want them to get out one at a time then you will have to write a script with a time delay in there or go to the editors depot and download one of the group eject scripts.

Title: Re:To unload or not to unload is the question :)
Post by: Tomb on 02 Feb 2004, 00:50:19
I once used a simple repeated radioTrigger with a T/F command:




Morons = units group this

"[_x] orderGetIn False" foreach Morons

or:

"[_x] orderGetIn True" foreach Morons

Then I forced the APC to follow me around, and if I needed it,
I could simply hit the 0-0-1 to unassign the extra group of "guards"  8) ;D