Chaos 0 Posted August 6, 2009 I have a problem. I will, that only the troop in cargo of the apc dismounts the vehicle but after i launch my script, all guys in the vehicle dismounts it - inclusive driver, gunner and commander. _veh = vehicle player; _troop1 = crew _veh - [gunner _veh] - [driver _veh] - [commander _veh]; ~random 2 hintc format ["%1",_troop1]; {unassignvehicle _x} forEach _troop1; {_x leavevehicle _veh} forEach _troop1; The hint format will list correctly only the infantry troop members without the apc crew. :confused: Share this post Link to post Share on other sites
Tom_48_97 523 Posted August 6, 2009 I use the follwing statement and it works (I hope) : _u = _this select 0;{ _x action ["eject", vehicle _x]; sleep 0.2; } forEach units group _u; exit; Share this post Link to post Share on other sites
Chaos 0 Posted August 6, 2009 Yes, i think its good idea, but i will know why its not works in my script. Share this post Link to post Share on other sites
Tom_48_97 523 Posted August 6, 2009 (edited) _veh = vehicle player;_troop1 = crew _veh - gunner _veh - driver _veh - commander _veh; ~random 2 hintc format ["%1",_troop1]; {_x leavevehicle _veh} forEach _troop1; exit; Try this, not sure... You don't need to unassign, cause, the command leaveVehicle do it. From another side, leavevehicle seems to work with a group, not with an array. Try to split your group as follow : crew members, cargo members and get a try. Edited August 6, 2009 by tom_48_97 Share this post Link to post Share on other sites
Chaos 0 Posted August 6, 2009 The commands "leavevehicle" without "unassignvehicle", makes no difference. Still will all units in vehicle dismount the apc. All members of infantry troop and all of the crew. _veh = vehicle player; _troop1 = crew _veh - [gunner _veh] - [driver _veh] - [commander _veh]; ~random 2 hintc format ["%1",_troop1]; {_x leavevehicle _veh} forEach _troop1; Share this post Link to post Share on other sites
Big Dawg KS 6 Posted August 6, 2009 {if(assignedVehicleRole _X == "CARGO")then{doGetOut _X}} forEach crew _veh; Oddly, the comref says assignedVehicleRole returns an array (and doesn't mention what it contains), but that can't be right can it? Can someone clarify that for me? Share this post Link to post Share on other sites
Chaos 0 Posted August 6, 2009 (edited) I think, the whole problem, is a new bug since patch 1.03 Edited August 6, 2009 by Chaos Share this post Link to post Share on other sites
Big Dawg KS 6 Posted August 6, 2009 I think, it is a new bug since patch 1.03 Surely this isn't the case. Such a bug would be rather game-breaking... and quickly noticed. Share this post Link to post Share on other sites
Chaos 0 Posted August 6, 2009 I am not sure, but i think, i hadn´t it before with 1.02... ---------- Post added at 07:01 PM ---------- Previous post was at 06:23 PM ---------- I made a small testmission. You can see the problem in editor now: http://netload.in/dateiQf2nXR4zob/UNLOAD_TEST2.utes.rar.htm Share this post Link to post Share on other sites
Chaos 0 Posted August 7, 2009 I can´t still find the bug. Share this post Link to post Share on other sites
Chaos 0 Posted August 8, 2009 Ok, this is definitively an engine bug. Infantry group, which is not in the same group as the apc crew members, dismounting the vehicle following by the vehicle crew. _veh = apc1; _troop1 = infantry1; ~random 2 {_x leavevehicle _veh} forEach units _troop1; Makes no difference. So it must be a bug in 1.03. Share this post Link to post Share on other sites
BlackAlpha 10 Posted August 9, 2009 (edited) Ok, this is definitively an engine bug. Infantry group, which is not in the same group as the apc crew members, dismounting the vehicle following by the vehicle crew. _veh = apc1; _troop1 = infantry1; ~random 2 {_x leavevehicle _veh} forEach units _troop1; Makes no difference. So it must be a bug in 1.03. Same happens to me. But can't you just use unassignvehicle instead of leavevehicle? Seems to me that if you use unassignvehicle, they get out and you won't need any more commands. {if(assignedVehicleRole _X == "CARGO")then{doGetOut _X}} forEach crew _veh; Oddly, the comref says assignedVehicleRole returns an array (and doesn't mention what it contains), but that can't be right can it? Can someone clarify that for me? I've never used the comref, so I don't know about that but on the wiki it says this. Don't forget that it returns an array, so first you got to select the part of the array that you want to compare. I've no idea whether it's somehow possible to compare arrays. This should work. Keep in mind that with the dogetout command they get back into the vehicle after disembarking. {if((assignedVehicleRole _X select 0) == "CARGO")then{doGetOut _X}} forEach crew apc1; You probably might want to add another if in there that checks whether the array actually contains anything before you are trying to select something from it. By the way, thanks for bringing this up. I was looking for such a command but couldn't find it! Edited August 9, 2009 by BlackAlpha Share this post Link to post Share on other sites
wiper 0 Posted August 9, 2009 (edited) No bug. Merely not a too precise comref maybe ? ;) This is how I do it and it still does fine since OF: For dis/embarking I use ArrayOfUnits [b]ordergetin[/b] false; // true; disembarking this way always works great but isnt enough as they instantly GetIn back into their assigned vehicle as soon as a move command follows. Therefore the vehicle must be unassigned, I always do it this way: {[b]unassignvehicle [/b]_x}foreach ArrayOfUnits; Naturally, before getting them back into a vehicle each unit must be reassigned to a specific role, f.e.: (ArrayOfUnits select 0) assignasdriver vehicle1; {_x assignascargo vehicle1}foreach (ArrayOfUnits -[ArrayOfUnits select 0]); So back to the OP, using both commands (ordergetin, unassignvehicle) this way by substracting the driver, commander and gunner from the vehicle crew should indeed ALWAYS do the trick. BUT be prepared for a new challenge in Arma2 though, lol: The BMP3 has two additional gunners but these afaik are not assigned as gunners nor can i find a way to assign them as gunners. Edited August 9, 2009 by Wiper Share this post Link to post Share on other sites
Chaos 0 Posted August 9, 2009 (edited) Yes, it is a bug. I haven´t this problem with the same script with 1.02 version or in ARMA1. Hundret precently an engine bug. Edited August 9, 2009 by Chaos Share this post Link to post Share on other sites
wiper 0 Posted August 9, 2009 (edited) Yes, it is a bug. I haven´t this problem with the same script with 1.02 version or in ARMA1. Hundret precently an engine bug. works flawless, see <link removed> micro test mission, unless you use a BMP3 instead whose additional gunners seem to be undefined (glitch). Edited August 11, 2009 by Wiper Share this post Link to post Share on other sites
.kju 3244 Posted August 9, 2009 http://community.bistudio.com/wiki/leaveVehicle group leaveVehicle vehicle Group != unit. Share this post Link to post Share on other sites
Chaos 0 Posted August 9, 2009 (edited) Syntax: group leaveVehicle vehicle Parameters: group: Object or Group Example 1: soldierOne leaveVehicle jeepOne Example 2: groupOne leaveVehicle jeepOne Working with units AND with groups. I tested older, ARMA1 made, scripts and these are all working correctly. So it must be a bug. Edited August 9, 2009 by Chaos Share this post Link to post Share on other sites
wiper 0 Posted August 9, 2009 correct, works with groups AND units. at least for me AND in Arma2 v1.03 ;) Share this post Link to post Share on other sites