SteelSampson 1 Posted June 20, 2013 I am making a training mission and I'd like to simulate loss of mobility on a vehicle and loss of one crewman, like the driver and/or gunner without having everyone in the vehicle go down. Sidenote: they players in the vehicle and the vehicle itself could be different each time the mission is played. Thanks Share this post Link to post Share on other sites
samatra 85 Posted June 20, 2013 Do you want like kill one AI unit in the vehicle? _unit = objNull; { if(!isPlayer(_x)) exitWith { _unit = _x; }; } forEach (crew _vehicle); if(!isNull(_unit)) then { _unit setDamage 1; }; For breaking certain vehicle part look at http://community.bistudio.com/wiki/setHitPointDamage Share this post Link to post Share on other sites
SteelSampson 1 Posted June 21, 2013 Sorry, should have clarified this... ai will be disabled. Thanks for the link! Share this post Link to post Share on other sites
samatra 85 Posted June 21, 2013 Select random crew member in vehicle _randomCrewMember = (crew _vehicle) select floor(random(count(crew _vehicle))); //Do whatever you want with _randomCrewMember Share this post Link to post Share on other sites
SteelSampson 1 Posted June 21, 2013 Select random crew member in vehicle _randomCrewMember = (crew _vehicle) select floor(random(count(crew _vehicle))); //Do whatever you want with _randomCrewMember Awesome! Thank you! Is there a way to make it also choose a random number of crew members? Share this post Link to post Share on other sites
SteelSampson 1 Posted June 21, 2013 Is it possible to make it so a vehicle can take damage just never blowup? like limiting the damage it can take to 'damage 0.9' or something? Share this post Link to post Share on other sites
samatra 85 Posted June 22, 2013 Awesome! Thank you! Is there a way to make it also choose a random number of crew members? _crew = crew _vehicle; _players = []; for "_i" from 0 to 2 do { if(count(_crew) > 0) then { _random = _crew select floor(random(count _crew)); _players = _players + [_random]; _crew = _crew - [_random]; }; }; This will select 3 (0 to 2) random units from vehicle crew and put into _players array Is it possible to make it so a vehicle can take damage just never blowup? like limiting the damage it can take to 'damage 0.9' or something? This is a bit complicated, you will need HandleDamage event handler: http://community.bistudio.com/wiki/ArmA_2:_Event_Handlers#HandleDamage you will need to add it for all clients that are in the game and will join the game (init line of vehicle for example or use BIS_fnc_MP for newly spawned vehicles). Example for init line: this addEventHandler ["HandleDamage", {if((_this select 2) < 0.8) then {_this select 2} else {0.8}} ]; this will prevent any vehicle part (including overall damage) going above 0.8 Share this post Link to post Share on other sites
SteelSampson 1 Posted June 24, 2013 Thank you! Would it be possible to reset the damage to 0 after 60 seconds for any vehicle that: 1. has players in it and 2. has reached the damage limit of 0.8? Share this post Link to post Share on other sites