Jump to content

Getting mixed up between Alias and ReferenceAlias


Hoamaii

Recommended Posts

Hi guys,

 

I'm trying to compile this attached to an ObjectReference (which is not an Alias, but may have filled an optional one) to try and clear the Alias this object may have filled:

If Game.GetModByName("NewMod.esp") != 255
	Quest _NM_MyQuest = Game.GetFormFromFile(0x000008B8, "NewMod.esp") as Quest
	int idx = _NM_MyQuest.GetNumAliases()
	while idx > 0
		idx -= 1
		Alias nthAlias = _NM_MyQuest.GetNthAlias(idx) as Alias
		if nthAlias
			ObjectReference nthAliasRef = nthAlias.GetReference() 
			If nthAliasRef == MyObjectReference
				nthAlias.Clear()
				Debug.Notification("MyObjectReference cleared as Alias")
			EndIf
		EndIf
	endWhile
EndIf

I know I'm mixing apples and pineapples here, trying to call referenceAlias functions on an Alias - and of course Papyrus tells me "GetReference()" is not a function and "Clear()" is not a function either - but I can't figure out which functions to use to go from my nthAlias Alias to an Alias_nthAlias ReferenceAlias before I can call GetReference() to get a nthAliasRef that I'll be able to compare to my objectReference before clearing the Alias if need be... :huh:

 

Could a kind soul enlighten me, please?

 

Many thanks in advance :smile: (and Happy Easter - uh, if it's Easter in your country too I mean)

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...