Jump to content

Function to find Clip Size?


RedxYeti

Recommended Posts

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 next

InstanceData:Owner thisInstance = new InstanceData:Owner
thisInstance.Owner = PlayerRef.GetEquippedWeapon() as Weapon
Link to comment
Share on other sites


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

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

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

 

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...