Difference between revisions of "OnPlayerLoadGame - Actor"
Jump to navigation
Jump to search
imported>Plplecuyer (Created page with "Category:Scripting Category:Papyrus Category:Events '''Member of:''' Actor Script Event called when the player loads a save game. This event is '''only''' sent t...") |
imported>0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 (added additional syntax and edited example from HC_ManagerScript - original text written prior to Survival Mode implementation?) |
||
Line 9: | Line 9: | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
Event OnPlayerLoadGame() | Event OnPlayerLoadGame() | ||
</source> | |||
After Patch 1.5: | |||
<source lang="papyrus"> | |||
Event Actor.OnPlayerLoadGame(actor aSender) | |||
</source> | </source> | ||
== Parameters == | == Parameters == | ||
*aSender: The actor sending the event. | |||
== Examples == | == Examples == | ||
Line 19: | Line 24: | ||
Event OnPlayerLoadGame() | Event OnPlayerLoadGame() | ||
Debug.Trace("player loaded a save, do some fancy stuff") | Debug.Trace("player loaded a save, do some fancy stuff") | ||
endEvent | |||
</source> | |||
After Patch 1.5: | |||
<source lang="papyrus"> | |||
;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 | endEvent | ||
</source> | </source> | ||
== Notes == | == 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. | *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 == | == See Also == | ||
*[[Actor Script]] | *[[Actor Script]] |
Revision as of 06:08, 30 August 2018
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.