Jump to content

Problems with the GetReference() function


Recommended Posts

I've made a mod to fix the decontamination arches in the Nucleus in Far Harbor. In the base game, they rely on aliases in a quest that stops shortly after you repair them, so I've outsourced the aliases to a quest that runs constantly. Specifically, they're location reference aliases with the Nucleus as the location and DLC03CoA_FFNucleus03_RadDamageHazard/RadHealHazard as the reference type.

The problem is, sometimes I load the game and the aliases are empty, and I have to use the ClearQuestAliases and ResetQuestAliases console commands to refill them. Worse, sometimes they're not empty and GetReference() still returns null. Console commands are no help. The only fix seems to be saving the game while inside the Nucleus and then reloading.

I could work around the problem with less efficient solutions – persistent references, creating and deleting a new reference every time, etc – but does anyone have any idea why either the references would be emptying or GetReference() would return a null value when they're filled? Is it something about location references that they have to be filled while you're in the referenced location?

 

Link to comment
Share on other sites

Its an ongoing issue with non persistent references.

Having suffered that unpredictable issue for years I don't trust unloaded nonperistent objects located via LocRefTypes and always ForceRefTo to make 'em persistent if the are non optional for my solution.

The logic being that I am doing something to the object for a reason that has beneficial value which can carry the overhead cost of persistence.

Philosophy moment: Every technical choice should enjoy a cost/benefit analysis.

Link to comment
Share on other sites

15 hours ago, SKKmods said:

Its an ongoing issue with non persistent references.

Thanks, that was my other theory! Creating and deleting new references each time is probably the way to go then. Obviously I'll test it, but I can't see any benefit to making them persistent over doing it that way.

Edit: Specifically I think the problem might be with disabled non-persistent references, rather than non-persistent references generally?

Link to comment
Share on other sites

I have had it with disable and enabled references.

When you ForceRefTo a base game placed non persistent object and the the Quest UI suggests "hey why not use an AutofillGeneric LocRefType to avoid creating persistence ?" I nope out as thats what causes my unpredictable object resolution. The game can handle 2 million persistent objects so my couple of adds are not going to break that bank.

Link to comment
Share on other sites

8 hours ago, SKKmods said:

The game can handle 2 million persistent objects so my couple of adds are not going to break that bank.

I guess so. The same mod uses non-persistent references that are consistently enabled though, and I've not had the same problem with those.

Anyway, I've opted for the create/delete method for the time being, and so far, so good.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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