Jump to content

Adding F4SE functions into existing games


SKKmods

Recommended Posts

I have just started to work with F4SE as it contains 2 exclusive functions I must punish myself with (GetAllMods & GetLooseMod).

 

In 4,000 hours of Fallout4 I have never ever used F4SE so it is not baked into any of my hundreds of CLEAN (no mods no DLC) savegame libraries.

 

When testing in those CLEAN savegames at various player states I am getting unpredictable results from the F4SE functions using exactly the same unit and system test scenarios/scripts. Sometimes the F4SE functions return expected results and other times no results. The F4SE dependent scripts are of course testing that F4SE is loaded before exposing the functions.

 

So I am wondering if F4SE must be loaded when a new game VM initializes to deliver predictable results ... or something ?

Link to comment
Share on other sites

Having cycled through add and remove F4SE from savegames several hundred times, as long as mods are only using the script functions and provide state detection to avoid calling those functions when unavailable (and are of course not using bound DLL injections) it's fine.

 

My inconsistent issue results issue stemmed from a non robust or fault-tolerant F4SE detection method. This is the working industrial strength approach to switch F4SE dependent functions on and of in my scripts (called during OnPlayerLoadGame for state change);

Bool bF4SEInstalled = FALSE

Int ScriptVersionRelease = Utility.CallGlobalFunction( "F4SE", "GetScriptVersionRelease", New Var[0] ) as Int ;Non native

If( ScriptVersionRelease > 0 ) ;scripts are installed
	Int VersionRelease = Utility.CallGlobalFunction( "F4SE", "GetVersionRelease", New Var[0] )  as Int ;error: Unbound native function "GetVersion" called
	If( VersionRelease == ScriptVersionRelease)
		bF4SEInstalled = TRUE
	EndIf
EndIf

And if your interested in a one click F4SE add & remove mechanism;

 

 

  Reveal hidden contents

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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