CommonArrayFunctions Script

Collection of generic array processing global functions (non-native).

DefinitionEdit

ScriptName CommonArrayFunctions

PropertiesEdit

None

Global FunctionsEdit

  • bool Function CheckActorAgainstFactionArray(Actor ObjectToCheck, Faction[] ArrayToCheck, bool returnValueIfArrayIsEmpty)
    • Loops through an array of Factions and checks if the specified actor in in any of them.
  • bool Function CheckFormAgainstArray(Form FormToCheck, Form[] ArrayToCheck, bool returnValueIfArrayIsEmpty)
    • Checks to see if the passed in form is in the array.
  • bool Function CheckLocationAgainstArray(Location ObjectToCheck, Location[] ArrayToCheck, bool returnValueIfArrayIsEmpty, bool matchIfChildLocation)
    • Checks to see if the location is in the array (or optionally is a child of a location in the array)
  • bool Function CheckLocationAgainstLocationAliasArray(Location ObjectToCheck, LocationAlias[] ArrayToCheck, bool returnValueIfArrayIsEmpty, bool matchIfChildLocation)
    • Checks to see if the location is in one of the aliases in the array (or optionally is a child of one of the locations)
  • bool Function CheckObjectAgainstKeywordArray(ObjectReference ObjectToCheck, Keyword[] ArrayToCheck, bool returnValueIfArrayIsEmpty)
    • Loops through an array of Keywords and checks if the specified ObjectReference has any of them.
  • bool Function CheckObjectReferenceAgainstArray(ObjectReference ObjectToCheck, ObjectReference[] ArrayToCheck, bool returnValueIfArrayIsEmpty)
    • Loops through an ObjectReference array and checks if the specified objectReference matches any of the items in the array.
  • bool Function CheckObjectReferenceAgainstReferenceAliasArray(ObjectReference ObjectToCheck, ReferenceAlias[] ArrayToCheck, bool returnValueIfArrayIsEmpty)
    • Loops through an array of ReferenceAliases and checks if any of them have the specified objectReference in them.
  • int Function FindInReferenceAliasArray(ObjectReference ObjectToCheck, ReferenceAlias[] ArrayToCheck)
    • Checks each alias in the array for one containing the specified reference
  • Faction Function GetFirstFoundFactionInArrayForActor(Actor ActorToCheck, Faction[] ArrayToCheck)
    • Returns the first faction in the array the actor is a member of
  • Keyword Function GetFirstFoundKeywordInArrayForLocation(Location LocationToCheck, Keyword[] ArrayToCheck)
    • Returns the first keyword in the array that the location has
  • bool Function IsActorInArrayHostileToActor(Actor ActorToCheck, ObjectReference[] ArrayToCheck)
    • Returns if any actor in the array is hostile to the passed in actor

Member FunctionsEdit

None

EventsEdit

None

NotesEdit

To call functions on this script, you must either name the script in the function call, or import the script.

if CommonArrayFunctions.CheckActorAgainstFactionArray(myObject, myFactions)
  ;do something
endif


import CommonArrayFunctions

Function SomeFunction() 
  if CheckActorAgainstFactionArray(myObject, myFactions)
    ;do something
  endif
EndFunction