2024-01-11 12:14:18 +00:00
Scriptname _00E_EngineBugfixAlias extends ReferenceAlias Hidden
int function _GetScriptVersion() Global
return 1
endFunction
Event OnInit()
2024-03-01 12:32:00 +00:00
Utility.Wait(0.05)
2024-01-11 12:14:18 +00:00
_ClearStuckHelpMessages()
EndEvent
2023-10-27 22:36:54 +00:00
Event OnPlayerLoadGame()
Actor PlayerREF = GetReference() as Actor
; Perks modifying armor weights need some push on each game load to work.
; The push is needed only if the player is over-encumbered on game load.
; If the player is not over-encumbered, the push is not needed because checking the inventory, picking up items, sheathing/drawing a weapon will reset the perks anyway.
If PlayerREF.IsOverEncumbered()
_ResetPerk(PlayerREF, _00E_Class_Keeper_P05_C_Conditioning)
_ResetPerk(PlayerREF, _00E_Class_Vagrant_P05_B_Lightweight)
EndIf
2024-03-01 12:32:00 +00:00
; ResetHelpMessage crashes the game when called in menu mode, for instance, when loading a savegame fails due to missing mods
Utility.Wait(0.05)
; If a help message is visible during game reload, it gets stuck on screen
; This workaround shows an empty message to forcefully clear the queue
_ClearStuckHelpMessages()
2023-10-27 22:36:54 +00:00
2024-01-11 12:14:18 +00:00
; Workaround for broken physics on loading saves, made on a mount
If PlayerREF.IsOnMount()
PlayerREF.Dismount()
EndIf
2023-10-27 22:36:54 +00:00
EndEvent
Function _ResetPerk(Actor PlayerREF, Perk p)
If PlayerREF.HasPerk(p)
PlayerREF.RemovePerk(p)
PlayerREF.AddPerk(p)
EndIf
EndFunction
2024-01-11 12:14:18 +00:00
Event _ClearStuckHelpMessages()
2024-03-01 12:32:00 +00:00
if EnderalFunctions.GetNewGameCount() > 1
Message.ResetHelpMessage("Empty")
_00E_EmptyMessage.ShowAsHelpMessage("Empty", 0.1, 10, 1)
endif
2024-01-11 12:14:18 +00:00
EndEvent
2023-10-27 22:36:54 +00:00
Perk Property _00E_Class_Keeper_P05_C_Conditioning Auto
Perk Property _00E_Class_Vagrant_P05_B_Lightweight Auto
2024-01-11 12:14:18 +00:00
Message Property _00E_EmptyMessage Auto