OnPlayerLoadGame - Actor

Revision as of 06:08, 30 August 2018 by imported>0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 (added additional syntax and edited example from HC_ManagerScript - original text written prior to Survival Mode implementation?)

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.

See Also