trepleen Posted August 23, 2014 Posted August 23, 2014 How do I get these animations or any other animations to play back to back? anims[0] = SexLab.GetAnimationByName("Arrok Tricycle") anims[1] = SexLab.GetAnimationByName("Arrok Lesbian") This guide shows how to get another animation to play on an existing animations end, however forceanimation doesn't seem to be working anymore. http://git.loverslab.com/sexlab/framework/wikis/guide-hooks Here is a sample of my code, mind you it's being worked on. Scriptname KD_KatreenaDarkmoore_QuestDialogue extends QuestSexLabFramework property SexLab autoActor property KD_KatreenaDarkmoore autoImageSpaceModifier Property KD_Fade_ISM autoint property endingStage autoForm[] removedArmorfunction Stage30_SexScene();Main sex control objectsslThreadModel AnimationObject = SexLab.NewThread();add actors you want to be a part of this sex sceneAnimationObject.AddActor(KD_KatreenaDarkmoore, isVictim = false)AnimationObject.AddActor(Game.GetPlayer(), isVictim = false);array that holds animationssslBaseAnimation[] animsanims = new sslBaseAnimation[1];specify animation we want to use;2 foreplay 3 cunn katreena,playeranims[0] = SexLab.GetAnimationByName("Arrok Tricycle");1 foreplay 2 cunn, 3mutualcunn,4mutualcunn katreena, player;anims[0] = SexLab.GetAnimationByName("Arrok Lesbian");stops any type of foreplay animation before playing teh ones specified;AnimationObject.DisableLeadIn(true);attach the animation you specified from the array to the main sex control objectAnimationObject.SetAnimations(anims);Don't try to auto center on a nearby bedAnimationObject.SetBedding(-1);this makes it so event Start30_SexSceneEnd gets called when each stage reaches its endRegisterForModEvent("StageStart_Stage30SexScene", "Start30_SexScene_StageStart")RegisterForModEvent("StageEnd_Stage30SexScene", "Start30_SexScene_StageEnd")RegisterForModEvent("AnimationStart_Stage30SexScene", "Start30_SexScene_AnimationStart")RegisterForModEvent("AnimationEnd_Stage30SexScene", "Start30_SexScene_AnimationEnd");We call this scene Stage30SexScene which will hook it to the registerformodevent above this line, this is important, make sure names matchAnimationObject.SetHook("Stage30SexScene");What stage do you want arrok anal to begin from? I set it to 1, but you can set it to 2,3 etcAnimationObject.Stage = 3endingStage = 3;Sets the animation in motionAnimationObject.StartThread();black out screen;;;KD_Fade_ISM.Apply()endFunctionevent Start30_SexScene_AnimationStart(string eventName, string argString, float argNum, form sender)endeventevent Start30_SexScene_AnimationEnd(string eventName, string argString, float argNum, form sender);the controller object gives us the control needed to end an animationsslThreadController controller = SexLab.HookController(argString);scene is finished, fade in, remove image space modifier;;;KD_Fade_ISM.Remove()endingStage = 2sslBaseAnimation cowgirl = SexLab.GetAnimationByName("Arrok Lesbian")controller.ForceAnimation(cowgirl)UnregisterForModEvent("Start30_SexScene_AnimationEnd")endeventevent Start30_SexScene_StageStart(string eventName, string argString, float argNum, form sender);the controller object gives us the control needed to end an animationsslThreadController controller = SexLab.HookController(argString);debug.messagebox(controller.stage + " started");if we're on stage 1, do an extra slow fade in for mysterious effectif controller.stage == 1;Begin a slow fade out;;;Game.FadeOutGame(false, true, 12.0, 12.0);get the fade out time to do its thing;;;Utility.Wait(6);remove the image space modifier, this object is responsible for making the screen go black;;;KD_Fade_ISM.Remove()else;since we're on any other stage after 2, just do quick fade outs so user doesn't have to see immersion breaking animation transition;Begin a fade out;;;Game.FadeOutGame(false, true, 4.0, 4.0);get the fade out time to do its thing;;;Utility.Wait(2);remove the image space modifier, this object is responsible for making the screen go black;;;KD_Fade_ISM.Remove()endif;start sex talk scene;KD_SexTalk_Stage30.Start();cleanup I think;UnregisterForModEvent("StageStart_Stage30SexScene")endeventevent Start30_SexScene_StageEnd(string eventName, string argString, float argNum, form sender);the controller object gives us the control needed to end an animationsslThreadController controller = SexLab.HookController(argString);debug.messagebox(controller.stage + " ended");scene is finished, fade out;;;KD_Fade_ISM.Apply();are we on stage 2 or greater?if controller.stage >= endingStage;end animation and return everything back to normal;this is optionalcontroller.endanimation();KD_Fade_ISM.Remove()endif;cleanup I think;UnregisterForModEvent("StageEnd_Stage30SexScene")endeventScene Property KD_SexTalk_Stage30 Auto After a lot of searching via google I found this thread that might help me figure this out: http://www.loverslab.com/topic/34304-help-with-very-simple-sexlab-mod-please/ I think I need to use setforcedanimations & setanimation... I'm too tired now... Hopefully someone will respond by tomorrow. This is the last thing I need to learn how to do to give my mod full functionality so I can just focus on creating content.
Ashal Posted August 23, 2014 Posted August 23, 2014 If by back to back you mean play through a single animation all the way to the end, followed by starting another animation from the start; there is multiple ways to do this. If there is only 2 animations you want to sequence together, during setup of the scene use sslThreadModel.SetLeadInAnimations() to set the first animation, and sslThreadModel.SetAnimations() to set the second animation, passing both functions an array of animations containing only your chosen animation.LeadIn animations natively play before another round of animations, in the MCM these are called Foreplay stage, but they can be used for other purposes such as this as well - however they will be subject to the different timers and strip settings of the foreplay stage, if this is a deal breaker try a different solution, if not this is the simplest and easiest solution. Set a hook for OrgasmStart, in the hook check if it's the animations last stage via Controller.Stage >= Controller.Animation.StageCount, if true, than call this sequence of commands: SetStage(1), SetForcedAnimations(secondAnimationArray), SetAnimation(0), RealignActors()This will switch the scenes animation list over to the second animation's first stage as soon as the final stage of the first animation starts. Final solution: If you are only every going to be using the exact same 2 animations back to back, create a temporary animation object that combines the stages of both animations and just use that in the scene.
trepleen Posted August 23, 2014 Author Posted August 23, 2014 Final solution: If you are only every going to be using the exact same 2 animations back to back, create a temporary animation object that combines the stages of both animations and just use that in the scene. I didn't know we could do this, this is perfect. I can just put together stage pieces from different animations to get exactly what I need .. I'll post my final code here so someone else can use it in the future. For reference I'm using this thread to get this code made: http://www.loverslab.com/topic/18708-sexlab-framework-development/page-85?hl=%20sexlab%20%20framework%20%20development http://git.loverslab.com/oppappa/framework/blob/c72a524645ccd21f80749261d5e970330a1f592b/scripts/Source/sslAnimationDefaults.psc
trepleen Posted August 23, 2014 Author Posted August 23, 2014 Hi, two more questions if that's okay. 1. Is it possible to get a reference to the actors in a sex scene from the controller? 2. Is it normal for the last stagestart,stageend to not fire on the last stage of a custom animation sequence? By custom animation sequence, I refer to the following way of making a new animation: sslBaseAnimation Anim = SexLab.NewAnimationObject("CunnilingusOnlyObject", self) If I add two stages, then the second stages StageStart,StageEnd doesn't fire. I AM STUCK. I cannot get stagestart, stageend, orgasmstart or orgasmend to trigger on the last stage. Here is my code. I'm soooo close to finishing. Scriptname KD_KatreenaDarkmoore_QuestDialogue extends Quest SexLabFramework property SexLab autofunction Sex_Cunnilingus(actor Receiver, actor Giver) ;Main sex control object sslThreadModel AnimationObject = SexLab.NewThread() ;add actors you want to be a part of this sex scene AnimationObject.AddActor(Receiver, isVictim = false) AnimationObject.AddActor(Giver, isVictim = false) ;array that holds animations sslBaseAnimation[] anims = new sslBaseAnimation[1] ;delete it if we already made it Sexlab.ReleaseAnimationObject("CunnilingusOnlyObject") ;create a new animation stage sequence from scratch sslBaseAnimation Anim = SexLab.NewAnimationObject("CunnilingusOnlyObject", self) ;give new animation stage sequence a name Anim.Name = "Cunnilingus Only" ;what type of content is this? 1 for sexual 2 for foreplay Anim.SetContent(1) ;lets add stages from other animations ;0 for male, 1 for female int a1 = Anim.AddPosition(1) ;grabbing animation 1 from arrok lesbian animation 1, stage 2 and then setting the position to 0 Anim.AddPositionStage(a1, "Arrok_Lesbian_A2_S1", -100, silent = false) Anim.AddPositionStage(a1, "Arrok_Lesbian_A1_S2", 0, silent = false) Anim.AddPositionStage(a1, "Arrok_Tricycle_A1_S3", 0, silent = false) ;0 for male, 1 for female int a2 = Anim.AddPosition(0) ;grabbing animation 2 from arrok lesbian animation 2, stage 2 and then setting the position to -100, since busy with mouth make silent, keep mouth open since giving Anim.AddPositionStage(a2, "Arrok_Lesbian_A1_S1", 0, silent = true, openMouth = false) Anim.AddPositionStage(a2, "Arrok_Lesbian_A2_S2", -100, silent = true, openMouth = true) Anim.AddPositionStage(a2, "Arrok_Tricycle_A2_S3", -100.5, silent = true, openMouth = true) ;this is a sexual animation so I added the tag sexual Anim.AddTag("Sexual") ;save our new customized stage sequence Anim.Save() ;specify animation we want to use ;set the animation array to use the custom animation sequence we created anims[0] = Anim ;attach the animation you specified from the array to the main sex control object AnimationObject.SetAnimations(anims) ;Don't try to auto center on a nearby bed AnimationObject.SetBedding(-1) ;this makes it so event Start30_SexSceneEnd gets called when each stage reaches its end RegisterForModEvent("StageStart_Sex_Cunnilingus", "Sex_Cunnilingus_StageStart") RegisterForModEvent("StageEnd_Sex_Cunnilingus", "Sex_Cunnilingus_StageEnd") RegisterForModEvent("OrgasmStart_SexCunnilingus", "Sex_Cunnilingus_OrgasmStart") RegisterForModEvent("OrgasmEnd_SexCunnilingus", "Sex_Cunnilingus_OrgasmEnd") RegisterForModEvent("AnimationEnd_Sex_Cunnilingus", "Sex_Cunnilingus_AnimationEnd") ;We call this scene Sex_Cunnilingus which will hook it to the registerformodevent above this line, this is important, make sure names match AnimationObject.SetHook("Sex_Cunnilingus") ;no pre forplay animations since they don't match the scene at all AnimationObject.DisableLeadIn(True) ;Sets the animation in motion sslThreadController Thread = AnimationObject.StartThread()endFunctionevent Sex_Cunnilingus_OrgasmStart(string eventName, string argString, float argNum, form sender) debug.messagebox("orgasm start")endeventevent Sex_Cunnilingus_OrgasmEnd(string eventName, string argString, float argNum, form sender) debug.messagebox("orgasm end")endeventevent Sex_Cunnilingus_AnimationEnd(string eventName, string argString, float argNum, form sender)endeventevent Sex_Cunnilingus_StageStart(string eventName, string argString, float argNum, form sender)endeventevent Sex_Cunnilingus_StageEnd(string eventName, string argString, float argNum, form sender)endevent
Recommended Posts
Archived
This topic is now archived and is closed to further replies.