Interface IGameEvents
- Namespace
- SkyrimForge
- Assembly
- SkyrimForge.dll
The game events the framework exposes to plugins.
public interface IGameEvents
Remarks
A handler runs on the thread that raises its event, before the code that raised it continues. The game's thread runs Start() and raises OnFrame, the SKSE events from OnPostLoad to OnSaveDeleted other than OnDataLoaded, which arrives on another thread, and most events of menus, the crosshair, sleeping, waiting, crafting, and loading cells. Keyboard events arrive mostly on worker threads, and mouse events mostly on the game's thread. The game runs scripts, AI, animation, combat, and quests on worker threads while the game's thread waits for them, and raises most of its other events there. Handlers on different worker threads run at the same time. A handler there that changes the game or calls a member documented as called on the game's thread first awaits WaitForGameThreadAsync(IUtility, CancellationToken) or queues that work through ITaskQueue.
A cell loading raises some events on a thread of its own while the game's thread runs, and a handler there does the same.
Properties
OnAction
Raised on SKSE's ActionEvent.
IGameEvent<ActionEventArgs> OnAction { get; }
Property Value
OnActivate
Raised on the game's TESActivateEvent.
IGameEvent<ActivateEventArgs> OnActivate { get; }
Property Value
OnActiveEffectApplyRemove
Raised on the game's TESActiveEffectApplyRemoveEvent.
IGameEvent<ActiveEffectApplyRemoveEventArgs> OnActiveEffectApplyRemove { get; }
Property Value
OnActorCell
Raised on the game's BGSActorCellEvent.
IGameEvent<ActorCellEventArgs> OnActorCell { get; }
Property Value
Remarks
The game raises it as the player enters or leaves a cell, and for no other actor.
OnActorDeath
Raised on the game's BGSActorDeathEvent.
IGameEvent<ActorDeathEventArgs> OnActorDeath { get; }
Property Value
Remarks
The game raises it as the player dies, and for no other actor. OnDeath is raised for every actor.
OnActorKill
Raised on the game's ActorKill::Event.
IGameEvent<ActorKillEventArgs> OnActorKill { get; }
Property Value
OnActorLocationChange
Raised on the game's TESActorLocationChangeEvent.
IGameEvent<ActorLocationChangeEventArgs> OnActorLocationChange { get; }
Property Value
OnBookRead
Raised on the game's TESBookReadEvent.
IGameEvent<BookReadEventArgs> OnBookRead { get; }
Property Value
OnBooksRead
Raised on the game's BooksRead::Event.
IGameEvent<BooksReadEventArgs> OnBooksRead { get; }
Property Value
OnCamera
Raised on SKSE's CameraEvent.
IGameEvent<CameraEventArgs> OnCamera { get; }
Property Value
OnCellAttachDetach
Raised on the game's TESCellAttachDetachEvent.
IGameEvent<CellAttachDetachEventArgs> OnCellAttachDetach { get; }
Property Value
OnCellFullyLoaded
Raised on the game's TESCellFullyLoadedEvent.
IGameEvent<CellFullyLoadedEventArgs> OnCellFullyLoaded { get; }
Property Value
OnCellReadyToApplyDecals
Raised on the game's TESCellReadyToApplyDecalsEvent.
IGameEvent<CellReadyToApplyDecalsEventArgs> OnCellReadyToApplyDecals { get; }
Property Value
OnChestsLooted
Raised on the game's ChestsLooted::Event.
IGameEvent<ChestsLootedEventArgs> OnChestsLooted { get; }
Property Value
OnCombat
Raised on the game's TESCombatEvent.
IGameEvent<CombatEventArgs> OnCombat { get; }
Property Value
Remarks
The state that ends a fight arrives with the target cleared, so an actor fighting the player should be recorded during the fight.
OnContainerChanged
Raised on the game's TESContainerChangedEvent.
IGameEvent<ContainerChangedEventArgs> OnContainerChanged { get; }
Property Value
OnCriticalHit
Raised on the game's CriticalHit::Event.
IGameEvent<CriticalHitEventArgs> OnCriticalHit { get; }
Property Value
OnCrosshairRef
Raised on SKSE's CrosshairRefEvent.
IGameEvent<CrosshairRefEventArgs> OnCrosshairRef { get; }
Property Value
OnDataLoaded
Raised once the game has loaded its data files.
IGameEvent<DataLoadedEventArgs> OnDataLoaded { get; }
Property Value
Remarks
A form can first be looked up by editor ID here, and the arrays TESDataHandler exposes are populated by now. Neither is available earlier.
It is raised once for the run of the process. The save events repeat. A plugin's Start() runs while SKSE is still loading plugins, before this,
so a handler subscribed there receives it.
Menu, input, and SKSE events can arrive before this. The loading screen shown at startup raises OnMenuOpenClose after OnInputLoaded.
The game's events about forms and references, OnInitScript among them, are raised only once the data has loaded.
OnDeath
Raised on the game's TESDeathEvent.
IGameEvent<DeathEventArgs> OnDeath { get; }
Property Value
OnDestructionStageChanged
Raised on the game's TESDestructionStageChangedEvent.
IGameEvent<DestructionStageChangedEventArgs> OnDestructionStageChanged { get; }
Property Value
OnDisarmed
Raised on the game's DisarmedEvent::Event.
IGameEvent<DisarmedEventArgs> OnDisarmed { get; }
Property Value
OnDragonSoulsGained
Raised on the game's DragonSoulsGained::Event.
IGameEvent<DragonSoulsGainedEventArgs> OnDragonSoulsGained { get; }
Property Value
OnEnterBleedout
Raised on the game's TESEnterBleedoutEvent.
IGameEvent<EnterBleedoutEventArgs> OnEnterBleedout { get; }
Property Value
OnEquip
Raised on the game's TESEquipEvent.
IGameEvent<EquipEventArgs> OnEquip { get; }
Property Value
OnEventProcessed
Raised on the game's BGSEventProcessedEvent.
IGameEvent<EventProcessedEventArgs> OnEventProcessed { get; }
Property Value
OnFormDelete
Raised on the game's TESFormDeleteEvent.
IGameEvent<FormDeleteEventArgs> OnFormDelete { get; }
Property Value
OnFrame
Raised once per frame, from the game's startup onward.
IGameEvent<FrameEventArgs> OnFrame { get; }
Property Value
Remarks
The event is raised at most once a millisecond. The main menu raised it about 1000 times a second.
The game is not fully initialized on early frames. The player exists from around the main menu as the default character in no cell,
so a handler that needs the save's player in the world waits for Is3DLoaded.
OnFurniture
Raised on the game's TESFurnitureEvent.
IGameEvent<FurnitureEventArgs> OnFurniture { get; }
Property Value
OnGrabRelease
Raised on the game's TESGrabReleaseEvent.
IGameEvent<GrabReleaseEventArgs> OnGrabRelease { get; }
Property Value
OnHit
Raised on the game's TESHitEvent.
IGameEvent<HitEventArgs> OnHit { get; }
Property Value
OnInitScript
Raised on the game's TESInitScriptEvent.
IGameEvent<InitScriptEventArgs> OnInitScript { get; }
Property Value
OnInput
Raised on the game's InputEvent.
IGameEvent<InputEventArgs> OnInput { get; }
Property Value
OnInputLoaded
Raised once the game has loaded its input.
IGameEvent<InputLoadedEventArgs> OnInputLoaded { get; }
Property Value
Remarks
This arrives before OnDataLoaded, read from a run rather than declared by SKSE, whose header states no order between them. On Skyrim VR, this is the first event raised.
OnInventory
Raised on the game's Inventory::Event.
IGameEvent<InventoryEventArgs> OnInventory { get; }
Property Value
OnItemCrafted
Raised on the game's ItemCrafted::Event.
IGameEvent<ItemCraftedEventArgs> OnItemCrafted { get; }
Property Value
OnItemHarvested
Raised on the game's TESHarvestedEvent::ItemHarvested.
IGameEvent<ItemHarvestedEventArgs> OnItemHarvested { get; }
Property Value
OnItemsPickpocketed
Raised on the game's ItemsPickpocketed::Event.
IGameEvent<ItemsPickpocketedEventArgs> OnItemsPickpocketed { get; }
Property Value
OnLevelIncrease
Raised on the game's LevelIncrease::Event.
IGameEvent<LevelIncreaseEventArgs> OnLevelIncrease { get; }
Property Value
OnLoadGame
Raised on the game's TESLoadGameEvent.
IGameEvent<LoadGameEventArgs> OnLoadGame { get; }
Property Value
Remarks
OnSaveLoaded is raised before this for the same load.
OnLocationCleared
Raised on the game's LocationCleared::Event.
IGameEvent<LocationClearedEventArgs> OnLocationCleared { get; }
Property Value
OnLocationDiscovery
Raised on the game's LocationDiscovery::Event.
IGameEvent<LocationDiscoveryEventArgs> OnLocationDiscovery { get; }
Property Value
OnLockChanged
Raised on the game's TESLockChangedEvent.
IGameEvent<LockChangedEventArgs> OnLockChanged { get; }
Property Value
OnMagicEffectApply
Raised on the game's TESMagicEffectApplyEvent.
IGameEvent<MagicEffectApplyEventArgs> OnMagicEffectApply { get; }
Property Value
OnMagicWardHit
Raised on the game's TESMagicWardHitEvent.
IGameEvent<MagicWardHitEventArgs> OnMagicWardHit { get; }
Property Value
OnMenuModeChange
Raised on the game's MenuModeChangeEvent.
IGameEvent<MenuModeChangeEventArgs> OnMenuModeChange { get; }
Property Value
OnMenuOpenClose
Raised on the game's MenuOpenCloseEvent.
IGameEvent<MenuOpenCloseEventArgs> OnMenuOpenClose { get; }
Property Value
OnModCallback
Raised on SKSE's ModCallbackEvent.
IGameEvent<ModCallbackEventArgs> OnModCallback { get; }
Property Value
OnMoveAttachDetach
Raised on the game's TESMoveAttachDetachEvent.
IGameEvent<MoveAttachDetachEventArgs> OnMoveAttachDetach { get; }
Property Value
OnNewGame
Raised once a new character has been made, before the game has loaded them.
IGameEvent<NewGameEventArgs> OnNewGame { get; }
Property Value
Remarks
SKSE reports this, not the game. The game's own load event reports a save being read, and a new game reads none, so this is the only place to set up what a plugin stores per character.
OnNewGameOrSaveLoading
Raised as a new game starts or a save starts loading, before OnNewGame or OnSaveLoading.
IGameEvent<NewGameOrSaveLoadingEventArgs> OnNewGameOrSaveLoading { get; }
Property Value
Remarks
NewGameOrSaveLoading is canceled on this event.
OnNiNodeUpdate
Raised on SKSE's NiNodeUpdateEvent.
IGameEvent<NiNodeUpdateEventArgs> OnNiNodeUpdate { get; }
Property Value
OnObjectLoaded
Raised on the game's TESObjectLoadedEvent.
IGameEvent<ObjectLoadedEventArgs> OnObjectLoaded { get; }
Property Value
OnObjectREFRTranslation
Raised on the game's TESObjectREFRTranslationEvent.
IGameEvent<ObjectREFRTranslationEventArgs> OnObjectREFRTranslation { get; }
Property Value
OnObjectiveState
Raised on the game's ObjectiveState::Event.
IGameEvent<ObjectiveStateEventArgs> OnObjectiveState { get; }
Property Value
OnOpenClose
Raised on the game's TESOpenCloseEvent.
IGameEvent<OpenCloseEventArgs> OnOpenClose { get; }
Property Value
OnPackage
Raised on the game's TESPackageEvent.
IGameEvent<PackageEventArgs> OnPackage { get; }
Property Value
OnPapyrusLog
Raised on the game's LogEvent.
IGameEvent<PapyrusLogEventArgs> OnPapyrusLog { get; }
Property Value
OnPapyrusStats
Raised on the game's StatsEvent.
IGameEvent<PapyrusStatsEventArgs> OnPapyrusStats { get; }
Property Value
OnPerkEntryRun
Raised on the game's TESPerkEntryRunEvent.
IGameEvent<PerkEntryRunEventArgs> OnPerkEntryRun { get; }
Property Value
OnPlayerBowShot
Raised on the game's TESPlayerBowShotEvent.
IGameEvent<PlayerBowShotEventArgs> OnPlayerBowShot { get; }
Property Value
OnPositionPlayer
Raised on the game's PositionPlayerEvent.
IGameEvent<PositionPlayerEventArgs> OnPositionPlayer { get; }
Property Value
OnPostLoad
Raised once every SKSE plugin has been loaded. Never raised on Skyrim VR, whose first event is OnInputLoaded.
IGameEvent<PostLoadEventArgs> OnPostLoad { get; }
Property Value
Remarks
Start() runs while SKSE is still loading plugins. By this event every plugin library is in the process, so a module-handle lookup here determines whether a given plugin loaded.
OnPostPostLoad
Raised once every SKSE plugin has received OnPostLoad. Never raised on Skyrim VR, whose first event is OnInputLoaded.
IGameEvent<PostPostLoadEventArgs> OnPostPostLoad { get; }
Property Value
Remarks
Work that depends on what other plugins did during OnPostLoad belongs here.
OnQuestInit
Raised on the game's TESQuestInitEvent.
IGameEvent<QuestInitEventArgs> OnQuestInit { get; }
Property Value
OnQuestStage
Raised on the game's TESQuestStageEvent.
IGameEvent<QuestStageEventArgs> OnQuestStage { get; }
Property Value
OnQuestStageItemDone
Raised on the game's TESQuestStageItemDoneEvent.
IGameEvent<QuestStageItemDoneEventArgs> OnQuestStageItemDone { get; }
Property Value
OnQuestStartStop
Raised on the game's TESQuestStartStopEvent.
IGameEvent<QuestStartStopEventArgs> OnQuestStartStop { get; }
Property Value
OnQuestStatus
Raised on the game's QuestStatus::Event.
IGameEvent<QuestStatusEventArgs> OnQuestStatus { get; }
Property Value
OnReset
Raised on the game's TESResetEvent.
IGameEvent<ResetEventArgs> OnReset { get; }
Property Value
OnResolveNPCTemplates
Raised on the game's TESResolveNPCTemplatesEvent.
IGameEvent<ResolveNPCTemplatesEventArgs> OnResolveNPCTemplates { get; }
Property Value
OnSaveDeleted
Raised as a save file is deleted, naming it.
IGameEvent<SaveEventArgs> OnSaveDeleted { get; }
Property Value
Remarks
The state a plugin stored in that save's co-save is deleted with it. A plugin that also stored state elsewhere under the same save should delete that itself, on this event.
OnSaveLoaded
Raised once the game has finished reading a save file. A plugin looks up again what it released on OnSaveLoading.
IGameEvent<SaveLoadedEventArgs> OnSaveLoaded { get; }
Property Value
Remarks
OnLoadGame, the game's own event, is raised after this for the same load.
OnSaveLoading
Raised before the game reads a save file, while the world loaded before it is still in memory, so views into it are still valid.
IGameEvent<SaveEventArgs> OnSaveLoading { get; }
Property Value
Remarks
Release every view on this event. A view is a pointer into the game's memory, and loading rebuilds that memory. A view retained across a load points at whatever occupies that address afterward, which is a different object or nothing at all, and reading through it returns plausible values rather than failing. A form ID is a number and survives, to be looked up again on the other side.
OnSaveWriting
Raised as the game begins writing a save file, naming it.
IGameEvent<SaveEventArgs> OnSaveWriting { get; }
Property Value
Remarks
State a plugin writes to the co-save needs nothing here, IPerPluginSavedState writing it as part of the save itself. This is for state a plugin stores elsewhere under the same save. OnSaveDeleted is the other half of that pair.
A run showed this arriving before the co-save and before the save file, both still being written when the handler ran, so neither can be read from here. The name came without the extension a read includes. Whether a name always comes is not stated in SKSE's header, so FileName is nullable here as on the other two.
OnScene
Raised on the game's TESSceneEvent.
IGameEvent<SceneEventArgs> OnScene { get; }
Property Value
OnSceneAction
Raised on the game's TESSceneActionEvent.
IGameEvent<SceneActionEventArgs> OnSceneAction { get; }
Property Value
OnScenePhase
Raised on the game's TESScenePhaseEvent.
IGameEvent<ScenePhaseEventArgs> OnScenePhase { get; }
Property Value
OnSell
Raised on the game's TESSellEvent.
IGameEvent<SellEventArgs> OnSell { get; }
Property Value
OnShoutAttack
Raised on the game's ShoutAttack::Event.
IGameEvent<ShoutAttackEventArgs> OnShoutAttack { get; }
Property Value
OnSkillIncrease
Raised on the game's SkillIncrease::Event.
IGameEvent<SkillIncreaseEventArgs> OnSkillIncrease { get; }
Property Value
OnSleepStart
Raised on the game's TESSleepStartEvent.
IGameEvent<SleepStartEventArgs> OnSleepStart { get; }
Property Value
OnSleepStop
Raised on the game's TESSleepStopEvent.
IGameEvent<SleepStopEventArgs> OnSleepStop { get; }
Property Value
OnSoulsTrapped
Raised on the game's SoulsTrapped::Event.
IGameEvent<SoulsTrappedEventArgs> OnSoulsTrapped { get; }
Property Value
OnSpellCast
Raised on the game's TESSpellCastEvent.
IGameEvent<SpellCastEventArgs> OnSpellCast { get; }
Property Value
OnSpellsLearned
Raised on the game's SpellsLearned::Event.
IGameEvent<SpellsLearnedEventArgs> OnSpellsLearned { get; }
Property Value
OnSwitchRaceComplete
Raised on the game's TESSwitchRaceCompleteEvent.
IGameEvent<SwitchRaceCompleteEventArgs> OnSwitchRaceComplete { get; }
Property Value
OnTopicInfo
Raised on the game's TESTopicInfoEvent.
IGameEvent<TopicInfoEventArgs> OnTopicInfo { get; }
Property Value
OnTrackedStats
Raised on the game's TESTrackedStatsEvent.
IGameEvent<TrackedStatsEventArgs> OnTrackedStats { get; }
Property Value
OnTrapHit
Raised on the game's TESTrapHitEvent.
IGameEvent<TrapHitEventArgs> OnTrapHit { get; }
Property Value
OnTrigger
Raised on the game's TESTriggerEvent.
IGameEvent<TriggerEventArgs> OnTrigger { get; }
Property Value
OnTriggerEnter
Raised on the game's TESTriggerEnterEvent.
IGameEvent<TriggerEnterEventArgs> OnTriggerEnter { get; }
Property Value
OnTriggerLeave
Raised on the game's TESTriggerLeaveEvent.
IGameEvent<TriggerLeaveEventArgs> OnTriggerLeave { get; }
Property Value
OnUniqueIDChange
Raised on the game's TESUniqueIDChangeEvent.
IGameEvent<UniqueIDChangeEventArgs> OnUniqueIDChange { get; }
Property Value
OnUserEventEnabled
Raised on the game's UserEventEnabled.
IGameEvent<UserEventEnabledEventArgs> OnUserEventEnabled { get; }
Property Value
OnWaitStart
Raised on the game's TESWaitStartEvent.
IGameEvent<WaitStartEventArgs> OnWaitStart { get; }
Property Value
OnWaitStop
Raised on the game's TESWaitStopEvent.
IGameEvent<WaitStopEventArgs> OnWaitStop { get; }