CheckObjectAgainstKeywordArray - CommonArrayFunctions

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

Member of: CommonArrayFunctions Script

Loops through an array of Keywords and checks if the specified ObjectReference has any of them.

Syntax[edit | edit source]

bool Function CheckObjectAgainstKeywordArray(ObjectReference ObjectToCheck, Keyword[] ArrayToCheck, \
  bool returnValueIfArrayIsEmpty = false) global

Parameters[edit | edit source]

  • ObjectToCheck: The ObjectReference who's Keywords we are looking for
  • ArrayToCheck: The Keyword Array we are looking in
  • returnValueIfArrayIsEmpty: If the array is empty, return this.
    • Default: False

Return Value[edit | edit source]

  • True: If the ObjectToCheck has at least one of the keywords in the array
  • False: If the ObjectToCheck has none of the keywords in the array
  • False: If ObjectToCheck is None
  • returnValueIfArrayIsEmpty: If ArrayToCheck is Empty/None

Examples[edit | edit source]

if CommonArrayFunctions.CheckObjectAgainstKeywordArray(Jackhammer, MeleeWeaponKeywords)
   Debug.Trace("The jackhammer is a melee weapon!")
endif

See Also[edit | edit source]