Skip to content

Instantly share code, notes, and snippets.

@requinix
Created April 13, 2017 07:34
Show Gist options
  • Save requinix/863c189235fe7fa24e10e80c18653269 to your computer and use it in GitHub Desktop.
Save requinix/863c189235fe7fa24e10e80c18653269 to your computer and use it in GitHub Desktop.
Skyrim: OnInit and OnGameReload sequence
Installation (first time running):
0. Quest variables and papyrus state set; SEQs are started and running
1. OnInit #1 - all quests whether they are SEQ or not
2. OnInit #2 - SEQs that are not run-once
Load Game (not first time running):
0. Quest variables, papyrus state, and running state restored
1. OnGameReload - quests that were running at time of save
Start (in-game):
1. OnInit #2 - quests that are not run-once
* SEQ = start-game enabled quest
* OnGameReload requires SkyUI's SKI_PlayerLoadGameAlias script; or use Player's OnPlayerLoadGame event
@requinix
Copy link
Author

Tip: Avoid needing an SEQ file and detect first OnInit vs. quest start OnInit by making the quest not SEQ and not Run Once and using

event OnInit()
    if IsRunning()
        ; quest starting
    else
        ; form first oninit - initialize and then
        Start()
    endif
endevent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment