Here's my script so far (minus the initial check for a gun weapon):
set index to 0 label 10 set item to player.getInventoryObject index printc "%n" item if (item) if (GetType item == 40) printc "Getting weapon info" set ammoType to item.GetWeaponAmmo printc "%n uses %n ammo" item, ammotype set weapType to item.GetWeaponType printc "%n is a weapon of type %.0f" item, weapType set clipSize to item.GetWeaponClipRounds printc "%n has a clip size of %.0f" item, clipSize set ammoUse to item.GetWeaponAmmoUse printc "%n uses %.0f rounds per shot" item, ammoUse set clipUse to (clipSize / ammoUse) ;calculates how many shots can be made with one clip printc "%n gets %.0f shots per clip" item, clipUse printc "Weapon info obtained"
In theory, it seems it should all work (I'm working off the rather horribly documented FOSE function descriptions for my usage). And for the first bit, it works. All the lines print out the name of the first weapon. The issue that I'm getting is that none of the functions from getWeaponAmmo down work (it returns
Which gets me to my next problem. Since all the values are zero, the line:
set clipUse to (clipSize / ammoUse) ;calculates how many shots can be made with one clip
causes a divide by zero issue and makes the object lock up (Strange the game can survive a divide by zero error, but crashes when you do an integral action like save).
I did try doing an equip on the weapon I wanted to check, but it wound up equipping a laser pistol and checking a shotgun. So I'm not sure what got messed up with that.
Anyway, that's my issue.