CheckActorAgainstFactionArray - CommonArrayFunctions

From Creation Kit
Jump to: navigation, search

Member of: CommonArrayFunctions Script

Loops through an array of Factions and checks if the specified actor in in any of them.

Syntax

bool Function CheckActorAgainstFactionArray(Actor ObjectToCheck, Faction[] ArrayToCheck, \
  bool returnValueIfArrayIsEmpty = false) global

Parameters

  • ObjectToCheck: The Actor whose factions we are looking for
  • ArrayToCheck: The Faction array we are looking in
  • returnValueIfArrayIsEmpty: If the array is empty, return this.
    • Default: False

Return Value

  • True: If the ObjectToCheck is in one of the factions in ArrayToCheck
  • False: If the ObjectToCheck has none of the factions in ArrayToCheck
  • False: If ObjectToCheck is None
  • returnValueIfArrayIsEmpty: If ArrayToCheck is Empty/None

Examples

if CommonArrayFunctions.CheckActorAgainstFactionArray(Dogmeat, HostileFactions)
   Debug.Trace("Dogmeat is in a hostile faction!")
endIf

See Also