Difference between revisions of "OnPlayerLoadGame - Actor"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>DreamKing
m
imported>JLundin
Line 4: Line 4:
'''Member of:''' [[Actor Script]] ''(Requires 1.6)''
'''Member of:''' [[Actor Script]] ''(Requires 1.6)''


Event that is received when the player loads a saved game. Is not received the very first time a script is loaded, when a mod is first activated; only on subsequent loads. Seems to only be received when actually attached to the player character (e.g., in a script attached to a [[Reference Alias]] set to be filled by the player).
Event called when the player loads a save game. This event is '''only''' sent to the player actor. If this is the first save game load where the event is being listened to, and the event is on an alias, and the alias didn't exist at the time the save was made, then the player won't be in the alias by the time the event is sent, and the alias script will not receive the event. It should then receive later events.


== Syntax ==
== Syntax ==
Line 10: Line 10:
Event OnPlayerLoadGame()
Event OnPlayerLoadGame()
</source>
</source>
== Parameters ==
None.


== Examples ==
== Examples ==
<source lang="papyrus">
<source lang="papyrus">
Scriptname xyzPlayerAliasScript extends ReferenceAlias
; Event is only sent to the player actor. This would probably be on a magic effect or alias script
 
Event OnPlayerLoadGame()
Event OnPlayerLoadGame()
   Debug.Trace("The player has loaded a saved game.")
   Debug.Trace("player loaded a save, do some fancy stuff")
EndEvent
endEvent
</source>
</source>
== Notes ==
This event is only sent to the player actor. It is recommended that you handle this event via an alias the player is forced into, or a magic effect on the player.


== See Also ==
== See Also ==
*[[Actor Script]]
*[[Actor Script]]

Revision as of 09:03, 15 June 2012

Member of: Actor Script (Requires 1.6)

Event called when the player loads a save game. This event is only sent to the player actor. If this is the first save game load where the event is being listened to, and the event is on an alias, and the alias didn't exist at the time the save was made, then the player won't be in the alias by the time the event is sent, and the alias script will not receive the event. It should then receive later events.

Syntax

Event OnPlayerLoadGame()

Parameters

None.

Examples

; Event is only sent to the player actor. This would probably be on a magic effect or alias script
Event OnPlayerLoadGame()
  Debug.Trace("player loaded a save, do some fancy stuff")
endEvent

Notes

This event is only sent to the player actor. It is recommended that you handle this event via an alias the player is forced into, or a magic effect on the player.

See Also