Jump to content

SL 1.52 and Hooks after animation end


Recommended Posts

Was there some change to these? I'm not really able to hook to threads after the AnimationEnd event anymore with SL 1.52. Now it seems to work about 30% of the time. Previously I think I remember reading something about it being accessible for couple of seconds.

 

My script for the end event looks like this:

Event RapeEnd(String eventName, String argString, float argNum, Form Sender)
    log("RapeEnd()")

    If !SexLab.HookController(argString).HasPlayer
        ; This can happen if one of the attackers has a belt and gets put into her own thread by DDi
        log("Received AnimationEnd on a thread with no player!")
        return
    EndIf
    
    Game.DisablePlayerControls()
    UnregisterForModEvent("AnimationEnd_Helpless")
    
    ContinueScene()
EndEvent

For threads that do involve the player, it seems to mostly lead to this:

 

 

[04/24/2014 - 01:52:53AM] -- SexLab -- NOTICE: Found Animations(22): AP Holding Leg Up, Rough Behind, Rough Doggy Style, Arrok DoggyStyle, Arrok Rape, AP DoggyStyle, Reverse Cowgirl, Arrok Reverse Cowgirl, Arrok Anal, AP Anal, AP Face Down Anal, Arrok Blowjob, Arrok 69, AP Blowjob, AP Kneeling Blowjob, AP Standing Blowjob, AP Skull Fuck, Boobjob, Arrok Boobjob, AP Boobjob, Arrok Standing Foreplay, Bleagh FootJob,
[04/24/2014 - 01:52:53AM] -- SexLab -- Thread[0] - Thread[0]: Entering Making State
[04/24/2014 - 01:52:53AM] [Zad]: OnContainerChanged()
[04/24/2014 - 01:52:53AM] [Zad]: OnContainerChanged()
[04/24/2014 - 01:52:54AM] [Zad]: OnContainerChanged()
[04/24/2014 - 01:52:54AM] [Zad]: OnContainerChanged()
[04/24/2014 - 01:52:54AM] -- SexLab -- [sslActorAlias <alias ActorAlias004 on quest SexLabThread00 (10061EEF)>]: Slotted 'Aennie'
[04/24/2014 - 01:52:56AM] -- SexLab -- [sslActorAlias <alias ActorAlias003 on quest SexLabThread00 (10061EEF)>]: Slotted 'Bandit Archer'
[04/24/2014 - 01:52:57AM] -- SexLab -- Thread[0] - Adjustment Profile: ArrokBoobjob.Adjust.NordRaceF.RedguardRaceM
[04/24/2014 - 01:53:01AM] -- SexLab -- Thread[0] - Event Hook: AnimationStart
[04/24/2014 - 01:53:01AM] GagSFX: OnAnimationStart()
[04/24/2014 - 01:53:01AM] [Zad]: OnAnimationStart()
[04/24/2014 - 01:53:01AM] GagSFX: Hooked Controller arg:0 controller is [sslThreadController <SexLabThread00 (10061EEF)>]
[04/24/2014 - 01:53:01AM] GagSFX: actors involved are:
[04/24/2014 - 01:53:01AM] GagSFX:  - Aennie [Actor < (00000014)>] Sex is 1
[04/24/2014 - 01:53:01AM] GagSFX: voice left untouched
[04/24/2014 - 01:53:01AM] GagSFX:  -  [Actor < (FF000906)>] Sex is 0
[04/24/2014 - 01:53:01AM] GagSFX: voice left untouched
[04/24/2014 - 01:53:01AM] GagSFX: end
[04/24/2014 - 01:53:01AM] [Zad]: Original animation (Arrok Boobjob) does not conflict. Done.
[04/24/2014 - 01:53:02AM] -- SexLab -- Thread[0] - Event Hook: StageStart
[04/24/2014 - 01:53:02AM] -- SexLab -- Thread[0] - Advancing: Starting Stage: 1
[04/24/2014 - 01:53:02AM] [slainternalscr <sla_Internal (14083137)>]: Bandit Marauder Warrior got 2 exposure for  watching sex of Aennie
[04/24/2014 - 01:53:22AM] -- SexLab -- Thread[0] - Event Hook: StageEnd
[04/24/2014 - 01:53:22AM] -- SexLab -- Thread[0] - Event Hook: StageStart
[04/24/2014 - 01:53:22AM] -- SexLab -- Thread[0] - Advancing: Starting Stage: 2
[04/24/2014 - 01:53:32AM] [Regulations v1.7c]: BeltGuard loader DoEquip()
[04/24/2014 - 01:53:37AM] -- SexLab -- Thread[0] - Event Hook: StageEnd
[04/24/2014 - 01:53:38AM] -- SexLab -- Thread[0] - Event Hook: StageStart
[04/24/2014 - 01:53:38AM] -- SexLab -- Thread[0] - Advancing: Starting Stage: 3
[04/24/2014 - 01:53:48AM] -- SexLab -- Thread[0] - Event Hook: StageEnd
[04/24/2014 - 01:53:49AM] -- SexLab -- Thread[0] - Event Hook: OrgasmStart
[04/24/2014 - 01:53:49AM] -- SexLab -- Thread[0] - Advancing: Starting Stage: 4
[04/24/2014 - 01:53:49AM] [Zad]: OnOrgasmStart()
[04/24/2014 - 01:53:49AM] [Zad]: Locked arousal for actor Aennie
[04/24/2014 - 01:53:52AM] xpoCrimeScanner: (Scanning) OnUpdate
[04/24/2014 - 01:53:53AM] -- SexLab -- Thread[0] - Event Hook: OrgasmEnd
[04/24/2014 - 01:53:53AM] [slainternalscr <sla_Internal (14083137)>]: Aennie got 0 exposure for being rape victim
[04/24/2014 - 01:53:54AM] [slamainscr <sla_Main (14042D62)>]: Aennie can not have orgasm
[04/24/2014 - 01:53:54AM] [slainternalscr <sla_Internal (14083137)>]: Bandit Archer had orgasm date updated
[04/24/2014 - 01:53:54AM] -- SexLab -- Thread[0] - AliasEvent: Reset
[04/24/2014 - 01:53:54AM] [slainternalscr <sla_Internal (14083137)>]: Bandit Archer got -42 exposure for having orgasm
[04/24/2014 - 01:53:54AM] [slainternalscr <sla_Internal (14083137)>]: Ema got 12 exposure for  seeing naked Aennie
[04/24/2014 - 01:53:55AM] [slainternalscr <sla_Internal (14083137)>]: Frost got 2 exposure for  seeing naked Aennie
[04/24/2014 - 01:53:55AM] -- SexLab -- Thread[0] - Event Hook: AnimationEnd
[04/24/2014 - 01:53:55AM] [Helpless]: RapeEnd()
[04/24/2014 - 01:53:55AM] [Helpless]: Received AnimationEnd on a thread with no player!

 

 

 

With Aennie being the PC here.

 

Link to comment

By the time AnimationEnd is sent, the actors may or may not have been cleared from the thread, depending on script lag, so sometimes by the time your calling HookController().HasPlayer, the player has already been removed from the thread.

Alternatively, if you're okay with make it 1.52 dependent, you can hook onto the new style hooks which are same as the old hooks only prefixed with "Hook" (HookAnimationEnd instead of AnimationEnd) and they get sent 2 arguments, thread number and a has player bool, like this:
 

RegisterForModEvent("HookAnimationEnd_Helpless", "RapeEnd")

; // ...

Event RapeEnd(int threadID, bool HasPlayer)
    log("RapeEnd()")

    If !HasPlayer
        ; This can happen if one of the attackers has a belt and gets put into her own thread by DDi
        log("Received HookAnimationEnd on a thread with no player!")
        return
    EndIf
    
    Game.DisablePlayerControls()
    UnregisterForModEvent("HookAnimationEnd_Helpless")
    
    ContinueScene()
EndEvent

Or if you want to avoid 1.52 dependency, you could hook an earlier event such as AnimationStart, and do something like this

RegisterForModEvent("AnimationStart_Helpless", "RapeStart")
RegisterForModEvent("AnimationEnd_Helpless", "RapeEnd")

; // ...

string HasPlayerArg

Event RapeStart(String eventName, String argString, float argNum, Form Sender)
	if SexLab.HookController(argString).HasPlayer
		HasPlayerArg = argString
		UnregisterForModEvent("AnimationStart_Helpless")
	endIf
endEvent

Event RapeEnd(String eventName, String argString, float argNum, Form Sender)
    log("RapeEnd()")

    If !HasPlayerArg == argString
        ; This can happen if one of the attackers has a belt and gets put into her own thread by DDi
        log("Received AnimationEnd on a thread with no player!")
        return
    EndIf
    
    Game.DisablePlayerControls()
    UnregisterForModEvent("AnimationEnd_Helpless")
    
    ContinueScene()
EndEvent

Or this

RegisterForModEvent("AnimationStart_Helpless", "RapeStart")

; // ...

Event RapeStart(String eventName, String argString, float argNum, Form Sender)
	sslThreadController Thread = SexLab.HookController(argString)
	if Thread.HasPlayer
		Thread.AddHook("PlayerHelpless")
		RegisterForModEvent("AnimationEnd_PlayerHelpless", "PlayerRapeEnd")
		UnregisterForModEvent("AnimationStart_Helpless")
	endIf
endEvent

Event PlayerRapeEnd(String eventName, String argString, float argNum, Form Sender)
    log("PlayerRapeEnd()")

    Game.DisablePlayerControls()
    UnregisterForModEvent("AnimationEnd_PlayerHelpless")
    
    ContinueScene()
EndEvent

Link to comment

Archived

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

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use