Jump to content

SexLab Framework Development


Recommended Posts

Thank you for the script help... Umm... Unfortunately I need a bit more of it. I'm sorry. T_T

 

I've been working on a very simple script for the last couple of days (since I'm a seriously terrible scripter) and I keep failing to trigger a spell casting when animationEnd hooks. Everything else in the script works just as it should ingame, even the other hook, it's just the call for a spellcasting at the end of the script that I can't manage to get working.

Scriptname sslEnchantressMagicEffect extends ActiveMagicEffect

SexLabFramework property SexLab auto
sslEnchantress Property Enchantress auto hidden
spell property Calm auto
spell property CalmEnchant auto
spell property InfluenceAggDownFFAimedMellow auto

event OnEffectStart(actor target, actor caster)
	actor[] sexActors = new actor[2]
	sexActors[0] = target
	sexActors[1] = caster
	sexActors = SexLab.SortActors(sexActors, femaleFirst=true)
	RegisterForModEvent("AnimationStart_Enchanted", "EnchantMessage")
	RegisterForModEvent("AnimationEnd_Enchanted", "CalmMagicEffect")
	sslBaseAnimation[] anims

	SexLab.StartSex(sexActors, anims, allowBed=false, hook="Enchanted")
endEvent
	
event EnchantMessage(string eventName, string argString, float argNum, form sender)
	sslThreadController controller = SexLab.HookController(argString)
	actor[] actorList = SexLab.HookActors(argString)
	int player = controller.GetPlayerPosition()
	if player == 0
		Debug.Notification("Your spell enchants " + actorList[1].GetLeveledActorBase().GetName() + " with uncontrollable lust")
	elseIf player == 1
		Debug.Notification("Your spell enchants " + actorList[0].GetLeveledActorBase().GetName() + " with uncontrollable lust")
	endIf
	UnregisterForModEvent("AnimationStart_Enchanted")
endEvent

event CalmMagicEffect(string eventName, string argString, float argNum, form sender)
	sslThreadController controller = SexLab.HookController(argString)
	actor[] actorList = SexLab.HookActors(argString)
	int player = controller.GetPlayerPosition()
	if player == 0
		actorList[0].addSpell(CalmEnchant, false)
		CalmEnchant.Cast(actorList[0], actorList[1])
		actorList[0].removeSpell(CalmEnchant)
	elseIf player == 1
		actorList[1].addSpell(CalmEnchant, false)
		CalmEnchant.Cast(actorList[1], actorList[0])
		actorList[1].removeSpell(CalmEnchant)
	endIf
		UnregisterForModEvent("AnimationEnd_Enchanted")
endEvent

The CalmEnchant that I'm trying to cast at the end is a spell rather than a magic effect. My best guess is that I'm messing up the CalmEnchant.Cast line somehow, the info on how to phrase it I'm getting from creationkit.com or googling 'skyrim script spell cast' is pretty minimal.

Link to comment

Would it be possible to add clothes swapping support in the SexLab code? 

I was reading the breaking undies thread and some of the pictures there showed a miniskirt pulled up and the panties pulled down. Stuff like that would be great for SexLab too, and would add to the RP element in the plugins. is it possible to make it a general switch that does something like:

if clothing article 1 is in folder 1, swap it with clothing article 2 in folder 1. 

if clothing article 1 is in folder 2, swap it with clothing article 2 in folder 2. 

Folder example is a bad one, but at least a system where you have different folders for the models you would like to use and is easy to add to so that the system is just there in the bottom, letting people make their own verions of what they want swapped out.

 

I hope you could follow that thought, I sure had problems with it.. 

Link to comment

A question: Is it possible to add "invisible" stats to SexLab? Like I would like to be able to make responses like: "I heard you worked out of [Name of Inn]" with just a condition check in the dialogue if people use for example radiant prostitution. 

 

Another question: Could you add, or is there, a "HadSexWithPlayer" perk or spell to all the NPCs the player have sex with?

 

Link to comment

 

Another question: Could you add, or is there, a "HadSexWithPlayer" perk or spell to all the NPCs the player have sex with?

I'm not sure if that's needed in the framework, SexLab Romance remembers every single NPC your character had sex with through it without such a function.

Link to comment

 

 

Another question: Could you add, or is there, a "HadSexWithPlayer" perk or spell to all the NPCs the player have sex with?

I'm not sure if that's needed in the framework, SexLab Romance remembers every single NPC your character had sex with through it without such a function.

 

They probably added them to a faction or something.  I do the same thing with Submit.

 

Either way, yeah, not sure of the benefit to having it in the Framework.  It only matters if the mod would make use of that information, in which case, it's fairly easy to add it yourself as needed.

Link to comment

 

 

 

Another question: Could you add, or is there, a "HadSexWithPlayer" perk or spell to all the NPCs the player have sex with?

I'm not sure if that's needed in the framework, SexLab Romance remembers every single NPC your character had sex with through it without such a function.

 

They probably added them to a faction or something.  I do the same thing with Submit.

 

Either way, yeah, not sure of the benefit to having it in the Framework.  It only matters if the mod would make use of that information, in which case, it's fairly easy to add it yourself as needed.

 

There is no problem adding a check if your own plugin was used, but people use many plugins and having it stored cross-plugins will let you write better dialogues that remembers that you have had sex before.

 

Edit: But if SexLab already remembers it, then my question is: How can my plugin access that memory?

Link to comment

Hi yall :)

 

Well i got a problem for some time already and i donno how to fix it :(

 

When i chat with npc and i agree to have an sex  animation , they just stand there but nothing happends ... how can i fix it ?  help please

 

NOTE : yes i did everything about fnis and all that stuff 

Link to comment

 

There is no problem adding a check if your own plugin was used, but people use many plugins and having it stored cross-plugins will let you write better dialogues that remembers that you have had sex before.

 

Edit: But if SexLab already remembers it, then my question is: How can my plugin access that memory?

Oh, indeed, a simple global "Has had sex Yes/No" check could be made.  However, if a mod wanted to know "Has had consensual sex Yes/No" vs "Has had nonconsensual sex Yes/No", such as mine, then either Ashal would have to build in several varieties of this to try to anticipate all scenarios, or individual mods would wind up having to add custom ones anyways.

Link to comment

One thing that might be really easy to work into animations would be bondage. Specifically the bondage animation from the beginning of the game. The hands tied behind the back could make for a lot of decent rapey animations where the character is more subdued. That hands behind the back posture would work great on both standing and kneeling forced blowjobs, forced cowboy (reverse and regular), forced doggy style with the hands held behind the back (as in one of the beast rape scenes) and many others.

 

It would work great for some of the softer foreplay scenes. Many of the kissing scenes would be quite interesting with the victim bound and being forced to smooch.

 

It could also be a cool intro to a stripping scene with the victim bound and standing there and the attacker approaching the victim and stripping them in a few moves that are obviously removing different clothing articles.

 

****************************************************************************************

 

I also wonder if there is perhaps a chance of seeing various "scenes" linked into one another to form a longer sexual experience? What I mean is currently we have stages within one scene. Some of the scenes are sex scenes and some are foreplay scenes.

 

It would be very cool to be able to choose a setting in Sexlab that played a opening foreplay scene that was then aiutomatically followed by a sex scene. So you would transition from the foreplay to a new sex scene.

 

If proper stripping animations were to be made that were story specific (some consensual sex, some rape themed, ect...) then you could link 3 scenes into one full session. Have an opening stripping scene followed by a foreplay scene and ending with a sex scene. Each scene would have their multiple stages.

 

The various scene types coudl each have catagories. Right now we have aggressive sex and can choose the animations we want to be possible in that group. If multiple scenes were allowed we could have aggresive sex, aggresive foreplay, and aggressive stripping, and we could click each scene we want to have a chance to play in each of the various sexual encounters. Much as we currently choose the active animations for consensual, aggressive, and beast sex. We would have 9 catagories instead of 3.

 

Consensual sex animations

Consensual stripping animations

Consensual foreplay animations

Aggressive sex animations

Aggressive foreplay animaions

Aggressive stripping animations

Beast sex animations

Beast stripping animations

Beast foreplay animations ( some beasts such as Falmer might have quite sinister/violent ideas of foreplay, vampires would likely include blood drinking from various areas of the body prior to sex)

Link to comment

magic effects can't register mod events, create a quest and attach a script to that which managed your hooks.

 

 

Really?  Because the sex magic in my Angrim's Apprentice mod does this all the time, and I've never had any problems with the hooks firing.

 

In particular the script AngrimTriggerSpell.psc (in the BSA for the mod) extends ActiveMagicEffect, and the whole purpose of the script it to trigger the appropriate spell on OrgasmEnd.

 

Not that the advice to centralize such hooks in an associated quest is wrong - but I'm not sure it is really necessary.

Link to comment

May be only so long as they don't expire before the event is received. If the magic effect expires there is nothing there to receive the event. I don't know for sure, haven't ever tested it or needed to, just going off what I've been told by other people saying they can't get their spell to receive callback events.

Link to comment

My triggering spells last 5 min., so problems with the effect expiring aren't too likely (still possible, just rare).  And if the effect expires before the sex act ends, well, I wouldn't expect the event to trigger.

 

This also wouldn't be an issue for a magic effect associated with a permanent ability (though that isn't the case with most of the Angrim spells).

 

I'll be sure to have it unregister explicitly in the OnEffectFinish, just in case a later event might still try to execute the hook and crash.  Though in general, ActiveMagicEffect-registered events unregister automatically when the effect ends.

Link to comment

Quick update on development, I've pushed a bunch of changes to the development branch on Git.

 

Highlights:

  • Fully functioning mfg preset system that applies applicable facial emotions to characters during sex. Just missing enough good expressions to fill it out, please read www.loverslab.com/topic/22448-sexlab-expressions-submit-mfg-presets/
  • Added stat tracking for how many times a NPC has had sex with the player, along with applicable functions:
    • bool HadPlayerSex(actor) tells you if player has had sex with the given actor
    • int PlayerSexCount(actor) tells you how many tims a given actor has had sex with the player
    • AddPlayerSex(actor) adds +1 to a given actors play sex tally, this is called automatically on npcs at the end of a scene if the play was involved. 
  • A bunch of optimizations aimed at speeding up the time it takes to start an animatiobs.
    • By my benchmarks, starting a scene from cold NewThread()/StartSex() to fully animation, has gone from ~2.1 to ~0.8 seconds
  • Bug fixes n' shit.
Link to comment

Hey Ashal.

 

I was thinking, could you put in a masturbation hotkey? I know there are plugins for SexLab that adds spells for it, but I don't want the excess that the mods add. I don't want to clutter my spells or have a glowing orb in my hand just to get my character to masturbate - it's extremely immersion-breaking. I know that Sexout adds a hotkey for it and iirc so does lovers with pk. And sure the defeat plugin adds a hotkey, but again, I don't want the excess that the mod adds. I use submit and prefer the simple 1-key submit with a chance over a huge, complex mini-game for submitting.

Link to comment

I would love to see the possibility of hotkeys for rotation an individual animation set, as opposed to the entire "scene".  Some of the animations face opposite directions, and there's no easy way to make them blend well in that event.

 

Thanks once again, Ashal, for all your hard work on this.  The framework is amazing!

Link to comment

I've created a function to dispel the cum effect on my own.

Function CleanUp(Actor akPlayer)
    If(akPlayer.HasMagicEffectWithKeyword(CumAnal) || akPlayer.HasMagicEffectWithKeyword(CumOral) || akPlayer.HasMagicEffectWithKeyword(CumVaginal))
        If(CleanUpMsg.Show() == 0)
            CleanUpSpell.Cast(akPlayer)
        EndIf
    EndIf
EndFunction

It casts a spell which dispels all effects with the cum keywords from SexLab.

 

Now instead of doing it on my own I thought about a way to directly use it from SexLab itself. So my suggestion for a next release would be this:

 

In SexLabFramework after ApplyCum function

function DispelCum()
    ActorLib.bDispelCumEffect = true
endfunction

Somewhere in sslActorLibrary

bool bDispelCumEffect auto hidden

Altered sslActorCumEffect

event OnUpdate()
    if GetTargetActor().IsSwimming() || GetTimeElapsed() > timer || Lib.bDispelCumEffect
        Dispel()
        return
    endIf
    RegisterForSingleUpdate(5.0)
endEvent
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 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