Jump to content

Question about TackActor


Recommended Posts

Posted

Am I doing this correctly? I have a fertility enhancement spell that boost the chances of conception for the duration of a single sex act. You cast the spell, and then you need to commence intercourse inside 30 seconds or the spell expires. So I need two events: Start and End of sex with one particular actor. So I did this:

;
;       register to get sexlab events for breeder
;
        sexlab.TrackActor(breeder, "Breeding")
        RegisterForModEvent("Breeding_Start", "OnBreedingStart")
        RegisterForModEvent("Breeding_End", "OnBreedingEnd")

and then this:

 

;
; this fires when sex ends.
;
; reset the fertility modifier, then set it to zero
; so we don't get double dipped by OnEffectEnd
;
; After that we can dispel the effect
;
Event OnBreedingEnd(form f, int tid)
        log("baby maker: breeding ends")
        Actor breeder = f as actor
        add_fertility_modifier(breeder, -1 * fertility_mod)
        fertility_mod = 0
        Dispel()
EndEvent

And that works just fine.

 

The only reason I ask is that I was using the spell on one girl, while my overly familiar familiar had his way with another. And the Baby Maker effect stopped when the Wolf finished. Which mean the event fired for a different actor to the one I was tracking.

 

So what am I missing? I thought tracked events only fired for the tracked actor. Is that incorrect? Or does tracking persist beyond the lifetime of the sex act? The end of the spell will clear any ModEvent rgistrations, but if the tracking is still active, then the next time the spell is cast, it'll pick up events from any of the actors previously tracked by the "Breeding" keyword.

 

Yeah, I'll bet that's it. Funny how often explaining the problem leads you to find the solution.

Archived

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

  • Recently Browsing   0 members

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