Checking current ammo in weapon?

Post » Sun May 29, 2011 12:01 am

Is there a way to check how much ammo you have in the gun before you need to reload it?

If not I could try to calculate it with ROF, max juice in the gun and check when the player is attacking, I guess, but this would be far easier.
User avatar
Matthew Barrows
 
Posts: 3388
Joined: Thu Jun 28, 2007 11:24 pm

Post » Sat May 28, 2011 11:32 pm

Is there a way to check how much ammo you have in the gun before you need to reload it?

If not I could try to calculate it with ROF, max juice in the gun and check when the player is attacking, I guess, but this would be far easier.


You mean via a script, right? You can get the maximum ammo the weapon's magazine can hold using the FOSE function http://fose.silverlock.org/fose_command_doc.html#GetWeaponClipRounds. Getting the current remaining ammo in the weapon's magazine is not as easy. I have put in a FOSE feature request for this exact function, but development on FOSE has been effectively halted for the time being. You can work around it by maintaining a counter to represent the equipped weapon's magazine and constantly check the total count for the given ammo type. Any time you detect a reduction in the total ammo, reduce the weapon's current magazine count. Obviously you'll want to build your script to account for things like not having enough of the ammo type to reload a full magazine, picking up more of that ammo type while you have the weapon that uses it equipped, and so on.

I've put some thought into how I'd do this. In my case, I was thinking of using a script to swap the weapon's projectile from one without a tracer to one with when the magazine got low. The inability to remove the ammo counter from the HUD pretty much killed my enthusiasm in the project. Let me know if you need more info.
User avatar
Andrew Perry
 
Posts: 3505
Joined: Sat Jul 07, 2007 5:40 am


Return to Fallout 3