Jump to content

Sex as quest objective?


shebop

Recommended Posts

I cannot get this to work. I cannot get an event callback to occur at all after sex is finished.  I have tried setting it up multiple ways.

 

Here is code from my quest script:

Scriptname DibellaPriestessQScript extends Quest  

SexLabFramework Property SexLab  Auto  

event OnInit()
    ; // Register globally onto AnimationEnd, with our callback QuestAdvanceCheck whenever the script is first initialized
    Debug.Notification("OnInit Run!")
    RegisterForModEvent("AnimationEnd", "QuestAdvanceCheck")
endEvent

event QuestAdvanceCheck(string eventName, string argString, float argNum, form sender)
   Debug.Notification("Event Triggered!")
    ; // Use the HookController() function to get thread controller that triggered this event
    sslThreadController controller = SexLab.HookController(argString)
    ; // Only show our satiation message if player was involved
    if controller.HasPlayer
       Debug.Notification("Player Finished!")
       if (actiontracker.GetValueInt() == 1)
		Debug.Notification("Correct Value!")
		actiontracker.SetValueInt(0)
		SetStage(40)
	endIf	
    endIf
endEvent
GlobalVariable Property actiontracker  Auto  

OnInit does not run (possibly because the quest has already started and I would need to start my game over).  So I also put the code to setup the callback in the snippet that triggers the scene:

actor[] SexActors = new actor[2]
SexActors[0] = akSpeaker
SexActors[1] = PlayerRef
sslBaseAnimation[] anims = SexLab.GetAnimationsByTag(2, "Lesbian" )
Debug.Notification("Registering AnimationEnd as QuestAdvanceCheck")
RegisterForModEvent("AnimationEnd", "QuestAdvanceCheck")
actiontracker.SetValueInt(1)
SexLab.StartSex(SexActors, anims)

So either way the "Event Triggered!" message should come up when the scene is finished.  It doesn't happen.  What am I missing?

Link to comment

If you start sex with dialog you could possibly registerformodevent in script fragments. With function for example.

 

 

 

Function nextStage()
    ; // Register globally onto AnimationEnd, with our callback QuestAdvanceCheck whenever the script is first initialized
    Debug.Notification("OnInit Run!")
    RegisterForModEvent("AnimationEnd", "QuestAdvanceCheck")
endFunction

 

Then call it from fragement with:

 

(GetOwningQuest() as nameOfYourQuestScript).nextStage()

 

 

 

Keep in mind that i've only fiddled very little with CK so i'm sure there is many, far better methods.

 

Edit: Actually you can probably just use RegisterForModEvent directly within fragments which would be far simpler.

Link to comment

If you start sex with dialog you could possibly registerformodevent in script fragments. With function for example.

 

 

 

Edit: Actually you can probably just use RegisterForModEvent directly within fragments which would be far simpler.

 

Actually... that is exactly what I did in my second code piece and it didn't work.  That code fragment is executed after a piece of dialog.  The dialog appropriately executes the scene but the event is not executed when the scene is over.

 

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