RedxYeti Posted November 20, 2022 Share Posted November 20, 2022 I swear ive seen it before, but i cant find it. I remember it specifically saying clip size instead of magazine size. ive scoured the wiki but i cant find it anywwhere. Anyone know of the function im talking about? or does it just not exist? edit:okay i think i found it, but i dont know how to use it https://www.creationkit.com/fallout4/index.php?title=GetAmmoCapacity_-_InstanceData I want it to check against the players equipped weapon if thats possible Edit 2:This compiles fine, but unsure where to go nextInstanceData:Owner thisInstance = new InstanceData:OwnerthisInstance.Owner = PlayerRef.GetEquippedWeapon() as Weapon Link to comment Share on other sites More sharing options...
DieFeM Posted November 20, 2022 Share Posted November 20, 2022 Weapon akWeapon = Game.GetPlayer().GetEquippedWeapon() If akWeapon InstanceData:Owner akOwner = akWeapon.GetInstanceOwner() Int AmmoCapacity = InstanceData.GetAmmoCapacity(akOwner) Debug.MessageBox("Player's Equipped Weapon Capacity is: " + AmmoCapacity) EndIf Link to comment Share on other sites More sharing options...
RedxYeti Posted November 20, 2022 Author Share Posted November 20, 2022 Weapon akWeapon = Game.GetPlayer().GetEquippedWeapon() If akWeapon InstanceData:Owner akOwner = akWeapon.GetInstanceOwner() Int AmmoCapacity = InstanceData.GetAmmoCapacity(akOwner) Debug.MessageBox("Player's Equipped Weapon Capacity is: " + AmmoCapacity) EndIf thank you :thumbsup: i ended up using a flag instead, but your example is all i needed :) Link to comment Share on other sites More sharing options...
DieFeM Posted November 20, 2022 Share Posted November 20, 2022 You're welcome. Note that it will return the ammo capacity of the base object, if you want to check for the actual ammo, which depends on the equipped mods, you need to check the weapon slot of the actor. Weapon akWeapon = Game.GetPlayer().GetEquippedWeapon() If akWeapon InstanceData:Owner akOwner = Game.GetPlayer().GetInstanceOwner(41); 41 is the weapon equip slot Int AmmoCapacity = InstanceData.GetAmmoCapacity(akOwner) Debug.MessageBox("Player's Equipped Weapon Capacity is: " + AmmoCapacity) EndIf Link to comment Share on other sites More sharing options...
RedxYeti Posted November 20, 2022 Author Share Posted November 20, 2022 You're welcome. Note that it will return the ammo capacity of the base object, if you want to check for the actual ammo, which depends on the equipped mods, you need to check the weapon slot of the actor. Weapon akWeapon = Game.GetPlayer().GetEquippedWeapon() If akWeapon InstanceData:Owner akOwner = Game.GetPlayer().GetInstanceOwner(41); 41 is the weapon equip slot Int AmmoCapacity = InstanceData.GetAmmoCapacity(akOwner) Debug.MessageBox("Player's Equipped Weapon Capacity is: " + AmmoCapacity) EndIf oh perfect thanks, i will be using this more often now that i know how it works! Link to comment Share on other sites More sharing options...
Recommended Posts