OnPlayerLoadGame - Actor

From the Fallout4 CreationKit Wiki
Revision as of 12:05, 2 December 2018 by imported>Qazaaq (The notes about the 1.5 patch and remote event declaration are inaccurate.)
Jump to navigation Jump to search
This article has been flagged as inaccurate.
Please help improve the wiki by learning how to contribute.

Member of: Actor Script

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

Syntax

Event OnPlayerLoadGame()

After Patch 1.5:

Event Actor.OnPlayerLoadGame(actor aSender)

Parameters

  • aSender: The actor sending the event.

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

After Patch 1.5:

;This event is on a quest (like HC_ManagerScript)
Event Actor.OnPlayerLoadGame(actor aSender)
  Debug.Trace("player loaded a save, do some fancy stuff")
	if false == Game.GetPlayer().HasPerk(myCoolPerk) ; Let's check to see if the player has the cool new perk.
		Game.GetPlayer().AddPerk(myCoolPerk) ; If they don't, then add it.
		Debug.Trace("Player now has" +myCoolPerk)
	endif
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.
  • After Patch 1.5, event is also handled via quest.
  • This event will fire for the first time on the next load.

See Also