Jump to content

SexLab Framework Development


Recommended Posts

Posted

 

Did you guys ever get SexLabUtil.SetNodeRotation to work?  It would be nice if I could rotate a bone on an actor.

 

I could never wrap my head around the rotation matrix stuff it uses. B3lisaro appears to have figured it out though and released a plugin for it: http://www.loverslab.com/files/file/1362-skeletonutils/

 

https://github.com/expired6978/skyui/blob/master/racemenu_dist/Data/Scripts/Source/NiOverride.psc

 

Similar function at line 321, euler is heading, attitude, bank in degrees, optionally you can work with the 3x3 but euler angles make more sense.

 

The rotations from this API work a little different from what you would expect due to the goal of being multi-mod compatible, rotations are additive so whatever the base rotation is, if you add a another rotation, it will add the angles. Same with position, scales get multiplied.

 

Passing an empty key "" will give you the base transformation data (Which you can pass to the inverse function so you can produce a transform to "undo" the base, putting it at the origin if you want). The base transform is whatever is in the actual nif, not what is currently loaded on the skeleton, far more reliable than acquiring the value from the skeleton, which could very well have been altered many times prior to acquiring it.

 

The API is serialized so you don't need to load anything on game reload nor when an actor's 3d is loaded. It's included in RM 2.9.5+ and NiOverride Standalone 2.9.5+

 

Only major drawback is that the changes are not removed with the mod, you will have to delete the changes prior to uninstalling otherwise they will persist in the save.

Posted

 

 

Did you guys ever get SexLabUtil.SetNodeRotation to work?  It would be nice if I could rotate a bone on an actor.

 

I could never wrap my head around the rotation matrix stuff it uses. B3lisaro appears to have figured it out though and released a plugin for it: http://www.loverslab.com/files/file/1362-skeletonutils/

 

https://github.com/expired6978/skyui/blob/master/racemenu_dist/Data/Scripts/Source/NiOverride.psc

 

Similar function at line 321, euler is heading, attitude, bank in degrees, optionally you can work with the 3x3 but euler angles make more sense.

 

The rotations from this API work a little different from what you would expect due to the goal of being multi-mod compatible, rotations are additive so whatever the base rotation is, if you add a another rotation, it will add the angles. Same with position, scales get multiplied.

 

Passing an empty key "" will give you the base transformation data (Which you can pass to the inverse function so you can produce a transform to "undo" the base, putting it at the origin if you want). The base transform is whatever is in the actual nif, not what is currently loaded on the skeleton, far more reliable than acquiring the value from the skeleton, which could very well have been altered many times prior to acquiring it.

 

The API is serialized so you don't need to load anything on game reload nor when an actor's 3d is loaded. It's included in RM 2.9.5+ and NiOverride Standalone 2.9.5+

 

Only major drawback is that the changes are not removed with the mod, you will have to delete the changes prior to uninstalling otherwise they will persist in the save.

 

 

 

You lost me at the word euler.

 

I am not a math persons. My recent desperate attempts at making the sideways adjustments in sexlab more consistent pretty much consisted of me spending some 15+ hours of throwing random sin/cos/tan/cot/csc/sec functions at the wall in an ultimately completely random and fruitless fashion.

 

Regardless, it has little to no bearing in the current SexLab, the only reason I was investigating node rotation to begin with was for plans to develop SexLab's own first person camera mode. The related talks however resulted in the creation of Immersive First Person View, which made all my plans to create a SexLab 1st person mode complete moot and the node rotation stuff all fell by the wayside as unimportant.

Posted

http://www.loverslab.com/uploads/deardiary.jpg

 

if the administrator (?!) this "forum" gives a picture of Stalin, sorry but it is an idiot and a moron, boy, how old are you?

 

Did not know it was Stalin, I just thought it was a  picture an older era war person writing a letter, a picture which I thought would be fitting for what is a development blog thread for me to write down progress and ideas in.

 

Confirming now that it's Stalin, yes, it's in bad taste and now removed. 

 

Thank you for informing me of the mistake in such a calm and mature manner.

Posted

I thought Ashal was making fun of himself; he's as far from being a dictator as a site owner can be, but he still gets accused of it.  Then again, I'm not the kind of person who scours the net for reasons to be offended, either.

 

Ah, gotta love the public school system.  In another generation or so, folks won't know what Hitler looked like.

 

Anyway, back on topic, with your updates, Ashal, do you recommend evening the heights of the actors?  It would seem that particular function could either make your alignments easier or break them entirely and I'm not sure which way to go.

Posted

Anyway, back on topic, with your updates, Ashal, do you recommend evening the heights of the actors?  It would seem that particular function could either make your alignments easier or break them entirely and I'm not sure which way to go.

 

I wouldn't recommend it personally.

 

It was useful for when adjustments to animations were saved to a single global list for all races, it standardized things so the adjustments were more likely to work well for multiple races. Now however it's split out to saving individual adjustments between race combinations, you can get much results with that without sacrificing height differences between races, it just takes a little more work to build up your adjustment profile.

 

 

 

I thought Ashal was making fun of himself; he's as far from being a dictator as a site owner can be, but he still gets accused of it.  Then again, I'm not the kind of person who scours the net for reasons to be offended, either.

 

Ah, gotta love the public school system.  In another generation or so, folks won't know what Hitler looked like.

 

I was more going for the cliched movie scene of civil or revolutionary soldier on front lines writing home about how the war is going (for example: https://www.youtube.com/watch?v=hdbsehyk0uw#t=23) the exaggerated analogy being developing a mod and providing tech support for it is like the hells of war, and this thread is my letter back home informing the family of updates.

 

Hitler is obviously easy to recognize, he did after all basically steal an entire mustache style from ever being used again. Stalin not so much, not like I don't know who he is or what he did, I could recognize him if it was put in context of "here's some pictures of the soviet union" outside of that though my context was simply common internet meme image ( http://knowyourmeme.com/memes/dear-diary )

 

In any case, it was a bad joke nobody but me got and now that I know it's removed and I mostly just feel bad thinking people may have seen it and gotten the wrong impression.

Posted

I was wondering if sexlab is able to differentiate between environments stuff lying around

 

 

 

post-160974-0-20413500-1413635212_thumb.jpgpost-160974-0-09080900-1413635214_thumb.jpgpost-160974-0-60494600-1413635215_thumb.jpgpost-160974-0-42731700-1413635217_thumb.jpgpost-160974-0-56951800-1413635219_thumb.jpgpost-160974-0-00604600-1413635221_thumb.jpg

 

 

 

Like mainly chairs, table, wall etc.. ?? i know it can detect beds, but what about someone make animation for like chair or table, and sexlab will force the animation on nearby table ?? Not sure how hard it will be, will really get me into try making animation for skyrim next.

Posted

I was wondering if sexlab is able to differentiate between environments stuff lying around

 

 

 

 

Like mainly chairs, table, wall etc.. ?? i know it can detect beds, but what about someone make animation for like chair or table, and sexlab will force the animation on nearby table ?? Not sure how hard it will be, will really get me into try making animation for skyrim next.

 

the trouble with that though is the "Clutter" like food and plates will fly all around the place. The placement it self well as there is one for beds perhaps a sommilar scrips could be used.

Posted

Well, I don't believe SexLab can, but it wouldn't be too hard to do as an addon.

 

It would need a script to find all the furniture and idle markers inside a given radius, discard the ones that don't have animations, and then discard the animations that don't have suitable markers nearby. That and apply the Sexlab filtering for actors and tags.

 

With that in place you could feed the resulting animation array to SexLab and (I think) it would with most existing mods. Might need a bit of tweaking for actor positioning, but that could probably done when defining the SexLab animation data.

 

So doable I'd say, but probably not supported.

 

The other approach, I suppose, would be to allow a list of compatible markers to be defined when the animation was defined, and to generalise the concept of "bed" to include any defined markers... but I suspect there are hidden pitfalls to that approach.

Posted

The other approach, I suppose, would be to allow a list of compatible markers to be defined when the animation was defined, and to generalise the concept of "bed" to include any defined markers... but I suspect there are hidden pitfalls to that approach.

 

I had this sort of implementation planned a little while ago. Arrok was/is working on "sideways bed" animations, where the male is standing off the bed and the female laying sideways on it. To implement them I was planning on providing an API for listing valid markers for the animation and any associated positioning alterations.

Posted

Hi Ashal

 

There is one suggestion I meant to make for a while... I hope this is the right place to post it,

 

If there is one feature I would like to see in future versions of sexlab, more than an arousal system would be a setting for enforcing gender preferences.

 

I have that kind of setting in SD+, with a value of 0 for 'no preference', 1 for 'same sex only' and 2 for 'opposite sex only'.

 

I use it to add filters to some animations with this kind of contortions:

If ( (genderRestrictions  == 1) && (speakerGender  == targetGender ) )
   If (speakerGender  == 0)
      SexLabInTags = SexLabInTags + ",MM"
   Else
      SexLabInTags = SexLabInTags + ",FF"
   EndIf
EndIf

If SexLab had an optional feature built-in to force / filter animations based on gender preferences, it would solve a lot of quirks and checks in other mods.

Posted

Hi Ashal

 

There is one suggestion I meant to make for a while... I hope this is the right place to post it,

 

If there is one feature I would like to see in future versions of sexlab, more than an arousal system would be a setting for enforcing gender preferences.

 

I have that kind of setting in SD+, with a value of 0 for 'no preference', 1 for 'same sex only' and 2 for 'opposite sex only'.

 

I use it to add filters to some animations with this kind of contortions:

If ( (genderRestrictions  == 1) && (speakerGender  == targetGender ) )
   If (speakerGender  == 0)
      SexLabInTags = SexLabInTags + ",MM"
   Else
      SexLabInTags = SexLabInTags + ",FF"
   EndIf
EndIf

If SexLab had an optional feature built-in to force / filter animations based on gender preferences, it would solve a lot of quirks and checks in other mods.

 

Such decisions should be up to the individual SexLab mod starting the scene, not SexLab itself. I'd rather SexLab remain completely agnostic in all scenes. It's up to individual mods if they want to enforce some gender preference limitation or not, SexLab itself doing it feels like getting in the way of the mod makers intentions to me.

 

The tools for checking an actors gender preference already exists with SexLab.IsGay/Straight/Bisexual(), whether or not the mod in question chooses to respect that preference is entirely up to it.

Posted

 

Hi Ashal

 

There is one suggestion I meant to make for a while... I hope this is the right place to post it,

 

If there is one feature I would like to see in future versions of sexlab, more than an arousal system would be a setting for enforcing gender preferences.

 

I have that kind of setting in SD+, with a value of 0 for 'no preference', 1 for 'same sex only' and 2 for 'opposite sex only'.

 

I use it to add filters to some animations with this kind of contortions:

If ( (genderRestrictions  == 1) && (speakerGender  == targetGender ) )
   If (speakerGender  == 0)
      SexLabInTags = SexLabInTags + ",MM"
   Else
      SexLabInTags = SexLabInTags + ",FF"
   EndIf
EndIf

If SexLab had an optional feature built-in to force / filter animations based on gender preferences, it would solve a lot of quirks and checks in other mods.

 

Such decisions should be up to the individual SexLab mod starting the scene, not SexLab itself. I'd rather SexLab remain completely agnostic in all scenes. It's up to individual mods if they want to enforce some gender preference limitation or not, SexLab itself doing it feels like getting in the way of the mod makers intentions to me.

 

The tools for checking an actors gender preference already exists with SexLab.IsGay/Straight/Bisexual(), whether or not the mod in question chooses to respect that preference is entirely up to it.

 

 

Thta's cool. I understand the design choice :) 

 

The reason I asked is twofold:

 

- as a user, I would find it convenient to be able to chose to enforce my preferences across all mods I am using. It would be good, for example, to see a male and female character not use a lesbian animation if I don't want to.

 

- as a modder, asking all mods to implement their own version of gender preference seems like a lot of inconsistent and duplicated effort. 

 

Anyway.. I already have that implement in SD, so I don't particularly need it from SexLab. I was just thinking in term of a framework option.

Posted

While I have no interest in implementing it on a framework level, enforcing such a preference globally regardless of mod is entirely within current SexLab capability with relative ease if a 3rd party mod were to wish to implement such a feature. It's just a matter of a mod actually implementing it. 

 

Simply add the actor whose preferences you want to restrict to a faction, adding that faction to the sexlab tracked factions list to register a callback for whenever an actor in that faction is added to a sexlab scene, when receiving the callback; check faction rank as a means to identify sexual preference, if other actors present in the scene don't fit with that preference, than kill the thread before it ever starts.

 

I can't speak 100% to the specifics or "smoothness" of such an implementation, but as far as I remember of the API I've added and tested, it should be pretty easily attainable - the specifics of adding an actor to such a mods preference faction notwithstanding. 

 

Admitablly however I have provided literally zero documentation for tracked faction and tracked actor callback API. Everytime I try to convince myself to spend time updating SexLab's API docs I end up deciding to spend time on actually expanding the API instead, it's a pretty vicious circle. So it's 100% my own damn fault considering how much time between updates I spend implementing new API features for modders to use instead of writing documentation for the existing stuff. It kinda breaks my heart though to see how few mods ever even make use of the majority of API, I'd hazard a semi-educated guess that 75% of the current SexLab modder API is entirely unused. :wacko:

Posted

On the other hand, it feels exciting when we look something up in the code and come across a cool, undocumented feature :)

 

I will take a look at the faction thing when I get a chance. I was thinking if it would be possible to move the gender restriction part of SD into a mod event to hijack the tags before sexlab animations start.

 

I should probably spend more time reading this thread too :)

Posted

I will take a look at the faction thing when I get a chance. I was thinking if it would be possible to move the gender restriction part of SD into a mod event to hijack the tags before sexlab animations start.

 

I should probably spend more time reading this thread too :)

 

To give you a hastily written and untested example of what doing so would generally look like:

; // Faction rank < 0  or NOT in faction = Bisexual / no restriction
; // Faction rank == 0 = Male partners only
; // Faction rank == 1 = Female partners only
Faction CustomSexualityFaction

SexLab.TrackFaction(CustomSexualityFaction, "ForceSexuality")
RegisterForModEvent("ForceSexuality_Added", "ActorAdded")

event ActorAdded(Form TrackedForm, int tid)
	sslThreadController Thread = SexLab.GetController(tid)
	Actor TrackedActor = TrackedForm as Actor

	int LikedGender = TrackedActor.GetFactionRank(CustomSexualityFaction)
	if LikedGender >= 0 && TrackedACtor.IsInFaction(CustomSexualityFaction)
		int i = Thread.Positions.Length
		while i
			i -= 1
			if Thread.Positions[i] != TrackedActor && SexLab.GetGender(Thread.Positions[i]) != LikedGender
				Thread.EndAnimation(true) ; //  Cancel the upcoming animation due to a present actor not being preferred gender
			endIf
		endWhile
	endIf
endEvent

The default track actor/faction hook events for SexLab are

  • Added - when added to a scene, before preparation
  • Start - after preparation, but before animation
  • End - soon as cleanup and actor reset for removal from a scene starts.

 

As should be obvious from the name of the relevant tracking functions, TrackActor() and TrackFaction(), you can use either specific actors or a faction. Anytime an actor is added to a SexLab scene they will be checked for either being contained in the tracked actors list, or if they belong to any of the factions currently tracked. If either is true than SexLab will send an for "<custom callback>_<event hook>" relevant to that actor.

 

On the other hand, it feels exciting when we look something up in the code and come across a cool, undocumented feature 

The problem there is not everybody making mods knows Papyrus well enough to look something up in the code, and even if the do know it really well it's unrealistic of me to expect them all to breakdown and understand the intentions of all the source code.

 

I will change the non-API portions of SexLab with reckless abandon and not make any effort to note those changes in the changelog between versions.

 

I do however make effort to to ensure the clearly noted API function in SexLabFramework.psc and other functions I personally consider to be part of the API remain backwards compatible with previous mods between updates.

 

Outside of SexLabFramework.psc however, the current source makes zero effort to make the same effort to identify what is considered part of the API vs what is considered part of the internal system and should NOT be used by modders. A lot of features I'd argue that are pretty useful and unique are left by the wayside as a result.

 

Posted

Well, I don't believe SexLab can, but it wouldn't be too hard to do as an addon.

 

It would need a script to find all the furniture and idle markers inside a given radius, discard the ones that don't have animations, and then discard the animations that don't have suitable markers nearby. That and apply the Sexlab filtering for actors and tags.

 

With that in place you could feed the resulting animation array to SexLab and (I think) it would with most existing mods. Might need a bit of tweaking for actor positioning, but that could probably done when defining the SexLab animation data.

 

 

Would something like this also have the benefit of reducing clipping that arousal based mods often have because they are usually triggered indoor? 

 

Posted

 

 

 

It would need a script to find all the furniture and idle markers inside a given radius, discard the ones that don't have animations, and then discard the animations that don't have suitable markers nearby. That and apply the Sexlab filtering for actors and tags.

 

Would something like this also have the benefit of reducing clipping that arousal based mods often have because they are usually triggered indoor

Possibly, depending on how it's done.

 

The trouble is that a table lean marker will have been set up with enough space for the standard "lean-on-table" animation. There's no guarantee that a "bonking-on-table" animation won't result in her clipping her head through the wall, or him scattering stuff on the sideboard behind him.

 

You could mitigate this by adding new markers (assuming someone wants to make the models for the CK). Then you could be fairly sure that the modder placed them somewhere that didn't scatter anything (at least not in the modders development setup anyway). But then you have the mammoth task of adding new markers to interiors all over Skyrim and doing it without conflicting with other mods.

 

So overall, I guess that's a "probably not" :(

Posted

 

Being able to set a marker position for sex to occur (whether using furniture or not) would be of use to any mod where you expect sex to occur in an area and you'd like it to occur in specific location because you know it's a clear place where clipping won't happen.

Posted

If you know there's something going to happen and want to set the place, you can use a scene.

 

Set some XMarkerHeaders, move the principals onto their marks and trigger the action while they run a DoNothing package.

 

Posted

If you know there's something going to happen and want to set the place, you can use a scene. Set some XMarkerHeaders, move the principals onto their marks and trigger the action while they run a DoNothing package.

But even then you can't precisely control where the action takes place like you could with a "Have Sex right here" marker.

Posted

 

If you know there's something going to happen and want to set the place, you can use a scene. Set some XMarkerHeaders, move the principals onto their marks and trigger the action while they run a DoNothing package.

But even then you can't precisely control where the action takes place like you could with a "Have Sex right here" marker.

 

 

This already exists.

 

During thread setup you can tell the thread where to base all of it's location calculations using a specific object as the center point:

Thread.CenterOnObject(HaveSexHereMarker) 

Or if using the StartSex() function, you can define the center object using the CenterOn argument.

SexLab.StartSex(Positions, Anims, CenterOn = HaveSexHereMarker)

It doesn't necessarily have to be a marker object either, just any ObjectReference, such as a bed or a specific actor you want the animations to center on.

 

 

If this isn't called manually by a mod during thread setup, SexLab will run through a list of defaults to select a center object itself, in defaults to these 3 in order of priority, if it fails to find one it defaults to the next.

  1. SexLab static location markers, which can be found in the esm file and placed in cells by other mods to set ideal animating locations in the world.
  2. Scan the area for beds and if it finds one and ask the player if they want to use it, or if the player isn't present default to whatever the NPC beds option is set to.
  3. If no location marker or bed are selected, it simply forces the thread to center on the first actor in the scene.

 

 

There is also another location setting function mods can call:

Thread.CenterOnCoords(x, y, z, rx, ry, rz)

However this has to be called AFTER the thread has already, directly after your Thread.StartThread(), StartSex() or QuickStart() call to start a scene. As the above defaulting SexLab does to pick a center location is run if the thread doesn't have a center object, CenterOnCoords() doesn't set a center object, only the coordinates, so calling it before the thread start will just have it be overwritten.

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...