Jump to content
target_practice

What defines what 'class' a unit is.

Recommended Posts

By which I mean what determines whether a unit is a medic, engineer, etc.

It doesn't appear to simply be having a certain item in their inventory, as only medics can use medkits, and toolkits are can be used to different extents by different classes.

Share this post


Link to post
Share on other sites

You can check it via script like this

getnumber (configfile >> "CfgVehicles" >> "B_G_medic_F" >> "attendant") 

getnumber(configfile >> "CfgVehicles" >> "B_G_engineer_F" >> "engineer")

the getnumber returns 1 if true and 0 if not

 

Not 100% sure about "attendant" being medic but it seems so

  • Like 1

Share this post


Link to post
Share on other sites

I believe the only definition of this is happening in those two config entries, use that code snippet in an units init field to find it out yourself:

_unit = typeof this;
_engineer = getNumber (configfile >> "CfgVehicles" >> _unit >> "engineer");
_medic = getNumber (configfile >> "CfgVehicles" >> _unit >> "attendant");

if (_engineer isEqualTo 1) then {hint "Engineer."};
if (_medic isEqualTo 1) then {hint "Medic."};
if (_medic isEqualTo 0 and _engineer isEqualTo 0) then {hint "Cannon Fodder."};

Not 100% sure about the second value though. (weird word choice.)

 

Cheers

 

edit: heh gc8 beat me to it

  • Like 2

Share this post


Link to post
Share on other sites
Not 100% sure about the second value though. (weird word choice.)
Yes that is correct attendant someone whom attends to your wounds. Another grape sir, would you like it peeled. :D

 

_unit = group player createUnit [ "B_Soldier_Universal_F", getPos player, [], 0, "FORM" ];
_engineer = getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer");
_medic = getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "attendant");
if (_medic isEqualTo 1 and _engineer isEqualTo 1) then {hint "Super Soldier."};

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

×