Jump to content
Leopard20

[Solved] Units assigned as Cargo are ordered to disembark by leader

Recommended Posts

Hey everyone.

 

I currently have a big problem with getting my mission to work properly and it's because the cargo units keep disembarking the vehicle. All units and vehicles (empty) are created after mission starts (it's a dynamic mission) and then I use assignAs... + orderGetIn to get the AI to get in vehicles. 

 

The only workaround I've found is to use:

_unit moveInCargo [_veh, _index] ;

[_unit] allowGetIn true;

[_unit] orderGetIn true

 

in an onEachFrame loop to get the unit to stay in. However, it causes the vehicle to stop every meter (excep for helicopters, thanks to allowGetIn which seems to work for helos), because the stupid leader still wants to disembark the units.

 

Does anyone know a fix for this?

Share this post


Link to post
Share on other sites

First of all, there must be enough available seats onboard. Say it's OK.

Then, did you test addVehicle ? Then, nothing more than a simple order/waypoint.

As reminder: Verify also the damage on vehicle (without more code, vanilla engine will disembark units from a disabled vehicle).

 

Share this post


Link to post
Share on other sites
1 hour ago, pierremgi said:

First of all, there must be enough available seats onboard. Say it's OK.

Then, did you test addVehicle ? Then, nothing more than a simple order/waypoint.

As reminder: Verify also the damage on vehicle (without more code, vanilla engine will disembark units from a disabled vehicle).

 

Tested addVehicle as well. No luck.

 

Like I said, the leader DISEMBARKS the units (they remain inside for like a second or two). So obviously they are already INSIDE. So damage and free seat is irrelevant as I've already checked those out.

 

The leader only disembarks the cargo units, not the gunner or commander or driver or even turrets. As if he's trying to tell them to go and fight! That's why it's weird.

Share this post


Link to post
Share on other sites

without context, mods used, vehicle used, units used, waypoints... it's hard to reproduce such things.

Share this post


Link to post
Share on other sites

Ok. Let me try without some mods. See if it helps. I don't use any AI mods though. The only mod that might be responsible is CBA (others are just sound, unit, weapon, etc mods)

 

BTW, all units and vehicles are vanilla. No waypoints, no nothing. It's just some code that orders units to mount a vehicle (either for being transported by another group or permanent use). I will post it when I get a chance.

Share this post


Link to post
Share on other sites

show ur code in a wider context and tell where it is run (client/server/everywhere?).

  • Like 1

Share this post


Link to post
Share on other sites

Nevermind. It was a mistake on my end. I  was mistakenly applying an animation to the unit when he was inside, thus forcing him to disembark.

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

×