Jump to content

SexLab Framework Development


Recommended Posts

I'm probably overlooking something stupid, but is there any easy way to look up the 'Times Victim' or other misc stats from SexLab?  I see code for registering and finding custom stats, but it isn't clear how to get the default stats.  Calling 'GetStatInt("Times Victim")' does not seem to work.

Link to comment

I'm probably overlooking something stupid, but is there any easy way to look up the 'Times Victim' or other misc stats from SexLab?  I see code for registering and finding custom stats, but it isn't clear how to get the default stats.  Calling 'GetStatInt("Times Victim")' does not seem to work.

 

GetStatInt("Victim")

 

Looked at what is used in the MCM menu to display that item.

Link to comment

I'm trying to write a scene where a fully clothed NPC fondles a naked heroine in public

 

I figure I can use StartSex as a template for the function, and Arrok Standing Foreplay seems to have the animation I want. Depending on how the player wants to RP it, the PC can either endure this or respond. Where I'm a little stuck is that

 

1) I may only want the male half of the animation

2) I want the male to remain clothed

 

What's the best way to go about it? Do I have to register a new sl animation? Or might I be better off using debug.sendAnimationEvent

 

Oh, I also want a repeat of the same scene, but with the guy standing behind. Hmm... it's going to be tricky finding a suitable responsive option for that one...

 

For 2), when building the thread you can use something like this:

bool[] noStrip = new bool[33] ; 33 times false
sslThreadModel thread = SexLab.NewThread()
thread.AddActor(player)
thread.AddActor(other)
thread.SetStrip(other, noStrip)

 

Link to comment

 

I figure I can use StartSex as a template for the function, and Arrok Standing Foreplay seems to have the animation I want. Depending on how the player wants to RP it, the PC can either endure this or respond. Where I'm a little stuck is that

 

1) I may only want the male half of the animation

2) I want the male to remain clothed

 

For 2), when building the thread you can use something like this:

bool[] noStrip = new bool[33] ; 33 times false
sslThreadModel thread = SexLab.NewThread()
thread.AddActor(player)
thread.AddActor(other)
thread.SetStrip(other, noStrip)

 

That looks useful, thanks! :)

 

For one, I've been thinking...

 

If I take ArrokStandingForeplay as my template, could I write something like this:

 

 

 

sslBaseAnimation function ArrokStandingForeplay(int id)
;
;       I don't know where to get an id - I'd prefer not to register
;       lest I break tother mods' scenes by having the female role in the foreplay
;       segments look cold and disinterested
;
;       of course, there are probably some that would see that as a feature rather than a bug...
;
        sslBaseAnimation Base = Create(id)
;
;       just to distinguish it from the original
;
        Base.Name = "QAYL Half-Arrok Standing Foreplay"
;
;       this doesn't look like it needs to change
;
        Base.SetContent(Foreplay)
;
;       whatever the female standing idle is called in the vanilla animations list
;
        int a1 = Base.AddPosition(Female)
        Base.AddPositionStage(a1, "default_female_idle", 0)
        Base.AddPositionStage(a1, "default_female_idle", 0)
        Base.AddPositionStage(a1, "default_female_idle", 0)
        Base.AddPositionStage(a1, "default_female_idle", 0)
;
;       tweaked the params here a little. don't want any male moans
;       and (since he's going to be dressed) no SOS response.
;       Should only ever happen with a male in this role, so no strapon either
;
;       female moans would be good at high arousal ... but that's another question.
;
        int a2 = Base.AddPosition(Male)
        Base.AddPositionStage(a2, "Arrok_StandingForeplay_A2_S1", -101, silent = true, strapon = false, sos = -1)
        Base.AddPositionStage(a2, "Arrok_StandingForeplay_A2_S2", -101, silent = true, strapon = false, sos = -1)
        Base.AddPositionStage(a2, "Arrok_StandingForeplay_A2_S3", -101, silent = true, strapon = false, sos = -1)
        Base.AddPositionStage(a2, "Arrok_StandingForeplay_A2_S4", -101, silent = true, strapon = false, sos = -1)
;
;       not using standard tags since I don't really want this showing up at random
;
        Base.AddTag("QAYL")
        Base.AddTag("D42")
;
;       do I need to save and register, or can I set the positions and the pass it to the
;       framework?
;
        Base.Save(id)
        return Base;            ; maybe just create on the fly?
endFunction

 

 

I'd prefer not to register the animation at all, since in most contexts it's simply a broken version of Arrok's standing FP.

 

Looking at the code for RegisterAnimation and Create, it seems I might be able to pass -1 as id, which might let me create a stand-alone, unregistered but usable animation.

Link to comment

Ashal.

 

Is there any chance you could add a option to untick all animations? I only have about 10-15 of the animations active and upgrading/reseting the mod reticks all animations that I then have to untick again.

 

If it isnt too much work any chance you could add a button to do this?

 

Sorry for bothering you.

Link to comment

There's something i don't get in the Animation Editor ( MCM Menu ). 

 

Is there a way to edit the curve ( bend ) of the player schlong per stage ? There's an option on the right, but it seems to only affect the other actor ( NPC ).

 

It would be nice if you could also modify these values for the player. Like that we would get pefect control over animation adjustement. 

 

Thanks. 

Link to comment

For me the chaurus keeps getting scaled up and I can't figure out why.

I can 'setscale 1' it and it'll return to normal but with the next anim it scales back up to somewhere between 1.5 and 2.

 

Not sure if its sexlab itself or another mod that I haven't thought of.

Edited by Zarks
Link to comment

Turns out that Phantom API was eventually implemented as NewAnimationObject and so forth.

 

Anyone know anywhere that NewAnimationObject API was used? I'm trying to find an example, but nothing in any of the usual suspects.

 

 

It's basically the same as creating regular animations, you just have some different methods of implementing them, namely either NewAnimationObject() which will immediately return an empty animation object for you to fill, or GetSetAnimationObject() which will retrieve an existing animation under the given token, OR if it doesn't exist, it will create that animation via the callback you give it and then return it, letting you both ensure the custom animation exists and is not duplicated accidentally.

 

The simplest method though is NewAnimationObject(), which works simply like so:

// ; Creatue your animation under the token "ShortForeplay" which you can use to retrieve
// ; it later if needed. Passing the form owner "self" tells it your script objects owns it
// ; if whatever you pass as owner ever becomes a none form (mod uninstalled) than the animation
// ; is automatically cleaned up and removed at start up.
sslBaseAnimation Anim = SexLab.NewAnimationObject("ShortForeplay", self)

// ; Make sure we actually retrieved the animatino and it's empty before setting it up
if Anim != none && Anim.Name != "Short Foreplay"
	// ; At this point it basically becomes no different than creating animations in their callbacks
	// ; as seen in sslAnimationDefaults.psc, config properties can be accessed from SexLab.Factory

	Anim.Name = "Short Foreplay"
	Anim.SetContent(SexLab.Factory.Foreplay)

	// ; Duplicating the arrok standing foreplay animation, only including just the first 2 stages
	int a1 = Anim.AddPosition(Female)
	Anim.AddPositionStage(a1, "Arrok_StandingForeplay_A1_S1", 0)
	Anim.AddPositionStage(a1, "Arrok_StandingForeplay_A1_S2", 0)

	int a2 = Anim.AddPosition(Male)
	Anim.AddPositionStage(a2, "Arrok_StandingForeplay_A2_S1", -101, strapon = false, sos = -1)
	Anim.AddPositionStage(a2, "Arrok_StandingForeplay_A2_S2", -101, strapon = false, sos = -1)

	// ; (optional) Give them set timed lengths to fit your mods purpose
	Anim.SetStageTimer(1, 10.0) // ; 10 seconds for stage 1
	Anim.SetStageTimer(2, 15.0) // ; 15 seconds for stage 2 
	// ; Animation now takes exactly 25 seconds to complete

	// ; (optional) Add any tags you think are necessary
	Anim.AddTag("Foreplay")
	Anim.AddTag("LeadIn")

	// ; REQUIRED - after configuring the animation, you must call Save() in order to finalize it.
	Anim.Save()
endIf

Once the "temporary" animation is created, it will exist and can be reused as much as you like until either the form owner you passed becomes none, or you manually release it with ReleaseAnimationObject() Phantom animations created in this way will not show up in SexLab's menu and it will not be returned in any animation searches done by other mods, only way to retrieve the animation after it's be created is it to access it via the object factory functions using the token string you assigned it while creating it.

Link to comment

Hey, i had an idea for animations which would have NPC follower to sitlap (correct English term?) on main character. This would trigger whenever the player takes a sit, and assuming you only have one follower.

 

There would be like 4 positionning choices, one with NPC facing player, second having the back of NPC facing player and, 2 others as side sitlap. Position would be random as if NPC was to choose it.

 

I dont know if its been done/talked-about before, i never read/mod-check things on lover-lab website, so if so, sorry :)

Link to comment

 

Turns out that Phantom API was eventually implemented as NewAnimationObject and so forth.

 

Anyone know anywhere that NewAnimationObject API was used? I'm trying to find an example, but nothing in any of the usual suspects.

 

 

It's basically the same as creating regular animations, you just have some different methods of implementing them, namely either NewAnimationObject() which will immediately return an empty animation object for you to fill, or GetSetAnimationObject() which will retrieve an existing animation under the given token, OR if it doesn't exist, it will create that animation via the callback you give it and then return it, letting you both ensure the custom animation exists and is not duplicated accidentally.

 

The simplest method though is NewAnimationObject(), which works simply like so:

// ; Creatue your animation under the token "ShortForeplay" which you can use to retrieve
// ; it later if needed. Passing the form owner "self" tells it your script objects owns it
// ; if whatever you pass as owner ever becomes a none form (mod uninstalled) than the animation
// ; is automatically cleaned up and removed at start up.
sslBaseAnimation Anim = SexLab.NewAnimationObject("ShortForeplay", self)

// ; Make sure we actually retrieved the animatino and it's empty before setting it up
if Anim != none && Anim.Name != "Short Foreplay"
	// ; At this point it basically becomes no different than creating animations in their callbacks
	// ; as seen in sslAnimationDefaults.psc, config properties can be accessed from SexLab.Factory

	Anim.Name = "Short Foreplay"
	Anim.SetContent(SexLab.Factory.Foreplay)

	// ; Duplicating the arrok standing foreplay animation, only including just the first 2 stages
	int a1 = Anim.AddPosition(Female)
	Anim.AddPositionStage(a1, "Arrok_StandingForeplay_A1_S1", 0)
	Anim.AddPositionStage(a1, "Arrok_StandingForeplay_A1_S2", 0)

	int a2 = Anim.AddPosition(Male)
	Anim.AddPositionStage(a2, "Arrok_StandingForeplay_A2_S1", -101, strapon = false, sos = -1)
	Anim.AddPositionStage(a2, "Arrok_StandingForeplay_A2_S2", -101, strapon = false, sos = -1)

	// ; (optional) Give them set timed lengths to fit your mods purpose
	Anim.SetStageTimer(1, 10.0) // ; 10 seconds for stage 1
	Anim.SetStageTimer(2, 15.0) // ; 15 seconds for stage 2 
	// ; Animation now takes exactly 25 seconds to complete

	// ; (optional) Add any tags you think are necessary
	Anim.AddTag("Foreplay")
	Anim.AddTag("LeadIn")

	// ; REQUIRED - after configuring the animation, you must call Save() in order to finalize it.
	Anim.Save()
endIf
Once the "temporary" animation is created, it will exist and can be reused as much as you like until either the form owner you passed becomes none, or you manually release it with ReleaseAnimationObject() Phantom animations created in this way will not show up in SexLab's menu and it will not be returned in any animation searches done by other mods, only way to retrieve the animation after it's be created is it to access it via the object factory functions using the token string you assigned it while creating it.

 

I had a question about this a page back: When is it safe to release the animation? I've already created my own "setup temporary animations" in ZAP now, but it would be good to know for the future.

 

I would ideally like to be able to release when HookAnimationEnd is received. Is that safe?

Link to comment

Also, am I right in thinking that it doesn't matter what I pass to Anim.Save?

 

Looking at the code, the argument seems to be ignored except for two log messages, but I can't be sure it's not reserving stuff when the id is allocated. (Disclaimer: about to try it, so I may well answer my own question in a minute, but it would be nice to know for sure).

Link to comment

Also, am I right in thinking that it doesn't matter what I pass to Anim.Save?

 

Looking at the code, the argument seems to be ignored except for two log messages, but I can't be sure it's not reserving stuff when the id is allocated. (Disclaimer: about to try it, so I may well answer my own question in a minute, but it would be nice to know for sure).

Yes. I've used this in Prison Overhaul for quite some time now, and the argument doesn't matter.

Link to comment

I'm not sure the tags are working when I create an animation this way.

 

I can run the animation just fine if I use the animation reference from a property. But if i try to look it up with the tags I provided, I get a random anim.

 

Is there a limited set of allowed tags? I was using "QAYL" and "D42" so as not to get them caught by anyone else's code.

Link to comment

I get the outdated FNIS error all the time with installed 5.1.1 version. Everything was ok in 1.58 and now it isn't. I didn't change my load order or anything, this thing just keeps popping out.

Link to comment

I'm not sure the tags are working when I create an animation this way. I can run the animation just fine if I use the animation reference from a property. But if i try to look it up with the tags I provided, I get a random anim. Is there a limited set of allowed tags? I was using "QAYL" and "D42" so as not to get them caught by anyone else's code.

 

Animations made this way aren't available from the normal methods of selecting animations such as tags, specifically so they can't be caught by anyone elses code.

 

The proper way to get your custom animations for use is to select them with GetAnimationObject() passing the token string you gave it while creating it. Alternatively you could simply save the animation to a property in your scripts after creating it for reuse whenever you need it. Just be sure to make sure the properties animation is still valid before trying to use it.

Link to comment

Ah, ok. It was the sample code where it said:

 

	// ; (optional) Add any tags you think are necessary	
        Anim.AddTag("Foreplay")	
        Anim.AddTag("LeadIn")
... which confused me. So why add the tags if not to search using them?

 

 

Tags are accounted for when calculating changes to an actors sexlab stats, having the tag "Dirty" on an animation will increase the actors sexual perversion stat when played. Plus other mods looking at the animation being played by an actor uses them as well, such as the Apropos mod wouldn't know to display the message for vaginal sex if the animation didn't have the "Vaginal" tag.

 

If you want to disable anything and everything, than including no tags isn't going to break anything vital.

Link to comment

Ah, I see. I was thinking tags were primarily for finding animations. I forgot there were side effects based on particular tags. I was trying to avoid the standard ones to stop my animations showing up in other people's scenes... Oh well, I was thinking on the right lines, I suppose.

 

Thanks for explaining it.

Link to comment

Ah, I see. I was thinking tags were primarily for finding animations. I forgot there were side effects based on particular tags. I was trying to avoid the standard ones to stop my animations showing up in other people's scenes... Oh well, I was thinking on the right lines, I suppose. Thanks for explaining it.

 

DD's animation filtering is based upon those tags, as well.

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