Jump to content

SexLab Framework Development


Recommended Posts

Hm, hit a snag with trying to figure it out for forward adjustments. I have it accurately working with Up/down adjustments on the Z-axis. However with forward adjustments, they are on a 3d plane. After playing with it some I'm left completely clueless on how to best calculate how much the actor needs to be moved forward or backward.

 

I have a calculation for getting the distance between the two skeleton nodes, however after some testing I realized a major flaw in that; if the two actors nodes have a distance between them of 10 units, that does nothing to tell me if that is 10 units back or 10 unites forward, since it's just distance it could be either way and I haven't a clue how to determine if I should be subtracting or adding 10 units to the actors forward alignment.

If you can get the distance between two skeleton nodes then pick common nodes on opposite sides of the bodies, if the distance between the front nodes is the same as the distance between the back nodes (or very small) then they are facing the same direction while if there's large difference then they are facing each other.

 

Then of course you also need to know which way they should face for that sex act.

Link to comment

Ideally, I'd like to have to have to add nothing more to animation setup other than names of nodes and their distances for up/down and forward/back. With my current implementation and understanding of this potential feature, I'll have to go through everything single animation and every single animation stage to determine their ideal forward+up tolerances between selected nodes. Which is a lot of tedious work as is; I'm fairly certain there is a way to determine if the actor is to far forward or backward so I won't have to complicate that implementation further. Perhaps by taking their full coordinates and the animations general offsets into account.

Link to comment

I have a suggestion that I would like to throw into the room:

 

SOS has a feature that can toggle armor as "revealing", i.e. the schlong shows even though you are wearing the armor. If that could be accessed from SexLab (I think it's a spell), I suggest to add a new MCM checkbox that says: "Set non-revealing armor as revealing during sex".

 

Then, when a sex act occurs, the framework should do this:

  1. Check if the option is set and the armor worn by the PC is not already marked as revealing.
  2. If both true, set the armor as revealing.
  3. Continue with the sex act.
  4. At the end and if the option is set, restore the previous state of the armor (i.e. set it back to non-revealing if it was before)

 

It would be like: Hey, I'm so horny, I don't bother to undress. I just open my fly, take it out and start humping. But of course I don't run around with an open fly, so afterwards, I put the penis back in and close the fly.

 

Right now this does not really work because if you select that the actor shall not undress, then there is also no schlong in the scene.

Link to comment

Ideally, I'd like to have to have to add nothing more to animation setup other than names of nodes and their distances for up/down and forward/back. With my current implementation and understanding of this potential feature, I'll have to go through everything single animation and every single animation stage to determine their ideal forward+up tolerances between selected nodes. Which is a lot of tedious work as is; I'm fairly certain there is a way to determine if the actor is to far forward or backward so I won't have to complicate that implementation further. Perhaps by taking their full coordinates and the animations general offsets into account.

My head hurts just thinking about 3 & 4 way animations.

Link to comment

Hi Ashal  (or others)

this is a very noob question and I'm obviously missing something

 

I'm implementing a simple toggle key to strip and unstrip the actor

actor akMe = Game.GetPlayer()
			
			if Stripped == 0
					form[] ActorEquipment = SexLab.StripActor(akMe, DoAnimate = false)
					utility.wait(5.0)
					Stripped = 1					
			 else
					
					SexLab.UnstripActor(akMe, ActorEquipment)
					Debug.MessageBox("Hello, World!")
			 		Stripped = 0
			 EndIf

 This won't compile as ActorEquipment is undefined on unstrip...why? How do I call the form previously stripped?

or how I define the form previously? 

from the wiki :

form[] - An array of all the weapon and armor forms removed from them. Should be saved if you wish to restore them to their previous equipment using UnstripActor()

How do I save the array?

This is surely very noobish but I'm not a programmer, just tinkering :P

thanks for the help

Link to comment

try this:

actor akMe = Game.GetPlayer()
		
	form[] ActorEquipment
	if Stripped == 0
			SexLab.StripActor(akMe, DoAnimate = false)
			utility.wait(5.0)
			Stripped = 1					
	 else
			
			SexLab.UnstripActor(akMe, ActorEquipment)
			Debug.MessageBox("Hello, World!")
			Stripped = 0
	 EndIf

Thanks I ll try this when I get home, I knew it was something obvious.. Still have to learn some syntax and mechanics

Link to comment

Yeah, I think the compile issue is just one of scoping. Your array definition was only valid inside the block where it was defined. (Disclaimer - I don't have access to a papyrus compiler at work, either :))

 

As for saving the array, you can probably get away with just keeping a reference to it somewhere non-volatile. The array variable defined in the function will disappear when the function exits, and if that was the last variable pointing at your array then the array will be recycled too.

 

Simplest solution is probably to use a script property to hold them. That uses a global var, so it's secure over separate invocations of the function, and property values get baked into saves, so it should persist over save and reload.

 

The other thing worth looking at for that function is states. Rather than use a variable, you could write that as:

form[] property ActorEquipment = none auto
actor property me auto			; about x100 faster than game.getplayer()

auto state Clothed			; auto means the script starts in this state
	function toggle_clothes()
			SexLab.StripActor(me, DoAnimate = false)
			utility.wait(5.0)
			gotostate("Nekkid")
	endfunction
endstate

state Nekkid
	function toggle_clothes()
			SexLab.UnstripActor(akMe, ActorEquipment)
			gotostate("Clothed")
	endfunction
endstate

function toggle_clothes()	// this just cause the blank state needs a definition
endfunction

OK, it's lunchtime and I'm bored :)

 

Also: repeat disclaimer - written without a compiler to test it.

Link to comment

Wow that's a lot to study lol thanks
What you do in your lunchtime takes me hours :P
I dont know if i'm interested in saving the state.. (EDIT: maybe it's better instead..)
What I'm trying to do is simply have a key to strip and redress the player for immersion purpose. You want to take a bath in innalta lake or a river for relaxing, you just press a key and go in, when done another key hit and redress.
Right now its almost working with your help, and I have an mcm to choose the key and to activate or deactivate the mod.
I thought to use SL framework since the code is already there so it was simple even for a noob like me.
I just stated that this could be directly
Implemented in SL since its so simple and useful, even if not strictly sex related (or not :P ) , but ashal rules so it's up to him
Thanks for your help and examples, very useful

Link to comment

This work great :

form[] property ActorEquipment = none auto

actor property me auto			; about x100 faster than game.getplayer()

;====================

;====================

auto state Clothed			; auto means the script starts in this state
		
		function toggle_clothes()
				
				ActorEquipment = SexLab.StripActor(me, DoAnimate = false)
				Debug.MessageBox("You are naked")
				;utility.wait(5.0)
				gotostate("Nekkid")
				
		endfunction
		
endstate

state Nekkid
		
		function toggle_clothes()
				
				SexLab.UnstripActor(me, ActorEquipment)
				Debug.MessageBox("you are dressed")
				gotostate("Clothed")
				
		endfunction
		
endstate


function toggle_clothes()	; this just cause the blank state needs a definition
		Debug.MessageBox("Hello, World!")
endfunction

Didn't know the states , very handy They  are  saved in the save file 

Now , if only I had a function to check if the player is stripped or naked , the script would be smarter

 

thank you very much

Link to comment

This work great :

form[] property ActorEquipment = none auto

actor property me auto			; about x100 faster than game.getplayer()

;====================

;====================

auto state Clothed			; auto means the script starts in this state
		
		function toggle_clothes()
				
				ActorEquipment = SexLab.StripActor(me, DoAnimate = false)
				Debug.MessageBox("You are naked")
				;utility.wait(5.0)
				gotostate("Nekkid")
				
		endfunction

                function isClothed()
                                return true
                endfunction
		
endstate

state Nekkid
		
		function toggle_clothes()
				
				SexLab.UnstripActor(me, ActorEquipment)
				Debug.MessageBox("you are dressed")
				gotostate("Clothed")
				
		endfunction
		
                function isClothed()
                                return false
                endfunction
endstate


function toggle_clothes()	; this just cause the blank state needs a definition
		Debug.MessageBox("Hello, World!")
endfunction
Didn't know the states , very handy They  are  saved in the save file 

Now , if only I had a function to check if the player is stripped or naked , the script would be more smart

 

thank you very much

 

States make the isClothed() function easy.

Link to comment
  • 3 weeks later...

I think the 'Arrok Devil's Threeway' animation is bugged in 1.59b. I've been working updating my mod to support changes with sslActorLibrary having been moved or changed, and noticed that I can trigger all the other threesome animations if I enable them individually in SexLab, yet if I enable Devil's Threeway and turn off the other animations, sex doesn't start and the NPCs involved fly up to the sky a few seconds later.

Link to comment

Ahsal,

 

Any chance of something like the following in sslThreadController?

 

	function ChangeAnimationTo(int Index)
		UnregisterForUpdate()
		SetAnimation(Index)
		SendThreadEvent("AnimationChange")
		RegisterForSingleUpdate(0.4)
	endFunction
It's basically the same as ChangeAnimation but with an absolute index.

 

I'm trying to script a scene which needs a sequence of specific acts to happen in order. When we get near the final stage in one animation, I switch to the next one and set the stage back to 0. When there's just two animations to consider ChangeAnimation works well enough. For more than that, I start to worry about timing issues and spamming mod events.

 

The other thing that would work would be a flag to turn off the randomisation of the starting point and let the animations progress in the order defined in the array.

 

Also, a question if I may: what's the best way of specifying a particular animation after a call to ChangeActors? Not that it's desperately important - by my reckoning I should get two possible candidates, so switching to the one I want should be painless enough. Still, I'd like to make my code robust against the day when someone makes some more possibilities and my scene breaks.

 

[edit]

 

Did some more experimenting. It's possible to handle fixed-sequence animations with AddAnimation. Basically

 

* start the scene with a single animation in the list

* hook stage-start

* when the final stage starts , set stage back to zero, add the next animations, register for single update

* in onUpdate call ChangeAnimation and move on to the new animation

* repeat as needed.

 

Still haven't managed to combine this with ChangeActors yet - partly because I didn't get to that bit until late last night, and when I did I used AddActor, which is just plain wrong.

 

[edit]

 

Having problems with ChangeActors. I tried this:

 

		new_cast[0] = girl
		new_cast[1] = boy
		new_cast[2] = boss
		ctrl.IsAggressive = false	; need to turn this off, or no animations found
		ctrl.ChangeActors(new_cast)
But I end up with the girl floating six foot off the ground; the boy on the ground but about six foot away and the boss standing fully clothed and just watching.

 

Going to try a couple of other things and see if I can make it work.

Link to comment

Hiii to All !!!

 

 

Firstly, my Congratulations on creating an AWWWESOMMME mod ! This makes skyrim better than real life ! :P [ There was a time when my fondest wish was to have sex with Lydia ...imagine my plight when i could not even sleep in the same bed with her in BreezeHome..even after Marriage !!!! :@ ]...i profusely thank the makers and  the community for sharing Sexlab with us ......

 

I have a few suggestions though....

 

1). a categorization of the sex positions like ..for example...

 

   [Vaginal sex] ----- Missionary

    

                             Doggy     etc

 

  

   [ Lesbian ]  --------- Fem Dom etc

 

   [ Threesome ]------- Arrok Tri-cycle

                              

                                 Devil's Threeway etc

 

   [ Mastubation ]------- Fisting      etc

 

 

  [ Anal ]-----------------------I haven't checked it out yet ;)

 

 

                                             According to me, This would better organize the already Great mod that SexLab is !

 

 

Once again, Thanks a million !!!!! :D

Link to comment

Did something change with sslUtility.ArgString() recently? If the string given to it ends with the delimiter, it seems to add the delimiter as the last member of the returned array, which didn't happen earlier.

 

as far as I can see checking the last 3 changes to the script at http://git.loverslab.com/sexlab/framework/commits/development/scripts/Source/sslUtility.psc nothing related to argstring has changed. Only string related change I'm seeing is some updates to the error handling for TrimStringArray() in the last commit, but ArgString() doesn't use that.

 

As a semi-related heads up though, I plan most of all the sslUtility functions out of that script and into a PapyrusUtil related one (probably PapyrusUtil.psc). They have uses outside of SexLab, so better to include them with the 3rd party library other mods can use.

Link to comment

This is a great mod, may I ask if having a mod such as requiem installed would conflict badly?

 

The framework itself doesn't change anything and doesn't add anything relevant to Requiem, so it shouldn't have any conflicts. SexLab related mods might have some conflicts depending on what they do, but should be laregely unaffected.

 

The Skyrim install I develop SexLab in and play the game with has Requiem installed and I haven't noticed anything that stands out to me. Both before and after updating to Requiem 1.8

Link to comment

Ahsal,

 

Any chance of something like the following in sslThreadController?

 

	function ChangeAnimationTo(int Index)
		UnregisterForUpdate()
		SetAnimation(Index)
		SendThreadEvent("AnimationChange")
		RegisterForSingleUpdate(0.4)
	endFunction
It's basically the same as ChangeAnimation but with an absolute index.

 

I'm trying to script a scene which needs a sequence of specific acts to happen in order. When we get near the final stage in one animation, I switch to the next one and set the stage back to 0. When there's just two animations to consider ChangeAnimation works well enough. For more than that, I start to worry about timing issues and spamming mod events.

 

Sure, I'll add it in next update. Sorry I missed it in this last one, got lazy and forgot to check the development thread before finalizing it.

 

The other thing that would work would be a flag to turn off the randomisation of the starting point and let the animations progress in the order defined in the array.

 

Also, a question if I may: what's the best way of specifying a particular animation after a call to ChangeActors? Not that it's desperately important - by my reckoning I should get two possible candidates, so switching to the one I want should be painless enough. Still, I'd like to make my code robust against the day when someone makes some more possibilities and my scene breaks.

There isn't currently. When ChangeActors() is called it checks the current number of actors vs the new number of actors, and if it's changed than the current animations are invalid so it automatically grabs new defaults.

 

In future updates I'll set it to allow for an additional option to change the animations to after the actor swap rather than selecting defaults.

 

Currently the best way to do it would be to just EndAnimation(quick = true) the scene and quickly start up a new one with the new actors and new animations afterwards. Or just make due with the second or two of lag between SexLab selecting new default animations and being replaced by the new set of animations.

 

Did some more experimenting. It's possible to handle fixed-sequence animations with AddAnimation. Basically

 

* start the scene with a single animation in the list

* hook stage-start

* when the final stage starts , set stage back to zero, add the next animations, register for single update

* in onUpdate call ChangeAnimation and move on to the new animation

* repeat as needed.

 

Still haven't managed to combine this with ChangeActors yet - partly because I didn't get to that bit until late last night, and when I did I used AddActor, which is just plain wrong.

Rather than ChangeAnimation you might get smoother results by doing

Thread.SetForcedAnimations(SingleAnimationArray)
Thread.SetAnimation(0)
Thread.SetStage(1)
If it's just a 2 animation sequence your doing, you could just use LeadIn, set the LeadIn animations to the single starting animation, and the primary animations to the second single animation.

 

 

 

Having problems with ChangeActors. I tried this:

 

		new_cast[0] = girl
		new_cast[1] = boy
		new_cast[2] = boss
		ctrl.IsAggressive = false	; need to turn this off, or no animations found
		ctrl.ChangeActors(new_cast)
But I end up with the girl floating six foot off the ground; the boy on the ground but about six foot away and the boss standing fully clothed and just watching.

 

Going to try a couple of other things and see if I can make it work.

 

Try ctrl.RealignActors()so they are all forced to renew their information. Failing that, check the debug log for any errors that might have happened as the result of ChangeActors()

Link to comment

Currently the best way to do it would be to just EndAnimation(quick = true) the scene and quickly start up a new one with the new actors and new animations afterwards. Or just make due with the second or two of lag between SexLab selecting new default animations and being replaced by the new set of animations.

 

I missed the "quick" flag. I'll try that.

 

Rather than ChangeAnimation you might get smoother results by doing

 

	Thread.SetForcedAnimations(SingleAnimationArray)
	Thread.SetAnimation(0)
	Thread.SetStage(1)
If it's just a 2 animation sequence your doing, you could just use LeadIn, set the LeadIn animations to the single starting animation, and the primary animations to the second single animation.

The plan is to go all round the houses and finish up with a spit roast :) I'll try the transition code. It's a lot cleaner than what I have now, certainly :)

 

Try ctrl.RealignActors()so they are all forced to renew their information. Failing that, check the debug log for any errors that might have happened as the result of ChangeActors()

 

I'm not sure what happened there. Last test I ran it worked just fine, albeit with the wrong animation. I think I'll try the quick-end approach first.

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