bolbies 13 Posted February 13, 2017 I am trying to implement the modified Bardosy Automedic with ACE script in the Liberation mission. The problem is the way you buy/hire units. You use a menu that detects the type of units available by going through the config files, not just a simple spawning script. Because of this I don't have an init field for spawned units. Is there a way I can get the mission to autodetect if a player has a medic in the squad and then turn on the automedic script? Thanks! Share this post Link to post Share on other sites
gc8 977 Posted February 13, 2017 Hi I don't know what is bardosy Automedic but here's a simple script that detects medics of certain type in player's group: _group = group player; { if((typeof _x) in ["B_medic_F", "B_recon_medic_F"]) exitwith { // _x is medic, rest of code here }; } foreach (units _group); it only works on vanilla medics of west side, edit the medic list for more support. hope that helps Share this post Link to post Share on other sites
gc8 977 Posted February 13, 2017 here's a better way (now without the medic list, checking "attendant" variable instead): _group = group player; { if( getnumber (configfile >> "CfgVehicles" >> (typeof _x) >> "attendant") == 1 ) exitWith { // _x is medic, rest of code here }; } foreach (units _group); I'm little unsure if "attendant" is in fact what determines medic but this code worked for me. Share this post Link to post Share on other sites
mrcurry 505 Posted February 13, 2017 11 minutes ago, gc8 said: Hi I don't know what is bardosy Automedic but here's a simple script that detects medics of certain type in player's group: _group = group player; { if((typeof _x) in ["B_medic_F", "B_recon_medic_F"]) exitwith { // _x is medic, rest of code here }; } foreach (units _group); it only works on vanilla medics of west side, edit the medic list for more support. hope that helps Another way would be to use: _x getUnitTrait "Medic" 1 Share this post Link to post Share on other sites
gc8 977 Posted February 13, 2017 2 minutes ago, mrcurry said: Another way would be to use: _x getUnitTrait "Medic" cool didn't know that. I see its a new command.. Share this post Link to post Share on other sites
bolbies 13 Posted February 14, 2017 Sorry for the late reply but thank you both! I used gc8's first method but with mrcurry's getUnitTrait suggestion. It works great! Share this post Link to post Share on other sites