Jump to content

(SOLVED) The ultimate play sex animation sex script, with fade in & out, talking during sex.


trepleen

Recommended Posts

This is complete code that does the following:

 

1. fades in & out during stage changes during sex animations

2. plays custom pieced sex animation stages between dialogue speaker & player.  The entire cunnilingus animation was pieced together from two other sex lab animations.

3. allows target to speak during sex animations by using scenes under scene tab in a quest.

4. plays the last stage twice to perfect precise timing of orgasm effect.

5. sets the time of last stage

6. fades out at end of animation while performing cleanup

7. includes code to equip a tongue, you have to download the tongue armor model yourself.

 

You need to learn how to make a scene: https://www.youtube.com/watch?feature=player_detailpage&v=Qfcet5hf5bs#t=889

You need to learn how to make an image space modifier which is super easy: Duration 0, tint set to black, fade set to black and all setting set to 0.

 

You can fire this function from a dialogue line in a quest under papyrus fragments using this line:

 

 

(GetOwningQuest() as KD_KatreenaDarkmoore_QuestDialogue).Sex_Cunnilingus()

 

 

The following script contains the function that is fired from the line of dialogue in the quest. You attached this script under the scripts tab in your quest. You may have to change the wording around and names to your suit your quest. You may also have to comment out parts you want to use and don't want to use. Ask questions if you have any.

 

 

Scriptname KD_KatreenaDarkmoore_QuestScript extends Quest  
;written by trepleen from loverslab forum, use and modify this script freely, give credit if possible, thanks

;the sex lame framework
SexLabFramework property SexLab Auto

;actors used in this script
Actor Property KD_KatreenaDarkmoore Auto

;this scene makes Katreena moan as if having an orgasm
Scene Property KD_MoanOrgasm Auto
Scene Property KD_SexTalk_Stage30 Auto
Scene Property KD_SexTalk_Stage30_1 Auto
Scene Property KD_SexTalk_Stage30_2 Auto

;reference to an x maker we placed inside the sleeping giant inn room, this is where the sex occurs, right at this marker, you can view it in the riverwood sleeping giant inn cell under interiors
ObjectReference Property KD_SleepingGianInnSexMarker Auto

;this image space modifier is used to make the screen black
ImageSpaceModifier Property KD_BlackOut_ISM Auto

;sexy music played during scenes
MusicType property KD_SexMusicType Auto

;armors to use during animations, the tongue counts as an armor
Armor Property KD_TongueArmor_Straight_Thick_Long Auto

;these booleans keep track of a stage when they fire, they get set to 1 if that stage is fired, but stay at 0 if not, we set the back to zero when animaton finished
Bool firstStageFired
Bool secondStageFired

;this function plays all cunninlingus scenes that sexlab has to offer
function 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)

    ;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)
    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)
    Anim.AddPositionStage(a2, "Arrok_Tricycle_A2_S3", -100.5, silent = true, openMouth = true)

    ;set stage timers
    Anim.SetStageTimer(4, 6.0)

    ;this is a sexual animation so I added the tag sexual
    Anim.AddTag("Sexual")

    ;save our new customized stage sequence
    Anim.Save()

    ;array that holds animations
    sslBaseAnimation[] anims = new sslBaseAnimation[1]

    ;set the animation we made to the queue to be animated
    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)

    ;these functions get called when they occur
         RegisterForModEvent("AnimationStart_Sex_Cunnilingus", "SC_AnimationStart")
         RegisterForModEvent("AnimationEnd_Sex_Cunnilingus", "SC_AnimationEnd")
         RegisterForModEvent("StageStart_Sex_Cunnilingus", "SC_StageStart")
         RegisterForModEvent("StageEnd_Sex_Cunnilingus", "SC_StageEnd")
         RegisterForModEvent("OrgasmStart_Sex_Cunnilingus", "SC_OrgasmStart")
         RegisterForModEvent("OrgasmEnd_Sex_Cunnilingus", "SC_OrgasmEnd")

    ;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)

    ;move the player to our xmaker, so the sex animation doesn't start anywhere else
    Game.GetPlayer().MoveTo(KD_SleepingGianInnSexMarker)

    ;make sure third person is active
    Game.ForceThirdPerson()    

    ;return our stage fired variables back to zero    
    firstStageFired = 0
    secondStageFired = 0

    ;Sets the animation in motion
    sslThreadController Thread = AnimationObject.StartThread()

    ;apply image space modifier that blacks out screen
    KD_BlackOut_ISM.Apply()

    ;start sexy music
    ;KD_SexMusicType.Add()

endFunction

event SC_AnimationStart(string eventName, string argString, float argNum, form sender)

    ;the controller object gives us the control needed to end an animation
      sslThreadController controller = SexLab.HookController(argString)

    debug.trace("SC_AnimationStart:" + "code738")

    ;realign actors
    Controller.RealignActors()

endevent

event SC_AnimationEnd(string eventName, string argString, float argNum, form sender)

    ;output to log that this event fired
    debug.trace("SC_AnimationEnd")

    ;cleanup items given for sex scene
    KD_KatreenaDarkmoore.RemoveItem(KD_TongueArmor_Straight_Thick_Long, 1, true)
    Game.GetPlayer().RemoveItem(KD_TongueArmor_Straight_Thick_Long, 1, true)

    ;remove sexy music
    KD_SexMusicType.remove()

    ;stop all scenes from playing
    KD_MoanOrgasm.Stop()
    KD_SexTalk_Stage30.Stop()
    KD_SexTalk_Stage30_1.Stop()
    KD_SexTalk_Stage30_2.Stop()

    ;fade the game in but wait two seconds first, total fade time 1 second
    Game.FadeOutGame(false, true, 2.0, 1.0)

    ;wait one second
    Utility.Wait(1)

    ;clear facial expressions just in case    
    SexLab.ClearMFG(kd_katreenadarkmoore)
    SexLab.ClearMFG(Game.GetPlayer())

    ;remove image space modifier that makes screen black
    KD_BlackOut_ISM.Remove()

    ;return our stage fired variables back to zero    
    firstStageFired = 0
    secondStageFired = 0

    ;wait three more seconds just in case they rapidly press spacebar to skip everything, then we'll make sure the black image space modifier is removed
    Utility.Wait(3)

    ;remove image space modifier that makes screen black
    KD_BlackOut_ISM.Remove()

    ;cleanup
    UnregisterForModEvent("AnimationStart_Sex_Cunnilingus")
         UnregisterForModEvent("AnimationEnd_Sex_Cunnilingus")
         UnregisterForModEvent("StageStart_Sex_Cunnilingus")
         UnregisterForModEvent("StageEnd_Sex_Cunnilingus")
         UnregisterForModEvent("OrgasmStart_Sex_Cunnilingus")
         UnregisterForModEvent("OrgasmEnd_Sex_Cunnilingus")

endevent

event SC_StageStart(string eventName, string argString, float argNum, form sender)

    ;the controller object gives us the control needed to end an animation
      sslThreadController controller = SexLab.HookController(argString)

    ;output to log that this event fired
    debug.trace("SC_StageStart:" + controller.stage)

    ;are we on the first stage? 0 means no, this gets set to 1 further down
    if firstStageFired == 0

        ;begin a slow fade out
        Game.FadeOutGame(false, true, 6.0, 6.0)

        ;get the fade out time to do its thing
        Utility.Wait(3)

        ;remove the image space modifier, this object is responsible for making the screen go black
        KD_BlackOut_ISM.Remove()

        ;expression int values for reference, just in case
        ;0 Pleasure, 1 Happy, 2 Joy, 3 Shy, 4 Sad, 5 Afraid, 6 Pained,7 Angry

        ;apply angry expression at 25 strength
        sslBaseExpression Angry = SexLab.GetExpressionByName("Angry")
        Angry.ApplyTo(KD_KatreenaDarkmoore, 25)

        ;apply shy expression at 25 strength
        sslBaseExpression Pleasure = SexLab.GetExpressionByName("Pleasure")
        Pleasure.ApplyTo(Game.GetPlayer(), 25)

        ;start sex talk
        KD_SexTalk_Stage30_2.Start()

        ;first stage has fired, we need to always make sure we know when the first stage occurs
        firstStageFired = 1

    elseif secondStageFired == 0

        ;begin a fade out
        Game.FadeOutGame(false, true, 4.0, 4.0)

        ;add tongue to Giver
        Game.GetPlayer().EquipItem(KD_TongueArmor_Straight_Thick_Long, false, true)

        ;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_BlackOut_ISM.Remove()

        ;apply afraid at 50 strength
        sslBaseExpression Afraid = SexLab.GetExpressionByName("Afraid")
        Afraid.ApplyTo(kd_katreenadarkmoore, 50)

        ;apply pleasure at 25 strength
        sslBaseExpression Pleasure = SexLab.GetExpressionByName("Pleasure")
        Pleasure.ApplyTo(Game.GetPlayer(), 25)

        ;start second sex talk for katreena
        KD_SexTalk_Stage30.Start()

        ;second stage has fired, we need to always make sure which stage occurs
        secondStageFired = 1

    else

        ;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_BlackOut_ISM.Remove()

        ;apply afraid at 50 strength
        sslBaseExpression Afraid = SexLab.GetExpressionByName("Afraid")
        Afraid.ApplyTo(kd_katreenadarkmoore, 50)

        ;apply afraid at 50 strength
        sslBaseExpression Afraid1 = SexLab.GetExpressionByName("Afraid")
        Afraid1.ApplyTo(Game.GetPlayer(), 100)

        ;start second sex talk for katreena
        KD_SexTalk_Stage30_1.Start()

    endif    

endevent

event SC_StageEnd(string eventName, string argString, float argNum, form sender)

    ;the controller object gives us the control needed to end an animation
    sslThreadController controller = SexLab.HookController(argString)

    ;output to log to make sure this function fired
    debug.trace("SC_StageEnd:" + controller.stage)

    ;as long as we're not on the last stage (orgasm stage in which we set to six seconds up above)
    if controller.stage < Controller.Animation.StageCount
        ;apply black screen image space modifier at the end of stage
        KD_BlackOut_ISM.Apply()
    endif

endevent

event SC_OrgasmStart(string eventName, string argString, float argNum, form sender)

    ;the controller object gives us the control needed to end an animation
    sslThreadController controller = SexLab.HookController(argString)

    ;output to log to make sure this function fired
    debug.trace("SC_OrgasmStart")

    ;orgasm stage so make katreena moan with orgasm
    KD_MoanOrgasm.Start()

    ;wait a second
    Utility.Wait(1)

    ;apply cum at moment of orgasm
        ;1 - Vagina
        ;2 - Mouth/Breasts
        ;3 - Buttocks
        ;4 - Vagina + Mouth/Breasts
        ;5 - Vagina + Buttocks
        ;6 - Mouth/Breasts + Buttocks
        ;7 - Vagina + Mouth/Breasts + Buttocks
    SexLab.ApplyCum(Game.Getplayer(), 4)

    ;scene is finished, fade out
    ;KD_Fade_ISM.Apply()

    ;wait three seconds before starting fade out, keep in mind we set the fourth stage to six seconds up above
    Utility.Wait(3)

    ;fade out over 3 seconds    
    Game.FadeOutGame(true, true, 0, 3.0)

    ;wait a second so the fade and image space modifier hit at around the same time    
    Utility.Wait(1)

    ;apply black image space mofidier that blacks the screen
    KD_BlackOut_ISM.Apply(1)

endevent

event SC_OrgasmEnd(string eventName, string argString, float argNum, form sender)

    ;output to log to make sure this function fired
    debug.trace("SC_OrgasmEnd")

endevent


 

Link to comment

It doesn't do anything to stop it, but nor does it do anything to assist with trying to do it either. Implementing dialog outside of SexLab works the exact same as implementing dialog during sex.

 

Are you suggesting that I set a flag before an animation, then have (idle) lines of dialogue invoke by themselves during animation?

 

Something like this:

 

Player picks dialogue: "Let's do the nasty"

 

Script kicks ins:

 

bDoingNasty = true

 

sexlab code

Sexlab.StartThread()

 

Quest Dialogue (IDLE) under misc

if  bDoNasty = true then

(Idle) Dialogue - akspear: "i just love doing the nasty"

 

Event_SexLab.AnimationFinished

(

bDoingNasty = false

)

Link to comment

Can sexlab make the akspeaker speak lines of dialogue from the quest, during an animation with head tracking by any chance?

 

You're asking for facial animations - in sync with a text dialog - while an animation is playing.

 

There are rudimentary facial animations within the framework, and some of that is keyed on animation types/Seq stages ...

 

So to answer your question, the basic struct and functions are actually there but not elaborated upon nor do I assume would be an easy design and implementation to create a string parsing controlled trigger which relies on a feed from external mods to mimic spoken word facial expressions. Likewise if the mod is doing the track... may have to interrupt sl from using expressions?

Link to comment

 

It doesn't do anything to stop it, but nor does it do anything to assist with trying to do it either. Implementing dialog outside of SexLab works the exact same as implementing dialog during sex.

 

Are you suggesting that I set a flag before an animation, then have (idle) lines of dialogue invoke by themselves during animation?

 

Something like this:

 

Player picks dialogue: "Let's do the nasty"

 

Script kicks ins:

 

bDoingNasty = true

 

sexlab code

Sexlab.StartThread()

 

Quest Dialogue (IDLE) under misc

if  bDoNasty = true then

(Idle) Dialogue - akspear: "i just love doing the nasty"

 

Event_SexLab.AnimationFinished

(

bDoingNasty = false

)

 

 

Is what he's asking only with additional animation tracking i.e. head follows, etc... as far as what I catch from the op. Am not sure... but straight off may have to deal with the expression animations - as in not kicking them in?

Link to comment

I know I could trigger individual positions and play them in a scene and have the characters lip sync with partial facial expressions from said lip sync

Just could never figure out how to pick and choose animations FROM sexlabs framewok, I was just triggering them individually from the base

 

sooooooo if osmeone knows how to trigger a specific animation set instead of a sequence and can explain it in herp derp terms, please pm me :P

Link to comment

sooooooo if osmeone knows how to trigger a specific animation set instead of a sequence and can explain it in herp derp terms, please pm me :P

 

let's clarify.  Take the Zyn Femdom animation for example.  Instead of playing the entire sequence, you want to specifically play ONLY stage 1 for example?

 

Regarding scenes.  You managed to get them to speak lines of dialogue during actual sex animations?  Did you simply initiate startsex scenes during each phase of a scene?

 

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