Home   Help Search Login Register  

Author Topic: Does "MoveInCargo" remove a unit from it's group?  (Read 546 times)

0 Members and 1 Guest are viewing this topic.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Does "MoveInCargo" remove a unit from it's group?
« on: 06 Dec 2004, 00:14:48 »
I have a group of four inf. In my init.sqs I "MoveInCargo" each inf to a different MG Jeep.

Code: [Select]
GroupGren = Group Gren1
{_x AddWeapon "NVGoggles"} ForEach Units GroupGren
GroupGren LockWP True
Gren1 MoveInCargo Jeep1
Gren2 MoveInCargo Jeep2
Gren3 MoveInCargo Jeep3
Gren4 MoveInCargo Jeep4

I have a detect trigger that launches the following script:

Code: [Select]
If (Alive Gren1 And Gren1 InVehicle Jeep1) Then {Gren1 LeaveVehicle Jeep1}
If (Alive Gren2 And Gren2 InVehicle Jeep2) Then {Gren2 LeaveVehicle Jeep2}
If (Alive Gren3 And Gren3 InVehicle Jeep3) Then {Gren3 LeaveVehicle Jeep3}
If (Alive Gren4 And Gren4 InVehicle Jeep4) Then {Gren4 LeaveVehicle Jeep4}

[Gren1, Gren2, Gren3, Gren4] Join GroupGren
GroupGren LockWP False
[GroupGren, 1] SetWPPos GetMarkerPos "MarkerCrashSite"
[GroupGren, 2] SetWPPos GetMarkerPos "MarkerCrashSite"

WP 1 is a S&D and WP2 is a cycle.  I want the inf to hop out of the jeeps and rejoin each other and go on an endless S&D.  When I fire on a jeep, presuming that throws my detect trigger, the inf get out of the jeep, run around for a second, and then get back into the jeep.  What the hell am I doing wrong? I have also tried it without the  "[Gren1, Gren2, Gren3, Gren4] Join GroupGren" line to no avail. In the debugger the inf are still listed as their own group.
urp!

StonedSoldier

  • Guest
Re:Does "MoveInCargo" remove a unit from it's group?
« Reply #1 on: 06 Dec 2004, 00:32:46 »
if your wating the inf to jump out when under fire and stay on foot use the unassignvehicle command on each man
« Last Edit: 06 Dec 2004, 00:34:10 by StonedSoldier »

Kammak

  • Guest
Re:Does "MoveInCargo" remove a unit from it's group?
« Reply #2 on: 06 Dec 2004, 00:32:49 »
MoveInCargo does not remove a unit from its group.  It does ADD that unit to the crew array of the vehicle.

LeaveVehicle doesn't work well with units in CARGO, only commander/driver/gunner, in my experience.

Instead of leavevehicle, eject the men ( _x action["EJECT",(vehicle _x)] )and then unassignvehicle for each of them.  You don't need any group functions, they retain their group membership.


Offline MachoMan

  • Honoured
  • Former Staff
  • ****
  • KISS, Keep it Simple Stupid
Re:Does "MoveInCargo" remove a unit from it's group?
« Reply #3 on: 06 Dec 2004, 10:18:04 »
Using eject is not a good sollution either, it can kill the units very easily!
The best way to get a unit to disembark is still the unload waypoint, so if there's any way you can use a waypoint please do.
« Last Edit: 06 Dec 2004, 10:19:07 by MachoMan »
Get those missions out there you morons!

Kammak

  • Guest
Re:Does "MoveInCargo" remove a unit from it's group?
« Reply #4 on: 06 Dec 2004, 15:28:48 »
Using eject is not a good sollution either, it can kill the units very easily!
The best way to get a unit to disembark is still the unload waypoint, so if there's any way you can use a waypoint please do.

???

I use it quite often...no dead guys on my end.

However, if you are really concerned about it, call unassignvehicle first, as that will cause the vehicle to stop.