Jump to content

Help registering for SL events from a mod


Recommended Posts

Posted

Greetings. I want my small mod to listen to sexlab events (on stage start for example), and i do it like that:
 

Scriptname MyMod extends ReferenceAlias

Event OnPlayerLoadGame()
    Debug.Trace("Load")

    ; Should i do it like this?
    RegisterForModEvent("StageStart", "OnStageStart")

    ; Or like this ?
    RegisterForModEvent("MyMod_Start", "OnAnimactionStart")
    ; Somewhere later
    SexLab.TrackActor(akActor, "MyMod")
EndEvent

However, OnPlayerLoadGame seems to be not running at all.

I guess i'm doing something wrong when creating quest and player alias in CreationKit.
 

So here is a dummy quest archive in attachment, which should display debug messages on mod init and on game load.

Could someone check it, or at least point me to a guide without overkills like dialogue triggers, objectives and so on?
 

Also, is there a way to register for mod events from "raw papyrus" without creating quests, aliases and so on?

 

DummyQuest.7z

Posted

OnPlayerLoadGame is called only on scripts attached to ReferenceAliases that are associated with the player.

 

Posted
Quote

OnPlayerLoadGame is called only on scripts attached to ReferenceAliases that are associated with the player.

I've created quest with creation kit, created reference alias there, attached player, and attached that script.
 

Quote

Your .esp file has no dependences. You need to make your mod dependent on Skyrim.esm and SexLab.esm.

Will try it.
 

Posted
Quote

Your .esp file has no dependences. You need to make your mod dependent on Skyrim.esm and SexLab.esm.

Unfortunately that's either not an issue, or not the only issue. Also, this archive includes only debug message, no actual events registration, so SexLab.esm is not needed.

Posted

Actually, if you could just create a working player alias and quest scripts from scracth, it would be super nice, it may be simpler than searching for errors.

Posted
28 minutes ago, zstj said:

Actually, if you could just create a working player alias and quest scripts from scracth, it would be super nice, it may be simpler than searching for errors.

 

This alias should work.

DummyQuest.esp

Posted

Just want to say, you do not need to have dependency to sexlab in order to register for these events. There could be a problem downstream but mod events can be received from mods which you don't have a direct dependency to, this is one of the major benefits of them.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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