Mod:Creation Kit/CheckLocationAgainstLocationAliasArray - CommonArrayFunctions

Member of: Mod:Creation Kit/CommonArrayFunctions Script

Loops through an array of location aliases and checks if the specified location in in any of them. (Or a child of one of them if matchIfChildLocation)

Syntax
bool Function CheckLocationAgainstLocationAliasArray(Location ObjectToCheck, LocationAlias[] ArrayToCheck, \ bool returnValueIfArrayIsEmpty = false, bool matchIfChildLocation = false) global

Parameters

 * ObjectToCheck: The Location we are looking for
 * ArrayToCheck: The LocationAlias array we are looking in
 * returnValueIfArrayIsEmpty: If the array is empty, return this.
 * Default: False
 * matchIfChildLocation: If true, the location will match if it is a child of a location in an alias.
 * Default: False

Return Value

 * True: If the ObjectToCheck is in one of the location aliases in ArrayToCheck (or a child, if matchIfChildLocation)
 * False: If the ObjectToCheck is not in one of the location aliases in ArrayToCheck (and not a child, if matchIfChildLocation)
 * False: If ObjectToCheck is None
 * returnValueIfArrayIsEmpty: If ArrayToCheck is Empty/None

Examples
if CommonArrayFunctions.CheckLocationAgainstLocationAliasArray(PlayerLocation, QuestLocationAliases) Debug.Trace("The player is in one of the quest locations! (But not a child location)") endIf