Jump to content

MCGUFIN

  • entries
    12
  • comments
    0
  • views
    1371

Aliases


Monoman1

59 views

Regular Alias functions: 

Spoiler
; Returns true if a reference alias's 'reserved' flag is enabled. 
Bool Function IsReservedAlias(ReferenceAlias akAlias) Global Native

; Returns true if an actor is in a reference alias that's flagged as reserved. 
; FilterReservedAlias: 0 = any, 1 = exclude reserved, 2 = only reserved
Bool Function IsActorInAlias(Actor akActor, Int FilterReservedAlias = 0) Global Native

; Return all reference aliases that point to akRef. 
; FilterReservedAlias: 0 = any, 1 = exclude reserved, 2 = only reserved
ReferenceAlias[] Function FindAliasesWithObjRef(ObjectReference akRef, Int FilterReservedAlias = 0) Global Native

; Return the index of the alias in akQuest that contains ObjRef. Returns -1 if not found. 
Int Function GetAliasIndexWithObjRef(Quest akQuest, ObjectReference ObjRef)Global Native

; Returns the reference alias in akQuest that contains ObjRef. Returns None if not found. 
ReferenceAlias Function GetAliasWithObjRef(Quest akQuest, ObjectReference ObjRef) Global Native

; Gets all aliases in a quest. Both reference and location. 
Alias[] Function GetQuestAliases(Quest akQuest) Global Native

; Returns a list of all aliases filtered by type. 
; Type:  0 = All. 1 = Reference aliases only. 2 = Location aliases only. 
Alias[] Function GetQuestAliasesByType(Quest akQuest, Int Type) Global Native

; Returns all reference aliases that hold a reference. Empty aliases are ignored. 
; Location aliases are not included. 
Alias[] Function GetFilledAliases(Quest akQuest) Global Native

; Returns the index of the first empty alias in akQuest. Returns -1 if all aliases are filled. 
Int Function GetFirstEmptyAliasIndex(Quest akQuest) Global Native

; Returns the first empty reference alias in akQuest. Returns none if all aliases are filled. 
ReferenceAlias Function GetFirstEmptyAlias(Quest akQuest) Global Native

; Returns the names of all aliases in akQuest in order.
; AliasType: 0 = Any alias type. 1 = Reference aliases only. 2 = Location aliases only. 
; SkipUnfilled: True = Don't return unfilled aliases. False = Return alias name even if it's not filled. 
String[] Function GetAliasNames(Quest akQuest, Int AliasType, Bool SkipUnfilled) Global Native

; Returns the references of every reference alias in akQuest in order. 
; AllowNones: True: Unfilled alias = None in returned array. False: Skip unfilled alias. 
; ConvertLocAliasToNone: True: LocationAlias converts to None. False: Skip location aliases. 
; AllowNones + ConvertLocAliasToNone = True, then returned array is the same length as the number of aliases. 
; AllowNones + ConvertLocAliasToNone = False, then no Nones returned in array. 
ObjectReference[] Function GetAliasReferences(Quest akQuest, Bool AllowNones = True, Bool ConvertLocAliasToNone = True) Global Native

; Returns references whose alias name matches any entry in Names (case-insensitive).
; SubstringMatch: false = exact match, true = substring match.
; AllowNones: include None for empty ref aliases that match by name.
; ConvertLocAliasToNone: include None for matching location aliases instead of skipping them.
ObjectReference[] Function GetAliasRefsByNames(Quest akQuest, String[] Names, Bool SubstringMatch = False, Bool AllowNones = True, Bool ConvertLocAliasToNone = True) Global Native


FIFO Aliases: 
Fifo alias functions are a system of managing aliases on a First-In-First-Out basis. Initially the system will seek to fill all empty aliases on a quest. Once all aliases are filled the system will begin overwriting the oldest alias first. The primary function here is AliasFillFifoAuto()

Spoiler
; Fills an alias on akQuest in a FIFO manner. Automatically mangages timestamps so you don't have to worry about it. 
Bool Function FifoAliasFillAuto(Quest akQuest, ObjectReference ObjRef) Global Native

; Allows you to manually overwrite an alias index if you wish. Automatically updates the alias timestamp to integrate with the system.
Bool Function FifoAliasFill(Quest akQuest, Int AliasIndex, ObjectReference ObjRef) Global Native

; Returns the index of the alias with the oldest timestamp.
; Returns -1 if no alias currently has a valid tracked timestamp. 
Int Function FifoAliasGetOldestIndex(Quest akquest) Global Native

; Returns the reference alias with the oldest timestamp.
; Returns 'None' if no alias currently has a valid tracked timestamp. 
ReferenceAlias Function FifoAliasGetOldest(Quest akQuest) Global Native

; Returns the index of the alias with the newest timestamp. 
; Returns -1 if no alias currently has a valid tracked timestamp. 
Int Function FifoAliasGetNewestIndex(Quest akQuest) Global Native

; Returns the reference alias with the newest timestamp
; Returns 'None' if no alias currently has a valid tracked timestamp.
ReferenceAlias Function FifoAliasGetNewest(Quest akQuest) Global Native

; Returns the index of the alias to use next: prefers any alias without a tracked
; timestamp, then falls back to the oldest tracked timestamp. Whether the alias is
; currently filled is not considered. Unlike FifoAliasGetOldestIndex, this always
; returns a valid index as long as the quest has at least one valid alias - use this
; for FIFO assignment/eviction. 
Int Function FifoAliasGetNextIndex(Quest akQuest) Global Native

; Same policy as FifoAliasGetNextIndex() but returns the alias directly. 
ReferenceAlias Function FifoAliasGetNext(Quest akQuest) Global Native

; Updates the timestamp of a FIFO alias to now.
Bool Function FifoUpdateTimestamp(Quest akQuest, Int aliasIndex) Global Native

; Manually clear the timestamp data on an alias.
Function FifoAliasClearTimestamp(Quest akQuest, Int AliasIndex) Global Native

; Clear a FIFO alias and timestamp info.
Bool Function FifoAliasClear(Quest akQuest, Int aliasIndex) Global Native


PS: If anyone knows how to actually do a 'ForceRefTo' equivalent natively then get in touch please. I'm currently doing a dispatch to a simple papyrus wrapper...

 

Edited by Monoman1

0 Comments


Recommended Comments

There are no comments to display.

×
×
  • Create New...