ForceRefIfEmpty, ForceRefTo - anyone use this extensively?

Post » Thu Jun 21, 2012 1:24 pm

Anyone using ForceRefIfEmpty or ForceRefTo extensively?
I use it to add Packages to NPCs in my Fight or Fly mod.
However, I've been finding that I can't play that mod with other of my mods. My game crashes after about 10 minutes - sometimes earlier.
Without my other mods, Fight or Fly works well.
I've tested playing without Fight or Fly and with different combinations of my mod to rule them out - and they all work.
As soon as I add Fight or Fly, my game fails.
But if I play with Fight or Fly only, my game works.
The only major change in that mod wa the addition of ForceRefIf and ForceRefTo instead of Stopping and Starting the Quest.
So I think it could be related to the use of those commands.
Anyone have any other experiences with them?
User avatar
Rhysa Hughes
 
Posts: 3438
Joined: Thu Nov 23, 2006 3:00 pm

Post » Thu Jun 21, 2012 12:00 pm

In essence, they're both ForceRefTo. ForceRefIfEmpty is a designer function and isn't hardcoded.
Bool Function ForceRefIfEmpty(ObjectReference akNewRef)	If GetReference()		Return False	Else		ForceRefTo(akNewRef)		Return True	EndIfEndFunction
Are the references in one mod or the other reserved and/or filled with the same reference(s)?


If you need to clear a bunch of 'em w/o resetting the quest:
Spoiler
ReferenceAlias[] Property AliasArray AutoFunction ClearAliases(Int aiIndex = 0)	aiIndex = AliasArray.Length	While aiIndex > 0		aiIndex -= 1		AliasArray[aiIndex].Clear()	EndWhileEndFunction
User avatar
Dan Wright
 
Posts: 3308
Joined: Mon Jul 16, 2007 8:40 am

Post » Thu Jun 21, 2012 2:41 pm

Hey JustinOther, I found what the problem was. It had nothing to do with ForceRefTo, luckily.

After reading the thread about TESVSnip corrupting ESP, I tried disabling another mod, Horse Commands. And my Fight or Fly mod worked perfectly - with all my other mods enabled. So I'm pretty sure it was the corrupt Horse Commands affecting my other mods (particularly Fight or Fly, for some reason) at run-time that caused the crashes.

Thanks anyway, mate.
User avatar
Harry Hearing
 
Posts: 3366
Joined: Sun Jul 22, 2007 6:19 am


Return to V - Skyrim