Jump to content

[LE] Quests dropping aliases filled with ForceRefTo between loads.


Recommended Posts

I have a quest, that is start game enabled, with several aliases that are set to none to begin with. Later in the mod, certain actors will be placed into those aliases using ForceRefTo. However I noticed that when loading a save/starting the game back up after the aliases have been filled, they are now empty. It appears as though aliases filled using ForceRefTo aren't saved in savegames? I don't see any documentation/notes on this behaviour on the CK site or other forums.

 

This is a pretty big problem for what I currently have setup, if loading a save clears the aliases. Is there some way to address/fix this so that filled aliases are remembered through saves/loads.

Link to comment
Share on other sites

 

They are, so there's something in your setup that's clearing them.

What could clear a quest alias aside from stopping/reset the quest, which isn't happening, or calling clear() directly on the alias?

 

 

There shouldn't be anything AFAIK; a ForceRef to 'none' shouldn't do anything. There's a note in the wiki's talk page for ForceRef of someone having the same issue back in 2016, but I've used ForcedRef both script and console across saves without issue.

 

Without more details on your scripting / quest setup it's hard to figure the issue. One possibility is that Quests that are Start Game Enabled will start twice, so depending on how exactly you've set up your force-fill it could be that they're filling on game start and then being wiped when the quest starts for the second time (e.g., OnInit events fire twice in this scenario).

Link to comment
Share on other sites

Okay so the quest in question has several empty aliases, marked as optional, and one filled alias, for the player filled with PlayerRef. The quest has a script with OnInit() event which calls a function that checks if another mod is installed and depending on whether it is there or not, uses forcerefto to fill one of the empty aliases. The player alias, also has a script attached which calls this function using the event OnPlayerLoadGame(), in case a user removes the other mod later on.

 

When starting a new game, everything works fine. The player alias is filled as it should be, and the one other aliases is filled as well. Saving and loading the game, either in the same instance or with closing the game, causes all aliases to be set to none.

 

My MCM quest for the mod, which also has a player alias, does not have the same problem.

 

Edit: The function being called through the OnInit() and supposedly through OnPlayerLoadGame().

Event OnInit()

	ModCheck()

EndEvent

Function ModCheck()

	int modIndex = Game.GetModByName("Cutting Room Floor.esp")

	if modIndex == 255
		SC_KarindaMarker.Enable()
		KarindaHorse.ForceRefTo(SC_KarindaHorse)
		miscutil.PrintConsole("Cutting Room Floor not installed.")
	else
		Actor CRFKarindaHorse = Game.GetFormFromFile(0x0001FBCF, "Cutting Room Floor.esp") as Actor
		KarindaHorse.ForceRefTo(CRFKarindaHorse)
		miscutil.PrintConsole("Cutting Room Floor installed.")
		if KarindaHorse.GetReference() == None
			miscutil.PrintConsole("Error: Whiterun Horse Alias not filled.")
		else
			string horseName = (KarindaHorse.GetReference() as Actor).GetBaseObject().GetName()
			miscutil.PrintConsole("Whiterun Horse Alias filled with "+horseName+".")
		endif
	endif

EndFunction
Edited by NarcolepsyNick
Link to comment
Share on other sites

  • 2 months later...
  • Recently Browsing   0 members

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