84 lines
2.8 KiB
Plaintext
84 lines
2.8 KiB
Plaintext
Scriptname _00E_PlayerSetUpScript extends ObjectReference
|
|
{Initializes all the necessary Quests, maintains the player, contains various OnPlayerLoadGame() failsafes. This script is important for proper updating, do not overwrite it.}
|
|
|
|
int function _GetScriptVersion() Global
|
|
return 1
|
|
endFunction
|
|
|
|
;=====================================================================================
|
|
; EVENTS
|
|
;=====================================================================================
|
|
|
|
Event OnInit()
|
|
|
|
If self != (PlayerREF as ObjectReference)
|
|
return
|
|
EndIf
|
|
|
|
PlayerREF.SetActorValue("speedMult", 95)
|
|
PlayerREF.SetActorValue("Healrate", 0)
|
|
|
|
; starts all quests that are in the formlist
|
|
Int iIndex = QuestsToStart.GetSize()
|
|
While iIndex > 0
|
|
iIndex -= 1
|
|
Quest kQuest = QuestsToStart.GetAt(iIndex) as Quest
|
|
kQuest.Start()
|
|
endwhile
|
|
|
|
EndEvent
|
|
|
|
Event OnPlayerLoadGame()
|
|
If self == (PlayerREF as ObjectReference) ; A check just in case. Most likely this condition is always True
|
|
Maintenance()
|
|
EndIf
|
|
EndEvent
|
|
|
|
|
|
;=====================================================================================
|
|
; ALL UPDATES
|
|
;=====================================================================================
|
|
|
|
Function SetAutoSaveInterval()
|
|
|
|
; updates the autosave interval
|
|
_00E_AutoSaveSystem_Functions AutoSaveSystem_Functions = Game.GetFormFromFile(0x00048141, "Skyrim.esm") as _00E_AutoSaveSystem_Functions
|
|
AutoSaveSystem_Functions.UpdateAutoSaveInterval()
|
|
|
|
EndFunction
|
|
|
|
|
|
;=====================================================================================
|
|
; MAINTENANCE
|
|
;=====================================================================================
|
|
|
|
Function Maintenance()
|
|
|
|
; changes to the actor value healrate will not persist in consecutive saves
|
|
; every time a save gets loaded the healrate needs to be set to 0, otherwise it will go back again to default at 0.7
|
|
; this is called before active magic effects of potions or spells are applied to the player which could also alter the value
|
|
PlayerREF.SetActorValue("Healrate", 0)
|
|
|
|
; Workaround for broken physics on loading saves, made on a mount
|
|
If PlayerREF.IsOnMount()
|
|
PlayerREF.Dismount()
|
|
EndIf
|
|
|
|
; Clear stuck help messages, leaking between game loads
|
|
Message.ResetHelpMessage("Clear")
|
|
(Game.GetForm(0xAC80E) as Message).ShowAsHelpMessage("Clear", 0.1, 1, 1)
|
|
|
|
SetAutoSaveInterval()
|
|
|
|
SendModEvent("Enderal_GameLoaded")
|
|
|
|
EndFunction
|
|
|
|
;=====================================================================================
|
|
; PROPERTIES
|
|
;=====================================================================================
|
|
|
|
Actor Property PlayerREF Auto
|
|
|
|
FormList Property QuestsToStart Auto
|