GetComponentCount - ObjectReference

From the Fallout4 CreationKit Wiki
Revision as of 07:17, 29 July 2014 by imported>Plplecuyer (→‎Syntax)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Member of: ObjectReference Script

Returns how many of the specified components are in this reference's inventory.

Syntax[edit | edit source]

int Function GetComponentCount(Form akItem = None) native

Parameters[edit | edit source]

  • akItem: The component to look for in this reference's inventory.
    • If a component, will look for misc items that contain this component.
    • If a form list, it will count how many of each component in the form list is in the container and sum it all up
    • If None, will count how many components are in the container in total
    • Default: None

Return Value[edit | edit source]

How many of said components are in this reference's inventory.

Examples[edit | edit source]

if (Game.GetPlayer().GetComponentCount( c_Concrete ) == 0)
  Debug.Trace("Player has no concrete")
endIf

See Also[edit | edit source]