Jump to content
Sign in to follow this  
Wisp

Issues with unassignVehicle

Recommended Posts

My mission begins with a squad placed inside a truck, using moveInCargo. I later want them to board a helo, so I use leaveVehicle to have them disembark the truck. According to the BIS Wiki, this also unassigns them from the vehicle.

The script I'm using to have them board the helo uses assignAsCargo and orderGetIn to have them board. I know the script works fine because I tested it without the squad previously inside the truck and it works fine. Only when they have been assigned to another vehicle before does it not work. So this means leaveVehicle must not be unassigning them. I did also try the UnassignVehicle command, but it made no difference.

What am I doing wrong here? How do I unassign the group from the vehicle so they can later be assigned to another vehicle?

Share this post


Link to post
Share on other sites

This seems to work for me

{
_x leaveVehicle vehicle _x ;
_x assignAsCargo heli;
} foreach units  red;
[red] orderGetIn true;

red being the group

red=group this 

placed in leaders init

Share this post


Link to post
Share on other sites

Unfortunately, the squad still does not acknowledge the orderGetIn command.

Share this post


Link to post
Share on other sites

You could try doing it with the GET IN, UNLOAD CARGO, LOAD CARGO and GET OUT Waypoints, or just use

{
unassignVehicle _x ;
_x assignAsCargo heli;
[_x] orderGetIn true;
} foreach units  red;

Hope that helps,

Weparo

Share this post


Link to post
Share on other sites

Still no luck. :/

This is very strange.

Share this post


Link to post
Share on other sites

Where are you placing the code and have you made the group as mentioned above.

Both versions work for me.

Share this post


Link to post
Share on other sites

I placed your code (and later Weparo's) in the activation of the transport unload waypoint of the truck.

Then I have a trigger that detects if a smoke grenade is thrown within a 1000m of a marker. This executes a script that creates a helipad at the location of the smoke grenade, tells the helo to move to that position, and then land.

Everything works fine as long as the squad doesn't have moveInCargo truck in their initialization. The helo lands, the squad gets in. But if they were previously in the truck, they never get in the helo.

Here's the script:

_smokeArray = [];
_smokeArray = (position smoke) nearObjects ["SmokeShellGreen",1000
];
_smoke = _smokearray select 0;
_smokePos = position _smoke;

_extractPos = createVehicle ["Land_HelipadEmpty_F", _smokePos, [], 0, "NONE"];

_wp = group_attack7 addWaypoint [position _extractPos, 0];
_wp setWayPointType "MOVE";
helo1 land "GET IN";

[player1,player2,player3,player4,player5] orderGetIn true;

Edited by Wisp

Share this post


Link to post
Share on other sites
I placed your code (and later Weparo's) in the activation of the transport unload waypoint of the truck.

thats your issue - transport unload auto assigns whatever is inside a vehicle's cargo and force them to leave the vehicle, but it doesn't unassign them from the vehicle. Also, having this code in the activation of a transport unload will only complicate matters, because while the waypoint is fiddling around with cargo, so are you. Best to replace the transport unload with a move waypoint and it should work then.

Share this post


Link to post
Share on other sites
thats your issue - transport unload auto assigns whatever is inside a vehicle's cargo and force them to leave the vehicle, but it doesn't unassign them from the vehicle. Also, having this code in the activation of a transport unload will only complicate matters, because while the waypoint is fiddling around with cargo, so are you. Best to replace the transport unload with a move waypoint and it should work then.

agreed. It could also be done with a trigger, but it's nicer to have it done with a waypoint activation.

Share this post


Link to post
Share on other sites

you can still do it with waypoint activation - but use move instead of Transport Unload

Share this post


Link to post
Share on other sites

@OP: Question - Why don't you do it with waypoints only? Load troops in the truck via moveInCargo and use a TRANSPORT UNLOAD waypoint syncronized to a GET OUT waypoint and then a GET IN and LOAD waypoint (also syncronized).

Here, I've made you a pic to clarify

http://imgur.com/KOt4Qg5

KOt4Qg5

Share this post


Link to post
Share on other sites
@OP: Question - Why don't you do it with waypoints only? Load troops in the truck via moveInCargo and use a TRANSPORT UNLOAD waypoint syncronized to a GET OUT waypoint and then a GET IN and LOAD waypoint (also syncronized).

Here, I've made you a pic to clarify

http://imgur.com/KOt4Qg5

http://imgur.com/KOt4Qg5

Because the script I'm using is designed to have the helicopter pick up not at a specific point, but wherever the player throws smoke. The orderGetIn command works best for that, so the units need to be assigned to proper vehicle.

The previous poster's suggestion of using move instead of transport unload worked though.

Share this post


Link to post
Share on other sites
Because the script I'm using is designed to have the helicopter pick up not at a specific point, but wherever the player throws smoke. The orderGetIn command works best for that, so the units need to be assigned to proper vehicle.

The previous poster's suggestion of using move instead of transport unload worked though.

Glad you got it working then! :)

I suppose you could have made my version work with setWaypointPosition too

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  

×