Mod:Creation Kit/OnPlayerLoadGame - Actor

Member of: Mod:Creation Kit/Actor Script

Event called when the player loads a save game. This event is only sent to the player actor.

Syntax
Event OnPlayerLoadGame

Parameters
None

Examples
The player is unique in that it is almost always bad practice to modify the Mod:Creation Kit/Actor form directly. This is due to compatibily reasons concerning The Rule of One. There are several techniques to avoid violating this rule.

Example
This example is straight forward but violates The Rule of One because it requires the player Mod:Creation Kit/Actor to be modified. Scriptname Example extends Actor

Event OnPlayerLoadGame Debug.TraceSelf(self, "OnPlayerLoadGame", "The player actor has reloaded the game.") EndEvent

Alternative
A ReferenceAlias or ActiveMagicEffect will receive events from the Mod:Creation Kit/Actor they are attached to.

A quest alias pointed at the player Scriptname Example extends ReferenceAlias

Event OnPlayerLoadGame Debug.TraceSelf(self, "OnPlayerLoadGame", "The player actor has reloaded the game.") EndEvent

A magic effect on the player Scriptname Example extends ActiveMagicEffect

Event OnPlayerLoadGame Debug.TraceSelf(self, "OnPlayerLoadGame", "The player actor has reloaded the game.") EndEvent

Remoting
With Mod:Creation Kit/Remote Papyrus Event Registration, this event may also be handled from any script object. Scriptname Example extends ScriptObject

Event OnInit RegisterForRemoteEvent(Game.GetPlayer, "OnPlayerLoadGame") Debug.TraceSelf(self, "Actor.OnPlayerLoadGame", "This script has initialized and is now listening for the 'OnPlayerLoadGame' event.") EndEvent

Event Actor.OnPlayerLoadGame(Actor akSender) Debug.TraceSelf(self, "Actor.OnPlayerLoadGame", "The player actor has reloaded.") EndEvent