Jump to content

Conditional StopAnimating/UnlockActor to prevent actor leaving furniture?


Recommended Posts

Pretty please, could someone help me with a rather annoying problem with SexLab, which is:

It resets both actors at the end of animation.

(clearly desirable behaviour under most circumstances, except in this case)

 

An example:

I order my follower to get into Zaz pillory, and then i talk to her again to start sexual intercourse by selecting appropriate dialog choice.

After the action is over, i want the follower to stay locked in the pillory, but SexLab resets both actors, causing the follower to stand up and leave the pillory.

 

I could be wrong, but i think the responsible code is inside StopAnimating() and UnlockActor() functions in sslActorAlias.psc,

particullary the following lines:

Debug.SendAnimationEvent(ActorRef, "IdleForceDefaultState")

ActorRef.SetVehicle(none)

ActorRef.SetRestrained(false)

ActorRef.SetDontMove(false)
 

...would it be possible to make some alterations to the SexLab framework, wrapping these lines in some condition allowing me to skip them when desired?

 

I tried to make some changes to the code myself, so i could maybe offer a solution while i am at it, but my code had no effect whatsoever, so maybe those arent the right lines of code that needs to be changed???

Made a mistake by editing wrong file :angel:, after correcting that mistake, it worked like a charm!

I'll try to rewrite the crude changes i made into a properly polished code and post it here soon (would be great if it could be officially integrated into SexLab).

Still, any help or pointers would be much appreciated.

Link to comment

If you just want a hacked in fix, editing sslActorAlias.psc and the StopAnimation() function to something like this should do the trick properly and accurately.

function StopAnimating(bool Quick = false)
	if !ActorRef || (Position == 0 && Animation.HasTag("Pillory"))
		return
	endIf

Making the first actor in a pillory animation (the one in the pillory) not perform the StopAnimating at the end. You could add similiar to the UnlockActor() as well, but that is going to make the actor permanently stuck in place and possibly unable to play SexLab animations again.

 

A proper 3rd party mod solution would be to just do a SexLab hook on "AnimationEnding" and after SexLab has finished resetting the actor, reapply the pillory and use your own movement locking function that you can safely unlock later. It wouldn't be perfect in the sense that the actor would still visually get out of the pillory for a split second, but it'd be a hell of a lot safer in terms of not permanently breaking somebody.

 

I'll consider adding a solution for modders to specify stuff like this, but the possibility of permanently breaking an actor is high enough that I'd be hesitant, and it'd have to be made very clear that the responsibility is on the modder, not SexLab, to use it safely

Link to comment

Thank you very much Ashal.

 

In the meantime i already devised a custom "patch" for SexLab featuring a new threadModel function DisableStandUpEnd(actor, bool)

It can be used to prevent the standing up / leaving furniture for each actor separately.

Usage of this function is the same as with DisableRagdollEnd (which i used as a 'blueprint' for this, the new func is its blatant copypaste).

If you dont use this function, nothing changes from how everything behaves in default 'unpatched' SexLab.

 

For anyone interested, see the attachment with all altered files.

Changes (marked with "by roggvir" comment) were made to sslActorAlias.psc, sslActorLibrary.psc, sslSystemConfig.psc, and sslThreadModel.psc.

 

Any comments and improvement ideas are much appreciated.

DisableStandUpEnd for SexLab v1.59c.zip

Link to comment

I forgot to mention...

When using the DisableStandUpEnd function, it skips running the following lines of code at the end of animation:

Debug.SendAnimationEvent(ActorRef, "IdleForceDefaultState")
ActorRef.SetVehicle(none)
ActorRef.SetRestrained(false)
ActorRef.SetDontMove(false)

...resulting in the actor being unable to move, so you must take care yourself of making sure those lines of code will be somehow run when needed.

For example, in my test case i have an ObjectReference script attached to the pillory, and i run this code when player activates the pillory in order to release the follower from it.

Link to comment

I forgot to mention...

When using the DisableStandUpEnd function, it skips running the following lines of code at the end of animation:

Debug.SendAnimationEvent(ActorRef, "IdleForceDefaultState")
ActorRef.SetVehicle(none)
ActorRef.SetRestrained(false)
ActorRef.SetDontMove(false)
...resulting in the actor being unable to move, so you must take care yourself of making sure those lines of code will be somehow run when needed.

For example, in my test case i have an ObjectReference script attached to the pillory, and i run this code when player activates the pillory in order to release the follower from it.

 

Which is why I said

 

<snip>

 

but that is going to make the actor permanently stuck in place and possibly unable to play SexLab animations again.

 

<snip>

 

I'll consider adding a solution for modders to specify stuff like this, but the possibility of permanently breaking an actor is high enough that I'd be hesitant, and it'd have to be made very clear that the responsibility is on the modder, not SexLab, to use it safely

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use