http://fallout3.nexusmods.com/mods/17666/
I've got the script running, but the FOSE code was this, which works well enough in FO 3:
scn UnlimitedPlayerAmmoSCRIPTref rWeaponref rAmmoref rGrenaderef rMineshort iAmmoCountshort iAmmoUseshort iWeaponTypeBEGIN GameMode if UnlimitedPlayerAmmoEnabled == 1 set rWeapon to GetEquippedObject 5 set rAmmo to GetWeaponAmmo rWeapon set iAmmoCount to GetWeaponClipRounds rWeapon set iAmmoUse to GetWeaponAmmoUse rWeapon set iWeaponType to GetWeaponAnimType if iAmmoCount > 0 && iAmmoUse > 0 && ((iWeaponType == 4 && UnlimitedPlayerPistol == 1) || (iWeaponType >= 5 && iWeaponType <= 6 && UnlimitedPlayerRifle == 1) || (iWeaponType == 7 && UnlimitedPlayerHandle == 1) || (iWeaponType == 8 && UnlimitedPlayerLauncher)) if UnlimitedMode == 1 || UnlimitedMode != 2 if GetItemCount rAmmo < (iAmmoCount + iAmmoUse) if GetWeaponFireRate rWeapon < 15 AddItem rAmmo 1 1 else AddItem rAmmo 2 1 endif endif elseif UnlimitedMode == 2 if GetItemCount rAmmo == 0 AddItem rAmmo iAmmoCount 1 endif endif elseif (iWeaponType == 9 && UnlimitedPlayerGrenade == 1) set rGrenade to GetEquippedObject 5 if GetItemCount rGrenade < 2 AddItem rGrenade 1 1 endif elseif (iWeaponType >= 10 && UnlimitedPlayerMine == 1) set rMine to GetEquippedObject 5 if GetItemCount rMine < 2 AddItem rMine 1 1 endif else set rWeapon to 0 set rGrenade to 0 set rMine to 0 set rAmmo to 0 set iAmmoCount to 0 set iAmmoUse to 0 return endif endifEND
However, NVSE is slightly different, as I'm sure you guys know.
For example, GetWeaponAmmo, which returns the amount of ammo for the weapon in FO3, returns the formlist for weapon ammo in NVSE, so all available ammo types are dealt with.
So the only way I can adapt this for NV currently is to delete all but one ammo type off the formlist, since the refill script adds ammo randomly - so the player has to keep switching between Ammo types. Is there a way to set this so that it focuses on one ammo type?
I tried to use GetPlayerCurrentAmmo in place of GetWeaponAmmo, but it doesn't seem to work with that, although the script readily compiles. I found a post somewhere on the net that says GetPlayerCurrentAmmo is bugged and I need to insert an endif somewhere? Is this still true, and if so, where the hell do I put it?