shebop Posted April 28, 2015 Posted April 28, 2015 How would I detected that sex is over to advance a quest when it is finished?
Tepi Posted April 28, 2015 Posted April 28, 2015 Probably with hooks. http://git.loverslab.com/sexlab/framework/wikis/guide-hooks Make your own animationevent which, when triggered, advances the quest. Maybe?
shebop Posted April 29, 2015 Author Posted April 29, 2015 Ok thanks. I had looked at that before. None of the built in functions are useful but registering for a callback once the animation is done is helpful.
shebop Posted May 1, 2015 Author Posted May 1, 2015 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?
Tepi Posted May 1, 2015 Posted May 1, 2015 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.
shebop Posted May 2, 2015 Author Posted May 2, 2015 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.