shavkacagarikia Posted July 28, 2016 Share Posted July 28, 2016 hello, is there a function to get ammo count in current weapons magazine? Link to comment Share on other sites More sharing options...
bill8872 Posted July 28, 2016 Share Posted July 28, 2016 By default, it should show every time you change weapons, or when out looting. Link to comment Share on other sites More sharing options...
shavkacagarikia Posted July 28, 2016 Author Share Posted July 28, 2016 By default, it should show every time you change weapons, or when out looting. no :), I'm talking about creation kit, I need that function for a script Link to comment Share on other sites More sharing options...
Reneer Posted July 28, 2016 Share Posted July 28, 2016 There is no way to get the current ammo count in the magazine, but you can get how much ammo the player has by using this code: Weapon currentweapon = Game.GetPlayer().GetEquippedWeapon(0) Ammo playerammo = currentweapon.GetAmmo() Link to comment Share on other sites More sharing options...
shavkacagarikia Posted July 28, 2016 Author Share Posted July 28, 2016 Thanks I am aware how to do that, but I need the amount of ammo in magazine Link to comment Share on other sites More sharing options...
Reneer Posted July 28, 2016 Share Posted July 28, 2016 Thanks I am aware how to do that, but I need the amount of ammo in magazineYou can't get that kind of info, unfortunately. The best you could do would be to divide the player's current total ammo by the number of rounds held in the magazine, but that would require that you figure out what magazine is equipped on the current weapon. Link to comment Share on other sites More sharing options...
WolfmanMODS Posted July 28, 2016 Share Posted July 28, 2016 See this thread https://forums.nexusmods.com/index.php?/topic/4586285-papyrus-f4-detecting-when-the-player-fires-a-weapon/?hl=%2Bjam&do=findComment&comment=40864335 Use this script to count shots after every reload, once you setup a script to get the magazine size of the weapon. RegisterForAnimationEvent(Game.GetPlayer(), "weaponFire")Event OnAnimationEvent(ObjectReference akSource, string asEventName) If (akSource == Game.GetPlayer() && asEventName == "weaponFire") Debug.Notification("The player fired his weapon.") EndIfEndEvent Then on the reload event reset the shot counter of which the animation event or that is supposed to be "reloadComplete" but I could never make a script trigger :cool: off that event and have not yet used the noted method to find the reload specific animations. Also make sure to use the "currentweapon.GetAmmo()" method to verify that there are enough rounds to fully load the mag, and adjust logic accordingly. If you want to make a more detailed description of what you are trying accomplish, assuming its not classified, lemme know and I might be better able to point you in the right direction. Link to comment Share on other sites More sharing options...
shavkacagarikia Posted July 28, 2016 Author Share Posted July 28, 2016 thanks I will try out and let you know Link to comment Share on other sites More sharing options...
shavkacagarikia Posted July 28, 2016 Author Share Posted July 28, 2016 See this thread https://forums.nexusmods.com/index.php?/topic/4586285-papyrus-f4-detecting-when-the-player-fires-a-weapon/?hl=%2Bjam&do=findComment&comment=40864335 Use this script to count shots after every reload, once you setup a script to get the magazine size of the weapon. RegisterForAnimationEvent(Game.GetPlayer(), "weaponFire") Event OnAnimationEvent(ObjectReference akSource, string asEventName) If (akSource == Game.GetPlayer() && asEventName == "weaponFire") Debug.Notification("The player fired his weapon.") EndIfEndEvent Then on the reload event reset the shot counter of which the animation event or that is supposed to be "reloadComplete" but I could never make a script trigger :cool: off that event and have not yet used the noted method to find the reload specific animations. Also make sure to use the "currentweapon.GetAmmo()" method to verify that there are enough rounds to fully load the mag, and adjust logic accordingly. If you want to make a more detailed description of what you are trying accomplish, assuming its not classified, lemme know and I might be better able to point you in the right direction.I can't catch that onanimation event, I register it oninit and then have the onanimationevent but i get no notification when firing a weapon. My script extends activemagiceffect can that be the problem? Link to comment Share on other sites More sharing options...
Reneer Posted July 29, 2016 Share Posted July 29, 2016 I can't catch that onanimation event, I register it oninit and then have the onanimationevent but i get no notification when firing a weapon. My script extends activemagiceffect can that be the problem?You should post the script if you want people to help you with it. :smile: Link to comment Share on other sites More sharing options...
Recommended Posts