Jump to content

Help registering for SL events from a mod


Recommended Posts

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

Link to comment
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.
 

Link to comment
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.

Link to comment

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.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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