Hey all! Here's the situation. I am spawning a vehicle via VVS with ai as the driver, this way I can gun and drive at the same time. In a dedicated MP server setting. Problem is, if I accidentally flip the vehicle, the ai ejects automatically and I can't get him back in once the vehicle is un-flipped. So far this is what I have:
if (tolower (typeof _vehicle) in
[
"b_mbt_01_cannon_f","b_mbt_01_tusk_f","o_mbt_02_cannon_f","o_mbt_04_cannon_f","o_mbt_04_command_f","i_mbt_03_cannon_f","b_afv_wheeled_01_cannon_f","b_afv_wheeled_01_up_cannon_f","b_apc_tracked_01_aa_f",
"o_apc_tracked_02_aa_f","o_apc_tracked_02_cannon_f","o_apc_wheeled_02_rcws_v2_f","b_afv_wheeled_01_cannon_f","b_afv_wheeled_01_up_cannon_f","i_apc_wheeled_03_cannon_f","b_apc_wheeled_01_cannon_f",
"i_apc_tracked_03_cannon_f","b_afv_wheeled_01_cannon_f","b_afv_wheeled_01_up_cannon_f"]) then {
_group = createGroup [west, true];
_crew = _group createUnit ["B_crew_F", position _vehicle, [], 0, "CAN_COLLIDE"];
_crew moveInDriver _vehicle;
_crew assignAsDriver _vehicle;
_crew allowDamage false;
hideObjectGlobal _crew;
_crew setCaptive true;
_crew disableAI "all";
_vehicle lockDriver true;
_vehicle allowCrewInImmobile true;
_vehicle setUnloadInCombat [false, false];
_crew enableSimulationGlobal false;
};
if (alive _vehicle) then
{
waitUntil { sleep 1; (( vectorUp _vehicle ) isNotEqualTo [0,0,1]) || (alive _vehicle) };
_vehicle lock 0;
_vehicle lockDriver false;
_vehicle setVehicleLock "UNLOCKED";
_crew enableSimulationGlobal true;
_crew enableAI "all";
_crew moveInDriver _vehicle;
_crew assignAsDriver _vehicle;
_crew disableAI "all";
_vehicle lockDriver true;
_crew enableSimulationGlobal false;
};
The waitUntil bit is where it is hanging and I'm unsure how to tell the engine to check if the vehicle is upright again so that the ai will get back in. Any help is much appreciated!