Your problem isn't in your code per se, it is in how the functions you are calling work.
For instance, SpawnAI calls AI::setWeapons toward the bottom.
AI::setWeapons is where your loadout actually gets processed, and is also where your problem is.
if(%loadout == -1 || %loadout == "" || String::ICompare(%loadout, "default") == 0)
{
%items = $BotInfo[%aiName, ITEMS];
if(%items == "")
GiveThisStuff(%aiId, $BotEquipment[clipTrailingNumbers(%aiName)], False);
else
GiveThisStuff(%aiId, %items, False);
}
else
GiveThisStuff(%aiId, $LoadOut[%loadout], False);
This is a snipet from the function AI::setWeapons. Notice that your loadout doesn't fit the if statement. Since it is not blank, it is defined, and it does not = default, it passes to the else statement.
Since you have no $LoadOut[%loadout] defined, your critter shows as a -1 with nothing in its inventory.
There are a couple of ways around this, 1) spawn it then use the GiveThisStuff Function on your own; 2) Define $LoadOut[%loadout], and see if it accepts that; 3) Set %loadout = to "" and use the $BotInfo[%aiName, ITEMS] variable to define what it has.
Your best bet is to always track the functions that you are going to use, and see what they are doing.
If this is completely wrong, or I am wrong, then open AI.cs and figure it out on your own.