I have a working soldier loadout script that assigns a loadout to all West soldiers based on the "type" of soldier (AA, AT, TL, G, Medic, etc.). It's a bit restrictive in that I have to pass the soldier type to the script so it knows what loadout to choose. It would be great if I could make it more flexible by having the script figure out what is the "type" of soldier. This would make it much easier to use in other missions where I have not pre-defined all the soldiers.
I've looked at all the "attributes" of soldiers in the mission.sqm file and the only one I found that infers the "soldier type" is vehicle. Example is 'SoldierWAT'. Unfortunately, I looked at some missions and I found a large variety of these 'soldier types' depending on what soldier models the mission author uses. Some began with 'Soldier' while others began with 'USMC'.
Can anyone advise me if there's a smart way to make the script assign a loadout (AA, AT, Medic, G, etc.) without me having to tell the script the type of soldier?