Re: CPU-controlled actor inventory
Well, you could do a check through all the MOs of the actor and check which one has ClassName == "HDFirearm" or ClassName == "TDExplosive".
I'm pretty sure that kind of code is used in mods for B24 or something.
EDIT:
CaveCricket don't kill me for taking this bits of code from your scanner!
Code:
for i = 1, MovableMan:GetMOIDCount()-1 do
local gun = MovableMan:GetMOFromID(i);
if gun.ClassName == "HDFirearm" and gun.PresetName == "Scanner" and SceneMan:ShortestDistance(self.Pos,ToHDFirearm(gun).MuzzlePos,self.mapwrapx).Magnitude < 5 then
Well, I suppose you can modify the if to fit your needs, like "if gun.ClassName == "HDFirearm" or gun.ClassName == "TDExplosive" then actorweapon = gun" or something like it.