Jump to content

Fire a script on game start or first save loaded?


Hackfield

Recommended Posts

OnPlayerLoadGame fires the first time a save is loaded, but it happens the next time a save is loaded after the event is registered, so if you want it to happen the first time that you load the mod then you just need to do whatever you do in this event in the event where you register for it.

For example, in a quest that starts enabled, you could use a script like that:

Scriptname MyOnPlayerLoadGameQuestScript extends Quest

Function WhateverYouDoOnPlayerLoadGame()
    ;Code here
EndFunction

Event OnQuestInit()
    WhateverYouDoOnPlayerLoadGame()
    RegisterForRemoteEvent(Game.GetPlayer(), "OnPlayerLoadGame")
EndEvent



Event Actor.OnPlayerLoadGame(Actor akSender)
    WhateverYouDoOnPlayerLoadGame()
EndEvent
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...