diff --git a/scripts/_00e_func_checkdependencies.pex b/scripts/_00e_func_checkdependencies.pex new file mode 100644 index 00000000..8ee29474 Binary files /dev/null and b/scripts/_00e_func_checkdependencies.pex differ diff --git a/scripts/_00e_playersetupscript.pex b/scripts/_00e_playersetupscript.pex index 72c8e5d8..94463ac1 100644 Binary files a/scripts/_00e_playersetupscript.pex and b/scripts/_00e_playersetupscript.pex differ diff --git a/scripts/ski_configmenu.pex b/scripts/ski_configmenu.pex index cc0b935d..5ae065f1 100644 Binary files a/scripts/ski_configmenu.pex and b/scripts/ski_configmenu.pex differ diff --git a/source/scripts/_00e_func_checkdependencies.psc b/source/scripts/_00e_func_checkdependencies.psc new file mode 100644 index 00000000..cb8436ab --- /dev/null +++ b/source/scripts/_00e_func_checkdependencies.psc @@ -0,0 +1,49 @@ +Scriptname _00E_Func_CheckDependencies Hidden + +Function CheckDependencies() global + + ; If Enderal - Forgotten Stories.esm is not loaded, kick the player back to main menu + if (Game.GetFormFromFile(0x0004320E, "Skyrim.esm") as GlobalVariable).GetValueInt() != 1 + Utility.wait(2.0) + Game.QuitToMainMenu() + Debug.MessageBox("Enderal - Forgotten Stories.esm is not loaded! The game will not run properly. Open Data Files and enable it.") + EndIf + + ; Skip all other check on non-PC/non-VR platforms (for future ports) + ; If you are porting Enderal to another platform, you may want to replace _00E_Func_CheckDependencies with your own script. + if Debug.GetPlatformName() != "Win64" + return + endif + + Int SKSEVer = SKSE.GetVersion() + + if SKSEVer == 0 + Utility.wait(2.0) + Game.QuitToMainMenu() + Debug.MessageBox("SKSE is not detected! Start Enderal through the launcher or skse64_loader.exe in the game directory.") + Return + endif + + Quest bSkyUI = Game.GetFormFromFile(0x00000802, "SkyUI_SE.esp") as Quest + + If bSkyUI == None + Utility.wait(2.0) + Game.QuitToMainMenu() + Debug.MessageBox("SkyUI_SE.esp is not loaded! The game will not run properly. Open Data Files and enable it.") + Return + EndIf + + if SKSE.GetPluginVersion("fs_skse_functions") == -1 + Utility.wait(2.0) + Game.QuitToMainMenu() + Debug.MessageBox("fs.dll is not loaded! The game will not run properly. Verify integrity of your files.\n\nThis may also happen, if your version of SKSE or Enderal is too old. In this case, it is advised to upgrade.") + Return + endif + + if SKSE.GetPluginVersion("JContainers64") == -1 + ; JContainers is only required for lycanthropy, so we just nag users without preventing playing without it + Utility.wait(2.0) + Debug.MessageBox("JContainers is not loaded! The game will not run properly. Verify integrity of your files or reinstall JContainers.") + endif + +EndFunction diff --git a/source/scripts/_00e_playersetupscript.psc b/source/scripts/_00e_playersetupscript.psc index abe56586..e9fb34e3 100644 --- a/source/scripts/_00e_playersetupscript.psc +++ b/source/scripts/_00e_playersetupscript.psc @@ -15,7 +15,7 @@ Event OnInit() Utility.WaitMenuMode(0.1) EndWhile - CheckIfForgottenStoriesIsLoaded() + _00E_Func_CheckDependencies.CheckDependencies() If self == (PlayerREF as ObjectReference) @@ -29,10 +29,22 @@ Event OnInit() EnableDisableKillmove() - AddPerks() - - DisableRegularWaiting() - StartQuests(QuestsToStart) + ; Added in 1.5.8.0 + + ; adds the new Balancing perks for alchemy potions to the player, this is needed because of the changes with the Lycanthropy + PlayerREF.AddPerk(_00E_FS_Alchemy_BalancingPerk) + PlayerREF.AddPerk(_00E_FS_Alchemy_BalancingPerk_RestorePotions) + + ; Disables regular waiting by adding the no-wait ability + PlayerREF.AddSpell(_00E_AbBlockWaiting, False) + + ; starts all quests that are in the formlist + Int iIndex = QuestsToStart.GetSize() + While iIndex + iIndex -= 1 + Quest kQuest = QuestsToStart.GetAt(iIndex) as Quest + kQuest.Start() + endwhile EndIf @@ -40,7 +52,7 @@ EndEvent Event OnPlayerLoadGame() If self == (PlayerREF as ObjectReference) ; A check just in case. Most likely this condition is always True - CheckIfForgottenStoriesIsLoaded() + _00E_Func_CheckDependencies.CheckDependencies() Maintenance() If GetState() != "RealPlayer" ; Post-1.2.5.0 version update GoToState("RealPlayer") @@ -57,96 +69,6 @@ State RealPlayer EndState -;===================================================================================== -; FUNCTIONS -;===================================================================================== - -Function CheckIfForgottenStoriesIsLoaded() - - ; function that quits back to the main menu when the Enderal - Forgotten Stories.esm is not not being added to the plugins.txt - ; and hence not being loaded in-game. Unknown reason, probably write protection issues - - if (Game.GetFormFromFile(0x0004320E, "Skyrim.esm") as GlobalVariable).GetValueInt() != 1 - Utility.wait(2.0) - Game.QuitToMainMenu() - Debug.MessageBox("Enderal - Forgotten Stories.esm is not loaded! The game will not run properly. Open Data Files and enable it.") - EndIf - - if Debug.GetPlatformName() != "Win64" - return - endif - - Int SKSEVer = SKSE.GetVersion() - - if SKSEVer == 0 - Utility.wait(2.0) - Game.QuitToMainMenu() - Debug.MessageBox("SKSE is not detected! Start Enderal through the launcher or skse64_loader.exe in the game directory.") - Return - endif - - Quest bSkyUI = Game.GetFormFromFile(0x00000802, "SkyUI_SE.esp") as Quest - - If bSkyUI == None - Utility.wait(2.0) - Game.QuitToMainMenu() - Debug.MessageBox("SkyUI_SE.esp is not loaded! The game will not run properly. Open Data Files and enable it.") - Return - EndIf - - if SKSE.GetPluginVersion("fs_skse_functions") == -1 - Utility.wait(2.0) - Game.QuitToMainMenu() - Debug.MessageBox("fs.dll is not loaded! The game will not run properly. Verify integrity of your files.\n\nThis may also happen, if your version of SKSE or Enderal is too old. In this case, it is advised to upgrade.") - Return - endif - - if SKSE.GetPluginVersion("JContainers64") == -1 - Utility.wait(2.0) - Game.QuitToMainMenu() - Debug.MessageBox("JContainers is not loaded! The game will not run properly. Verify integrity of your files or reinstall JContainers.") - Return - endif - - ; fixes properties that were accidentally set to NONE by the "More Affinities" mod - If Game.GetModByName("Enderal_FS_More_Affinities.esp") != 255 - FixMoreAffinitiesMod() - EndIf - -EndFunction - -;===================================================================================== -; 1.5.8.0 -;===================================================================================== - -Function AddPerks() - - ; adds the new Balancing perks for alchemy potions to the player, this is needed because of the changes with the Lycantroph - PlayerREF.AddPerk(_00E_FS_Alchemy_BalancingPerk) - PlayerREF.AddPerk(_00E_FS_Alchemy_BalancingPerk_RestorePotions) - -EndFunction - -Function DisableRegularWaiting() -{Disables regular waiting by adding the no-wait ability} - - PlayerREF.AddSpell(_00E_AbBlockWaiting, False) - -EndFunction - -Function StartQuests(Formlist QuestList) - - ; starts all quests that are in the formlist - Int iIndex = QuestList.GetSize() - While iIndex - iIndex -= 1 - Quest kQuest = QuestList.GetAt(iIndex) as Quest - kQuest.Start() - endwhile - -EndFunction - - ;===================================================================================== ; 2.0.6 ;===================================================================================== @@ -212,7 +134,7 @@ EndFunction ;===================================================================================== -; 2.0.9 +; 2.0.10 ;===================================================================================== Function Update_210() @@ -441,6 +363,11 @@ Function Maintenance() PlayerREF.Dismount() EndIf + ; fixes properties that were accidentally set to NONE by the "More Affinities" mod + If Game.GetModByName("Enderal_FS_More_Affinities.esp") != 255 + FixMoreAffinitiesMod() + EndIf + EndFunction ;===================================================================================== diff --git a/source/scripts/ski_configmenu.psc b/source/scripts/ski_configmenu.psc index 6ba2ea8f..fe54480b 100644 --- a/source/scripts/ski_configmenu.psc +++ b/source/scripts/ski_configmenu.psc @@ -1963,7 +1963,6 @@ function AddEnderalIcons() _categoryIconThemeValues[4] = "skyui\\icons_category_psychosteve.swf" _categoryIconThemeIdx = 0 - SetTextOptionValueST(_categoryIconThemeShortNames[_categoryIconThemeIdx]) SKI_SettingsManagerInstance.ClearOverride("Appearance$icons$category$source") SKI_SettingsManagerInstance.SetOverride("Appearance$icons$category$source", _categoryIconThemeValues[_categoryIconThemeIdx]) endFunction