Jump to content

SexLab Framework Development


Recommended Posts

Ashal:  I know that similar requests have been made before, but to add my 2 cents in - if there was a way to specify each audio as "agressive", "consensual", or "both", that would be useful for immersion.  Like someone mentioned above, having the rape victim giggle while being raped is a little disconcerting...

Link to comment

Ashal:  I know that similar requests have been made before, but to add my 2 cents in - if there was a way to specify each audio as "agressive", "consensual", or "both", that would be useful for immersion.  Like someone mentioned above, having the rape victim giggle while being raped is a little disconcerting...

Yes, this would indeed be useful.

 

There already exists the ability to dictate voices, such as: http://git.loverslab.com/sexlab/wikis/function-getvoicebygender , but there isn't a particular method to reliably designate "nonconsensual" vs the consensual ones that I am aware of.

 

I would think it would be a matter of first designating certain voice sets with a true/false flag like the Gender flag so either the Framework by default knows which to use, or allows modders to know which ones to reference with functions.  So perhaps instead of:

sslBaseVoice DallasVoice = SexLab.GetVoiceByGender(0)

It would be something like:

sslBaseVoice DallasVoice = SexLab.GetVoiceByAggressive(0)

And let "0" be false and grabs random consensual voices and "1" be true and grabs random nonconsensual/aggressive voices, or something like that.

 

Link to comment

The "medium" moan soundset is intended to serve as the victim moans, if the actor using the voice is a victim, they'll use medium exclusively until the orgasm stage.

 

That's the intention of it anyways, in practice there just isn't very many good "pained" moans that mix well with the "normal" moans and still sound like they're coming from the same person.

 

I don't like the idea of separated "aggressive" voices, as that means a separate voiceset that needs to be tracked, or wildly different voices for an actor when starting one scene to another in the case of actors with forced voices.

Link to comment

So crazy idea time; I'm considering the possibility of converting portions of SexLab over to be a SKSE plugin instead of papyrus scripting.

 

There aren't a whole lot of immediate benefits out of it other than a faster API, and it would mean rewriting large portions of the framework, which I just got finished doing for 1.20. Plus c/c++ are far from my strong suit, I can do little more than basic stuff with it, mainly because I've never had an excuse to learn much more of it, I typically stick to Python whenever possible.

 

SexLab to me however is first and foremost just a coding project to kill time and enjoy coding something other than my usual crap for work, so converting portions of SexLab over to a SKSE plugin provides me a convenient excuse to better learn a new, more useful and marketable, programming skill along the way.

 

On the other hand I don't know how much of SexLab is doable as a SKSE plugin, I've only casually looked over the source code for a couple SKSE plugins to get an idea of how they are setup and the SKSE documentation for it is rather lacking from what I've seen. Entirely and even likely I'm in over my head on the idea.

Link to comment

Most of the audio content came from my mod for sexaddicts and since I've no interest in the rape stuff I didn't make sound sets that depicted it and don't have any intentions to in the future either. That's why there aren't any specific sets for it.

Link to comment
Guest kimbale

So if there were fitting soundsets (ie. with mild, medium, hot and rape sounds) for the voicetypes it could be done?

Or are the greeting topics too restricted?

Link to comment

Fair enough on the voice set stuff.  A bit more of an idle speculation on something more than any huge need.

 

To be honest, most of the voice sets I simply overwrite with some of the more milder ones (I can't stand the over-the-top porn star ones and I hate the 'whiny hentai squeals' sounds. <_< )

Link to comment

I have no clue if people would be interested in having this feature, but I thought of how to do it while working on another mod.

 

It should be possible though very complex and maybe taxing on CPU usage to emulate a 2nd camera view on screen.  

 

Essentially you create copies of all actors in the scene scale and rotate them, and turn off all collisions and such, then give them the same movement commands a the actor has while sliding them to maintain their screen position, and rotating them to match your desired view.   If you want to have a background frame you actually put the frame in front of them right in front of the area of your camera you want it to cover on the screen, then make them show up through that wall, like how detect life spells work.

 

Admittedly this would be fairly complex to program, and not sure if I will even do it at all (was considering it for a PiP familiar view for something I was thinking about trying)  I could see people wanting it for multi-angle shots for things though.

 

Oh well just throwing the concept out there.  

Link to comment

So crazy idea time; I'm considering the possibility of converting portions of SexLab over to be a SKSE plugin instead of papyrus scripting.

 

There aren't a whole lot of immediate benefits out of it other than a faster API, and it would mean rewriting large portions of the framework, which I just got finished doing for 1.20. Plus c/c++ are far from my strong suit, I can do little more than basic stuff with it, mainly because I've never had an excuse to learn much more of it, I typically stick to Python whenever possible.

 

SexLab to me however is first and foremost just a coding project to kill time and enjoy coding something other than my usual crap for work, so converting portions of SexLab over to a SKSE plugin provides me a convenient excuse to better learn a new, more useful and marketable, programming skill along the way.

 

On the other hand I don't know how much of SexLab is doable as a SKSE plugin, I've only casually looked over the source code for a couple SKSE plugins to get an idea of how they are setup and the SKSE documentation for it is rather lacking from what I've seen. Entirely and even likely I'm in over my head on the idea.

 

If doing this will enhance your knowledge base and improve your career options by learning new stuff I say go for it, have fun and good luck to you :D

Link to comment

So I'm terrible at this whole "taking a break" thing, as I've spent all night working on SexLab.

I've started work on a v1.25 which will mainly be an API update, though I may also include the planned MFG stuff with the update as well. For now though I'm just working on some new API features I thought would be neat and useful to get out to modders asap so that they can make use of them rather than making them wait for 1.30.
 
I've finished most of the API additions, just need a little cleanup, will decide what I want to do about a 1.25 after that. For now here is a quick rundown of the new API functions:
 

actor FindAvailableActor()

Idea for this one was given to by NYINEGY, and it's so obvious I feel stupid for having not added this function before.

 

It'll find a valid actor who is available for SexLab animation within the given radius of another actor or object. You can define what gender it is you want to find, or just ignore gender, and give it a list of up to 4 actors + the given center object/actor to forcibly ignore in the search radius.

 

actor[] FindAvailablePartners()

Works as a shortcut of sorts for finding multiple available actors. You give it an array of actors you currently have, tell it how many actors you want to have and of which genders, and it'll search out the actors needed to, returning you an actor array filled with the given actors + the searched for actors you requested.

 

ObjectReference FindAvailableBed()

Will return the nearest bed that is not being used by an actor from the given object center and radius.

 

actor[] MakeActorArray()

This is a relatively simple one mainly meant as a helper, before when making your positions array to pass off to StartSex() or for other uses, you would have to do something like this:

; // Without MakeActorArray()
actor[] positions = new actor[3]
positiosn[0] = PlayerRef
positions[1] = NPCRef1
positions[2] = NPCRef2
SexLab.StartSex(positions)

; // With the new MakeActorArray()
actor[] positions = SexLab.MakeActorArray(PlayerRef, NPCRef1, NPCRef2)
SexLab.StartSex(positions)
Link to comment

Ashal, I noticed that since one of the recent SexLab updates, M-M seems to be restricted to a handful of animations, mostly doggystyle and cowgirl variations, when before most of the animations could be used for M-M.  Any chance of restoring that animation variety?  We gayfolk can missionary too, and those animations lined up really well with only occasional need for manual adjusting.  :D

Link to comment

To show the power of some of the new API functions, here is an example magic effect script that will start a 3 way animation between the targeted actor, caster, and a undefined random nearby actor; done in only one line of code (minus the event and empty animation initialization)

event OnEffectStart(actor target, actor caster)
	sslBaseAnimation[] Anims
	SexLab.StartSex(SexLab.FindAvailablePartners(SexLab.MakeActorArray(caster, target), 3), Anims)
endEvent
Link to comment

Hi Ashal thank you for the framework.

 

I just now noticed that the dialog prompt stays on-screen when the animations run (dont remember it being that way ) is there a way to auto-remove it when

 

animations starts,in the next version?

 

I know i can use TM but its kind of immersion breaking

 

Thanx

Link to comment

 

To show the power of some of the new API functions, here is an example magic effect script that will start a 3 way animation between the targeted actor, caster, and a undefined random nearby actor; done in only one line of code (minus the event and empty animation initialization)

event OnEffectStart(actor target, actor caster)
	sslBaseAnimation[] Anims
	SexLab.StartSex(SexLab.FindAvailablePartners(SexLab.MakeActorArray(caster, target), 3), Anims)
endEvent

 

Awsome thats a lot cleaner than the script I was using to accomplish that and I'm sure a lot more consistant than mine was. Thanks for the update looking forward to the new version.

Link to comment

I've also just finished adding a new global script containing a couple shortcut functions, SexLabUtil, this way you can start a scene without having to set a property, in exchange however, it is slower than using a property. So it's mainly recommended for script fragments or small short scripts.

 

All of these are global and can be called from any script with no property needing to be set.

  • SexLabFramework GetAPI(), returns the SexLabFramework script itself, giving you full access to all the API without the need for a property
  • bool SexLabIsActive(), will return whether or not SexLab is activated in the load order
  • int StartSex(), a global version/shortcut to the frameworks API version of SexLabFramework.StartSex()
  • sslThreadModel NewThread(), a global version/shortcut to the frameworks API version of SexLabFramework.NewThread()

 

 

Link to comment

 

 

To show the power of some of the new API functions, here is an example magic effect script that will start a 3 way animation between the targeted actor, caster, and a undefined random nearby actor; done in only one line of code (minus the event and empty animation initialization)

event OnEffectStart(actor target, actor caster)
	sslBaseAnimation[] Anims
	SexLab.StartSex(SexLab.FindAvailablePartners(SexLab.MakeActorArray(caster, target), 3), Anims)
endEvent

 

Awsome thats a lot cleaner than the script I was using to accomplish that and I'm sure a lot more consistant than mine was. Thanks for the update looking forward to the new version.

 

 

There is a downside to using them, if the area is sparse and your search radius is low,  it's very likely it won't be able to find a valid actor for you, in which case FindAvailablePartners() will just return whatever it was able to find, like 2/3 of the actors, and FindAvailableActor() will return a none. So there is some validation you technically should do on your own afterwards. Though with the code example above, it would work regardless, as even if it failed to find a 3rd actor, since an empty animation list was given it would just start a 2 person animation.

 

And since it finds RANDOM actors in the radius, not the closest, otherwise it would always return the same actor and make the filtering rather useless; it has to cap itself on attempts or risk infinite looping in the event that it can't find a valid actor. So theoretically it's possible for there to be a valid actor nearby, but still get a None out of the function if you get real bad luck in the capped 20 loops of picking actors at random trying. It should be a fairly uncommon occurrence though.

Link to comment

So change of plans on the MFG facial expression stuff. Before I was planning on doing hard coded presets for each gender consensual/aggressor/victim combination. I was in the middle of setting that up and almost done with all the basic coding for it, but then I had a better idea.
 
Instead of hard coded presets, I've decided to setup up "expression slots" which will work in the exact same way in SexLab as Animations and Voices do with being able to be selected by tags and letting other modders add new ones.
 
Each expression slot that is registered with SexLab, with a maximum 5 phases of intensity as before, and maintain 2 separate lists of MFG commands for male and female, which can then be applied to an actor. They'll be used more as "emotions"  that get applied, and there will be a new MCM page that lets you select which expression "emotion" get's applied to male/female in consensual, aggressor, and victim positions.
 
I'm also considering adding support for equipable tongues using via the expression system, letting you set certain phases of of the expression to equip a tongue or not.
 
I have the system itself about 3/4th's finished right now, however I need a good 6 or 7 expressions at least to include with the update. So I still welcome some people who are familiar with using MFG to come up with groups of presets for me to use.

 

Here is a quick example of picking an expression from the API and applying it to an actor, this could be done outside or inside of any running animation, letting you use it for non sex animation stuff as well. 

sslBaseExpression Angry = SexLab.GetExpressionByName("Angry")
Angry.ApplyTo(PlayerRef, 80)

That would select an expression with the name by the name of Angry, and apply it to the player with an intensity of 80%, the 80% will be used to determine which phase of the expression to use depending on how many phases the expression has (between 1 and 5). 

 

 

If a modder were to want a certain position in a scene to use a specific expression, they could do this:

sslThreadModel Model = SexLab.NewThread()

Model.AddActor(NPCRef)
Model.AddActor(PlayerRef, victim = true)

sslBaseExpression Pained = SexLab.PickExpressionByTag("Pained")
Model.SetExpression(PlayerRef, Pained)

Model.StartThread()

That would start a new aggressive scene between NPCRef and PlayerRef, where PlayerRef is the victim and forcibly using a random expression that has the tag "Pained" which will automatically increase in phase intensity from 1 to 5 as the animation stages advance.

 

 

Currently registering a new expression looks like this:
 

scriptname sslExpressionDefaults extends sslExpressionFactory

; // Triggers the callbacks to register the expressions into their slots
function LoadExpressions()
	RegisterExpression("Pleasure")
	; // Other expression loaders go here
endFunction


; // Slots the "Pleasure" expression
function Pleasure(string eventName, string id, float argNum, form sender)
	Name = "Pleasure"

	; // Set tags for Pleasure expression
	AddTag("Happy")
	AddTag("Pleasure")
	AddTag("Consensual")

	; // Female Phase 1
	AddPreset(1, Female, Expression, 2, 30)
	AddPreset(1, Female, Phoneme, 5, 30)
	AddPreset(1, Female, Phoneme, 6, 10)

	; // Female Phase 2
	AddPreset(2, Female, Expression, 10, 50)
	AddPreset(2, Female, Modifier, 4, 30)
	AddPreset(2, Female, Modifier, 5, 30)
	AddPreset(2, Female, Modifier, 6, 20)
	AddPreset(2, Female, Modifier, 7, 20)
	AddPreset(2, Female, Phoneme, 0, 20)
	AddPreset(2, Female, Phoneme, 3, 30)

	; // Female Phase 3
	AddPreset(3, Female, Expression, 10, 70)
	AddPreset(3, Female, Modifier, 2, 50)
	AddPreset(3, Female, Modifier, 3, 50)
	AddPreset(3, Female, Modifier, 4, 30)
	AddPreset(3, Female, Modifier, 5, 30)
	AddPreset(3, Female, Modifier, 6, 70)
	AddPreset(3, Female, Modifier, 7, 40)
	AddPreset(3, Female, Phoneme, 12, 30)
	AddPreset(3, Female, Phoneme, 13, 10)

	; // Female Phase 4
	AddPreset(4, Female, Expression, 10, 100)
	AddPreset(4, Female, Modifier, 0, 10)
	AddPreset(4, Female, Modifier, 1, 10)
	AddPreset(4, Female, Modifier, 2, 25)
	AddPreset(4, Female, Modifier, 3, 25)
	AddPreset(4, Female, Modifier, 6, 100)
	AddPreset(4, Female, Modifier, 7, 100)
	AddPreset(4, Female, Modifier, 12, 30)
	AddPreset(4, Female, Modifier, 13, 30)
	AddPreset(4, Female, Phoneme, 4, 35)
	AddPreset(4, Female, Phoneme, 10, 20)
	AddPreset(4, Female, Phoneme, 12, 30)

	; // Female Phase 5
	AddPreset(5, Female, Expression, 12, 100)
	AddPreset(5, Female, Modifier, 0, 15)
	AddPreset(5, Female, Modifier, 1, 15)
	AddPreset(5, Female, Modifier, 2, 25)
	AddPreset(5, Female, Modifier, 3, 25)
	AddPreset(5, Female, Modifier, 4, 60)
	AddPreset(5, Female, Modifier, 5, 60)
	AddPreset(5, Female, Modifier, 11, 100)
	AddPreset(5, Female, Modifier, 12, 70)
	AddPreset(5, Female, Modifier, 13, 30)
	AddPreset(5, Female, Phoneme, 0, 40)
	AddPreset(5, Female, Phoneme, 5, 20)
	AddPreset(5, Female, Phoneme, 12, 80)
	AddPreset(5, Female, Phoneme, 15, 20)

	; // Male Phase 1
	AddPreset(1, Male, Expression, 2, 30)
	AddPreset(1, Male, Phoneme, 5, 30)
	AddPreset(1, Male, Phoneme, 6, 10)

	; // Male Phase 2
	AddPreset(2, Male, Expression, 10, 50)
	AddPreset(2, Male, Modifier, 4, 30)
	AddPreset(2, Male, Modifier, 5, 30)
	AddPreset(2, Male, Modifier, 6, 20)
	AddPreset(2, Male, Modifier, 7, 20)
	AddPreset(2, Male, Phoneme, 0, 20)
	AddPreset(2, Male, Phoneme, 3, 30)

	; // Male Phase 3
	AddPreset(3, Male, Expression, 10, 70)
	AddPreset(3, Male, Modifier, 2, 50)
	AddPreset(3, Male, Modifier, 3, 50)
	AddPreset(3, Male, Modifier, 4, 30)
	AddPreset(3, Male, Modifier, 5, 30)
	AddPreset(3, Male, Modifier, 6, 70)
	AddPreset(3, Male, Modifier, 7, 40)
	AddPreset(3, Male, Phoneme, 12, 30)
	AddPreset(3, Male, Phoneme, 13, 10)

	; // Male Phase 4
	AddPreset(4, Male, Expression, 10, 100)
	AddPreset(4, Male, Modifier, 0, 10)
	AddPreset(4, Male, Modifier, 1, 10)
	AddPreset(4, Male, Modifier, 2, 25)
	AddPreset(4, Male, Modifier, 3, 25)
	AddPreset(4, Male, Modifier, 6, 100)
	AddPreset(4, Male, Modifier, 7, 100)
	AddPreset(4, Male, Modifier, 12, 30)
	AddPreset(4, Male, Modifier, 13, 30)
	AddPreset(4, Male, Phoneme, 4, 35)
	AddPreset(4, Male, Phoneme, 10, 20)
	AddPreset(4, Male, Phoneme, 12, 30)

	; // Male Phase 5
	AddPreset(5, Male, Expression, 12, 100)
	AddPreset(5, Male, Modifier, 0, 15)
	AddPreset(5, Male, Modifier, 1, 15)
	AddPreset(5, Male, Modifier, 2, 25)
	AddPreset(5, Male, Modifier, 3, 25)
	AddPreset(5, Male, Modifier, 4, 60)
	AddPreset(5, Male, Modifier, 5, 60)
	AddPreset(5, Male, Modifier, 11, 100)
	AddPreset(5, Male, Modifier, 12, 70)
	AddPreset(5, Male, Modifier, 13, 30)
	AddPreset(5, Male, Phoneme, 0, 40)
	AddPreset(5, Male, Phoneme, 5, 20)
	AddPreset(5, Male, Phoneme, 12, 80)
	AddPreset(5, Male, Phoneme, 15, 20)

	Save()
endFunction

; // Other registration callbacks go here
Link to comment
Guest kimbale

 

So change of plans on the MFG facial expression stuff. Before I was planning on doing hard coded presets for each gender consensual/aggressor/victim combination. I was in the middle of setting that up and almost done with all the basic coding for it, but then I had a better idea.

 

Instead of hard coded presets, I've decided to setup up "expression slots" which will work in the exact same way in SexLab as Animations and Voices do with being able to be selected by tags and letting other modders add new ones.

 

 

Each expression slot that is registered with SexLab, with a maximum 5 phases of intensity as before, and maintain 2 separate lists of MFG commands for male and female, which can then be applied to an actor. They'll be used more as "emotions"  that get applied, and there will be a new MCM page that lets you select which expression "emotion" get's applied to male/female in consensual, aggressor, and victim positions.

 

I'm also considering adding support for equipable tongues using via the expression system, letting you set certain phases of of the expression to equip a tongue or not.

 

I have the system itself about 3/4th's finished right now, however I need a good 6 or 7 expressions at least to include with the update. So I still welcome some people who are familiar with using MFG to come up with groups of presets for me to use.

 

Here is a quick example of picking an expression from the API and applying it to an actor, this could be done outside or inside of any running animation, letting you use it for non sex animation stuff as well. 

sslBaseExpression Angry = SexLab.GetExpressionByName("Angry")
Angry.ApplyTo(PlayerRef, 80)

That would select an expression with the name by the name of Angry, and apply it to the player with an intensity of 80%, the 80% will be used to determine which phase of the expression to use depending on how many phases the expression has (between 1 and 5). 

 

 

If a modder were to want a certain position in a scene to use a specific expression, they could do this:

sslThreadModel Model = SexLab.NewThread()

Model.AddActor(NPCRef)
Model.AddActor(PlayerRef, victim = true)

sslBaseExpression Pained = SexLab.PickExpressionByTag("Pained")
Model.SetExpression(PlayerRef, Pained)

Model.StartThread()

That would start a new aggressive scene between NPCRef and PlayerRef, where PlayerRef is the victim and forcibly using a random expression that has the tag "Pained" which will automatically increase in phase intensity from 1 to 5 as the animation stages advance.

 

 

Currently registering a new expression looks like this:

 

scriptname sslExpressionDefaults extends sslExpressionFactory

; // Triggers the callbacks to register the expressions into their slots
function LoadExpressions()
	RegisterExpression("Pleasure")
	; // Other expression loaders go here
endFunction


; // Slots the "Pleasure" expression
function Pleasure(string eventName, string id, float argNum, form sender)
	Name = "Pleasure"

	; // Set tags for Pleasure expression
	AddTag("Happy")
	AddTag("Pleasure")
	AddTag("Consensual")

	; // Female Phase 1
	AddPreset(1, Female, Expression, 2, 30)
	AddPreset(1, Female, Phoneme, 5, 30)
	AddPreset(1, Female, Phoneme, 6, 10)

	; // Female Phase 2
	AddPreset(2, Female, Expression, 10, 50)
	AddPreset(2, Female, Modifier, 4, 30)
	AddPreset(2, Female, Modifier, 5, 30)
	AddPreset(2, Female, Modifier, 6, 20)
	AddPreset(2, Female, Modifier, 7, 20)
	AddPreset(2, Female, Phoneme, 0, 20)
	AddPreset(2, Female, Phoneme, 3, 30)

	; // Female Phase 3
	AddPreset(3, Female, Expression, 10, 70)
	AddPreset(3, Female, Modifier, 2, 50)
	AddPreset(3, Female, Modifier, 3, 50)
	AddPreset(3, Female, Modifier, 4, 30)
	AddPreset(3, Female, Modifier, 5, 30)
	AddPreset(3, Female, Modifier, 6, 70)
	AddPreset(3, Female, Modifier, 7, 40)
	AddPreset(3, Female, Phoneme, 12, 30)
	AddPreset(3, Female, Phoneme, 13, 10)

	; // Female Phase 4
	AddPreset(4, Female, Expression, 10, 100)
	AddPreset(4, Female, Modifier, 0, 10)
	AddPreset(4, Female, Modifier, 1, 10)
	AddPreset(4, Female, Modifier, 2, 25)
	AddPreset(4, Female, Modifier, 3, 25)
	AddPreset(4, Female, Modifier, 6, 100)
	AddPreset(4, Female, Modifier, 7, 100)
	AddPreset(4, Female, Modifier, 12, 30)
	AddPreset(4, Female, Modifier, 13, 30)
	AddPreset(4, Female, Phoneme, 4, 35)
	AddPreset(4, Female, Phoneme, 10, 20)
	AddPreset(4, Female, Phoneme, 12, 30)

	; // Female Phase 5
	AddPreset(5, Female, Expression, 12, 100)
	AddPreset(5, Female, Modifier, 0, 15)
	AddPreset(5, Female, Modifier, 1, 15)
	AddPreset(5, Female, Modifier, 2, 25)
	AddPreset(5, Female, Modifier, 3, 25)
	AddPreset(5, Female, Modifier, 4, 60)
	AddPreset(5, Female, Modifier, 5, 60)
	AddPreset(5, Female, Modifier, 11, 100)
	AddPreset(5, Female, Modifier, 12, 70)
	AddPreset(5, Female, Modifier, 13, 30)
	AddPreset(5, Female, Phoneme, 0, 40)
	AddPreset(5, Female, Phoneme, 5, 20)
	AddPreset(5, Female, Phoneme, 12, 80)
	AddPreset(5, Female, Phoneme, 15, 20)

	; // Male Phase 1
	AddPreset(1, Male, Expression, 2, 30)
	AddPreset(1, Male, Phoneme, 5, 30)
	AddPreset(1, Male, Phoneme, 6, 10)

	; // Male Phase 2
	AddPreset(2, Male, Expression, 10, 50)
	AddPreset(2, Male, Modifier, 4, 30)
	AddPreset(2, Male, Modifier, 5, 30)
	AddPreset(2, Male, Modifier, 6, 20)
	AddPreset(2, Male, Modifier, 7, 20)
	AddPreset(2, Male, Phoneme, 0, 20)
	AddPreset(2, Male, Phoneme, 3, 30)

	; // Male Phase 3
	AddPreset(3, Male, Expression, 10, 70)
	AddPreset(3, Male, Modifier, 2, 50)
	AddPreset(3, Male, Modifier, 3, 50)
	AddPreset(3, Male, Modifier, 4, 30)
	AddPreset(3, Male, Modifier, 5, 30)
	AddPreset(3, Male, Modifier, 6, 70)
	AddPreset(3, Male, Modifier, 7, 40)
	AddPreset(3, Male, Phoneme, 12, 30)
	AddPreset(3, Male, Phoneme, 13, 10)

	; // Male Phase 4
	AddPreset(4, Male, Expression, 10, 100)
	AddPreset(4, Male, Modifier, 0, 10)
	AddPreset(4, Male, Modifier, 1, 10)
	AddPreset(4, Male, Modifier, 2, 25)
	AddPreset(4, Male, Modifier, 3, 25)
	AddPreset(4, Male, Modifier, 6, 100)
	AddPreset(4, Male, Modifier, 7, 100)
	AddPreset(4, Male, Modifier, 12, 30)
	AddPreset(4, Male, Modifier, 13, 30)
	AddPreset(4, Male, Phoneme, 4, 35)
	AddPreset(4, Male, Phoneme, 10, 20)
	AddPreset(4, Male, Phoneme, 12, 30)

	; // Male Phase 5
	AddPreset(5, Male, Expression, 12, 100)
	AddPreset(5, Male, Modifier, 0, 15)
	AddPreset(5, Male, Modifier, 1, 15)
	AddPreset(5, Male, Modifier, 2, 25)
	AddPreset(5, Male, Modifier, 3, 25)
	AddPreset(5, Male, Modifier, 4, 60)
	AddPreset(5, Male, Modifier, 5, 60)
	AddPreset(5, Male, Modifier, 11, 100)
	AddPreset(5, Male, Modifier, 12, 70)
	AddPreset(5, Male, Modifier, 13, 30)
	AddPreset(5, Male, Phoneme, 0, 40)
	AddPreset(5, Male, Phoneme, 5, 20)
	AddPreset(5, Male, Phoneme, 12, 80)
	AddPreset(5, Male, Phoneme, 15, 20)

	Save()
endFunction

; // Other registration callbacks go here

 

 

 

Ashal, you're my scripting hero, this so fucking awesome! Now i need to change that reply on my sexpression thread about SL being a sex framework and not a expression framework...

Man, the possibilities.... I wanted better acting in skyrim... AAAAAAAAAHHH!!!! :D

Oh god... I can't wrap my mind around this, goddamn, this is revolutionary... (Stopping to edit this post now :P)

PLEASE put the tongues in, i beg you! That would be so awesome....

Link to comment

- Some animation "tweating" would be nice :

the AP one with the legs turned at 90° on the side ...

 

- Limit the use of pillory like stuff to the equiped zone/cells, yes it is a little bit disturbing to see a random bandit wandering with a ready to use pillory in his pocket :blush: .

- abillity to use other activator/stuff like the tables, chair, bench...

- maybe a tag restriction for the animation example :

 

use bed = yes then only not standing animations would start

Link to comment

Could use a bit of script help. I'm almost done with a small mod, and I wonder if there's a function which triggers on a sexlab animation ending, to apply either a magic effect or a spell on one of the actors? Or can I only hook to the last stage and apply the effect when the last stage starts?

Link to comment

actor FindAvailableActor()

Idea for this one was given to by NYINEGY, and it's so obvious I feel stupid for having not added this function before.

 

It'll find a valid actor who is available for SexLab animation within the given radius of another actor or object. You can define what gender it is you want to find, or just ignore gender, and give it a list of up to 4 actors + the given center object/actor to forcibly ignore in the search radius.

If I am reading the FindAvailableActor() idea properly, that will be useful for adding spillover assailants to now properly assault your follower during player surrender. Spiffy!

 

Now, when you say valid actor available, would it consider an actor that is already tagged and in another animation as invalid.  So if I had 4 bandits, 2 were already paired off with the player, then FindAvailableActor() would only see bandit #3 & 4 as valid, and not try to grab #1 or 2?

Link to comment

 

actor FindAvailableActor()

Idea for this one was given to by NYINEGY, and it's so obvious I feel stupid for having not added this function before.

 

It'll find a valid actor who is available for SexLab animation within the given radius of another actor or object. You can define what gender it is you want to find, or just ignore gender, and give it a list of up to 4 actors + the given center object/actor to forcibly ignore in the search radius.

If I am reading the FindAvailableActor() idea properly, that will be useful for adding spillover assailants to now properly assault your follower during player surrender. Spiffy!

 

Now, when you say valid actor available, would it consider an actor that is already tagged and in another animation as invalid.  So if I had 4 bandits, 2 were already paired off with the player, then FindAvailableActor() would only see bandit #3 & 4 as valid, and not try to grab #1 or 2?

 

 

 

If they are already animating they will be considered as invalid, and not returned from the function.

 

It checks for 3 things, in this order, before looking for a new actor or returning the one if it passes all 3:

  1. They aren't in the ignore list, which consists of actors manually ignored from the arguments, the actor/object used as the center of your search radius, any actor that has already failed the other 2 checks in a previous loop.

     

  2. If they match the gender, if any, you specified in the function arguments. 

     

  3. If they pass a sslActorLibrary.ValidateActor() check, which is the same check that gets called when attempting to add an actor to a scene. They will fail if they are
    • already in another scene
    • have the SexLabForbid keyword or are in the SexLab Forbidden Faction
    • are dead or disabled
    • don't have their 3d loaded into the cell
    • are currently flying (as of v1.25)
    • are a creature race that doesn't have a registered animation.

 

The function itself if interested:

actor function FindAvailableActor(ObjectReference centerRef, float radius = 5000.0, int findGender = -1, actor ignore1 = none, actor ignore2 = none, actor ignore3 = none, actor ignore4 = none)
	if centerRef == none || findGender > 2 || findGender < -1 || radius < 0
		return none ; // Invalid args
	endIf
	; // Create supression list
	form[] supress = new form[5]
	supress[0] = centerRef
	supress[1] = ignore1
	supress[2] = ignore2
	supress[3] = ignore3
	supress[4] = ignore4
	; // Attempt 30 times before giving up.
	int attempt = 30
	while attempt
		attempt -= 1
		; // Get random actor
		actor foundRef = Game.FindRandomActorFromRef(centerRef, radius)
		; // Validate actor
		int gender
		bool valid = foundRef != none && supress.Find(foundRef) == -1
		if valid
			; // Get their gender if we need it
			gender = GetGender(foundRef)
			; // Supress from future validation attempts
			supress = sslUtility.PushForm(foundRef, supress)
		endIf
		valid = valid && (findGender != 2 && gender != 2) ; // Supress creatures
		valid = valid && (findGender == -1 || findGender == gender) ; // Validate gender
		valid = valid && IsValidActor(foundRef) ; // Actor Validate
		if valid
			return foundRef ; // Actor passed validation, end loop/function
		endIf
	endWhile
	; // No actor found in attempts
	return none
endFunction
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