Jump to content

Recommended Posts

Posted (edited)

More of a general directions asking post.

 

I recently learnt how to make dialogue lines, and I do know a thing or 2 about scripting (nothing pro, but I manage)

So I was wondering if maybe there was a way to integrate some sexlab stuff into mods.

Idea was just some immersive dialogue lines that called for scenes, and that said scenes were properly tagged.

 

Thing is, for that, I need to know the code lines to call for a sexlab scene and how to call for appropriate tags. It's dialogue line, end dialogue fragment script, insert code, but what?

 

Trying to look for documentation but I'm still a little lost, also opened a few scripts from mods that could help, like SLEN, but I'm still little bit lost here. Anyone kind enough to point me in the right direction?

Edited by Myst42
Posted
18 minutes ago, Myst42 said:

More of a general directions asking post.

 

I recently learnt how to make dialogue lines, and I do know a thing or 2 about scripting (nothing pro, but I manage)

So I was wondering if maybe there was a way to integrate some sexlab stuff into mods.

Idea was just some immersive dialogue lines that called for scenes, and that said scenes were properly tagged.

 

Thing is, for that, I need to know the code lines to call for a sexlab scene and how to call for appropriate tags. It's dialogue line, end dialogue fragment script, insert code, but what?

 

Trying to look for documentation but I'm still a little lost, also opened a few scripts from mods that could help, like SLEN, but I'm still little bit lost here. Anyone kind enough to point me in the right direction?

My sympathies. I wrote this very post 2(?) years ago. Sadly, Ashal has not had the time to redo what documentation she has done for SexLab (being busy with the site and all) and that means the documentation is woefully inadequate. Fortunately for me, one of the other members had pity on me and showed me how to use SexLab Quickstart. You may want to look at my mods (Cynthia, Twins and particularly Some Consensual Sex) and see if this is the sort of thing that you're looking for. If it is, then I can try to find my notes (and even a reference to the original Thread - maybe) and nudge you in the right direction.

Posted
25 minutes ago, Psalam said:

 

Yes, thank you! Pointers would be really nice. I'll take a look at your mods and hopefully find what I'm looking for. Definitely consensual, and nothing too elaborate.

Not looking to make complex quests with this or anything, just some extra dialogue to spice things up a bit on a project, I remember mods like Spouses Enhanced or the already  mentioned SLEN, a nice line that makes sense in context, pick position, do thing that matches selection.

Posted
7 minutes ago, Myst42 said:

Yes, thank you! Pointers would be really nice. I'll take a look at your mods and hopefully find what I'm looking for. Definitely consensual, and nothing too elaborate.

Not looking to make complex quests with this or anything, just some extra dialogue to spice things up a bit on a project, I remember mods like Spouses Enhanced or the already  mentioned SLEN, a nice line that makes sense in context, pick position, do thing that matches selection.

Good. I found my notes but the original Thread has been deleted (necessary to keep the site running faster, but unfortunate - that's why I take notes).

Posted

Most of the docs are inside the file SexLab.psc (I do not remember the exact name maybe was SexLabFramework.psc)

Technically for simple action you just reference the SexLab object and call StartSex or QuickSex passing the parameters you want (the actors are mandatory, all the rest is optional.)

 

You can go deeper using other functions, but for basic sex it is not required.

Posted
1 hour ago, Myst42 said:

Thing is, for that, I need to know the code lines to call for a sexlab scene and how to call for appropriate tags. It's dialogue line, end dialogue fragment script, insert code, but what?

 

Yes, the fragment would be in the dialogue end part.

 

You would likely use Sexlab's StartSex() function, which needs an actor array and an animlist to work.

 

So, make an actor array with PC and akSpeaker, then get a list of animations using Sexlab.GetAnimationByTags() or similar function.

 

If that covers everything, then use Sexlab.StartSex(actorarray, animlist) to start the scene.

Posted (edited)

Welp... Cynthia certainly helped.

Found the QuickStart function which also lead me to SexLabFramework.psc and the little bits of documentation it has...

Now I only needed to understand a bit more about tags since I wanted to be sure I'm putting the right input.

 

I also tried looking for that same structure in more complex mods and could not make heads or tales of what's going on. Seems SLEN and Spouses Enhanced jump between up to 4 different scripts in very intricate functions setting tons of variables and doing waits for god knows what, and now I'm worried if these might be needed precautions to stabilize the game in the event of unexpected things.

 

EDIT: also, that array method seems understandable... I was aiming to use QuickStart function since documentation says it needs less parameters. But if StartSex gets the job done...

Edited by Myst42
Posted

Ok, so I used this code

Actor[] SexActorList = New Actor[2]
SexLabFramework SexLab

SexActorList[0] = Game.GetPlayer()
SexActorList[1] = akSpeaker

String OkTags = "Vaginal"
String NopeTags = "Aggressive"

sslBaseAnimation[] Position = SexLab.GetAnimationsByTags(SexActorList.Length, OkTags, NopeTags, True)

SexLab.StartSex(SexActorList, Position)

And compiler says it's alright but in game, nothing happens and log says this:

 

[08/26/2022 - 05:19:01PM] Error: Cannot call GetAnimationsByTags() on a None object, aborting function call
stack:
[08/26/2022 - 05:19:01PM] Error: Cannot call StartSex() on a None object, aborting function call

 

I'm sorry, I'm terrible at Arrays and they're always confusing the hell out of me, so I guess there must be a dumb mistake I made somewhere that something is being passed as "None", but I still can't see it

Posted (edited)
1 hour ago, Myst42 said:

on a None object

 

Hmm, looks generally right.  Its likely the array, akSpeaker not being picked up.

 

Usually there is a line like: Actor akSpeaker = akSpeakerRef as Actor

 

Instead of .length, just use 2.  You're always going to know with this code that the number is 2, so no need for a function call.

 

If that fails, start dumbing it down and adding debug after every line (usually MiscUtil.PrintConsole()) to see where the "none" is coming from.  Papyrus... ain't great.

 

EDIT: WAIT A SEC...

 

Is that the whole fragment?

Honestly, I usually just make a full script for it and tweak things in xEdit to line everything up.  I f-ing hate the CK for this.

Edited by Seijin8
Posted (edited)
2 hours ago, Seijin8 said:

Is that the whole fragment?

It is a dialogue fragment yes

2 hours ago, Seijin8 said:

Usually there is a line like: Actor akSpeaker = akSpeakerRef as Actor

It was generated automatically and is outside the "begin end code" part of the fragment

2 hours ago, Seijin8 said:

Instead of .length, just use 2.  You're always going to know with this code that the number is 2, so no need for a function call.

Yeah, I like to be fancy sometimes in hope to re-use my own code in future iterations, but 2 seems to do the trick

2 hours ago, Seijin8 said:

If that fails, start dumbing it down and adding debug after every line (usually MiscUtil.PrintConsole()) to see where the "none" is coming from.  Papyrus... ain't great.

I did debug, and tried many different combinations, including literally passing specific variables to the function such as:

sslBaseAnimation[] Position = SexLab.GetAnimationsByTags(2, "Vaginal", "Aggressive", True)

Ad the Debug log is still giving me this:

[08/26/2022 - 07:49:00PM] SLDialogueTest ActorListLength = 2
[08/26/2022 - 07:49:00PM] Error: Cannot call GetAnimationsByTags() on a None object, aborting function call
[08/26/2022 - 07:49:00PM] SLDialogueTest SexActorList = [[Actor < (00000014)>], [Actor < (55035818)>]]
[08/26/2022 - 07:49:00PM] SLDialogueTest Position = []
[08/26/2022 - 07:49:00PM] Error: Cannot call StartSex() on a None object, aborting function call

I'm gonna try calling it from a quest script rather than a dialogue fragment, cause I can't finda anything that makes sense other than theorizing that calling the function and passing variables is just nor possible from a fragment script

 

Edit: Wait... maybe my dumb mistake was somewhere else... Maybe I need to reference SexLabFramework directly as a property, and it's the framework script that it cannot find? That would certainly make sense... *Sigh... it's so easy to miss even the most obvious sometimes. At least I hope it's this thing...

 

EDIT2: Yup, that was indeed it. Now I found that assigning proper genders is another issue.

Edited by Myst42
Posted
9 minutes ago, Myst42 said:

It is a dialogue fragment yes

It was generated automatically and is outside the "begin end code" part of the fragment

Yeah, I like to be fancy sometimes in hope to re-use my own code in future iterations, but 2 seems to do the trick

I did debug, and tried many different combinations, including literally passing specific variables to the function such as:

sslBaseAnimation[] Position = SexLab.GetAnimationsByTags(2, "Vaginal", "Aggressive", True)

Ad the Debug log is still giving me this:

[08/26/2022 - 07:49:00PM] SLDialogueTest ActorListLength = 2
[08/26/2022 - 07:49:00PM] Error: Cannot call GetAnimationsByTags() on a None object, aborting function call
[08/26/2022 - 07:49:00PM] SLDialogueTest SexActorList = [[Actor < (00000014)>], [Actor < (55035818)>]]
[08/26/2022 - 07:49:00PM] SLDialogueTest Position = []
[08/26/2022 - 07:49:00PM] Error: Cannot call StartSex() on a None object, aborting function call

I'm gonna try calling it from a quest script rather than a dialogue fragment, cause I can't finda anything that makes sense other than theorizing that calling the function and passing variables is just nor possible from a fragment script

 

Could you please post the entire script?

 

This can be done from dialogue, I used to do it all the time.  Having said that, using an underlying quest to handle things is probably the best method.  That's what I do with it now, and you'll likely be well served doing the same.

Posted
2 hours ago, Seijin8 said:

Could you please post the entire script?

I guess you meant for troubleshooting, but anyway... here's the one that worked after all. I didn't really want to set up a SexLab dependency on this project which is how this whole mess started, cause I wanted to make it "intuitive" and only work if it was installed. Bur here it is:

Scriptname TIF__04072465 Extends TopicInfo Hidden

;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
Actor[] SexActorList = New Actor[2]
SexLabFramework SexLab = Game.GetFormFromFile(0x000D62, "SexLab.esm") as SexLabFramework

SexActorList[0] = akSpeaker
SexActorList[1] = Game.GetPlayer()

String OkTags = "Vaginal"
String NopeTags = "Aggressive"

sslBaseAnimation[] Position = SexLab.GetAnimationsByTags(2 , OkTags, NopeTags, True)

SexLab.StartSex(SexActorList, Position)
;END CODE
EndFunction

I wanna keep on the "simpler" domains of sexlab modding, but I am gonna need a better understanding of tags to add a few base options. Either way it works now, so thanks a lot to everyone who helped here

Posted (edited)

Another question, since I thought to dig a bit deeper into trying to get familiar with Arrays...

I'm using this page as documentation And found something that could come in handy below... making an "Array of Arrays"

It's long to explain but lets say after getting the scripts to call for a sex act, I got into quite a mess of my own making due to wanting to be picky with animation tags.

I did manage to make a system that works, and that I like, to pick them, but one of the processes it makes, is build a Randomize list that stores other lists to pick one, and then send it.

So I attempted to use that Array of Arrays setting for this part

 

The problem is on the script example, it puts on a PlaceAtMe() call on one of its steps, and it places an Activator as Form

Now, PlaceAtMe(), is known to cause save bloat as it keeps adding things to the game that never get removed, so I tried adding a CleanUp function later, but when I tried to use Delete() I found out its only applicable to an ObjectReference and I cant really delete the spawned Form

 

Question is: would this be safe to use because the game somehow doesn't really stores these if they are not ObjectReferences, or it's still a dangerous way and I should try to find another? Or how exactly would I go on about removing a PlaceAtMe() spawned reference if I cant call Delete() on it, assuming it's even possible?

Oh, an another thing... I tried spawning these things as ObjectReferences too so I could delete them, but the entire Array of Arrays system kinda failed... not sure if because of that, or because I missed something the last time i tried it.

 

Here's the described proccess of this Array of Arrays as stated on the page, BTW:

Spoiler
;First, an accessory script to store properties
Scriptname BugArrayHolder extends Form       
	String[] Property stringArray auto

Scriptname bugMultiDimTest extends ObjectReference  
     
	bool Property isCreated Auto
     
    ; We'll use this to create our arrays
    Activator Property arrayHolder auto 
     
    Form[] Property rows auto hidden
     
    event onInit()
    	if (!isCreated)
    		; create the matrix and populate it
    		; first we create the array to hold the rows of the matrix
    		rows = new Form[3]
     
    		int row = rows.length
    		; assign an array of columns to each row
    		while row > 0
    			row -= 1
     
    			; note that since we must create each column array separately, there's no reason you can't vary the size from one row to the next
    			String[] cols = new String[4] ; create our array of strings
    			; column arrays are not a type of Form so we must create a Form to wrap around it
    			BugArrayHolder holder = ((self.placeAtMe(arrayHolder) as Form) as BugArrayholder) 
    			holder.stringArray = cols ; put the column array into our wrapper
    			rows[row] = holder ; store our wrapper into the row element
     
    			; Setting each string to "(<row>, <col>)" to prove it was initialized OK
    			int col = cols.length
    			while col > 0
    				col -= 1
    				cols[col] = "(" + (row + 1) + ", " + (col + 1) + ")"
    			endWhile
    		endWhile
    		isCreated = true
    		Debug.Trace(self+": creation done")
    	endif
     
    	dumpMatrix()
    endEvent
     
    function dumpMatrix()
    	int row = 0
    	while row < rows.length
    		String[] cols = (rows[row] as BugArrayholder).stringArray
    		int col = 0
    		while col < cols.length
    			Debug.Trace(self + ":  " + cols[col])
    			col += 1
    		endWhile
    		row += 1
    	endWhile
    endFunction



 

 

Edited by Myst42
Posted
On 8/29/2022 at 7:32 AM, Myst42 said:

Question is: would this be safe to use because the game somehow doesn't really stores these if they are not ObjectReferences, or it's still a dangerous way and I should try to find another? Or how exactly would I go on about removing a PlaceAtMe() spawned reference if I cant call Delete() on it, assuming it's even possible?

Oh, an another thing... I tried spawning these things as ObjectReferences too so I could delete them, but the entire Array of Arrays system kinda failed... not sure if because of that, or because I missed something the last time i tried it.

 

I wouldn't use nested arrays.  It technically is possible, but I've never seen it work right.  The functions that can actually access it are very limited in scope.  The only place I've seen anything even remotely like that work is with formlists inside formlists, and even that is sketchy at best.

 

As far as PlaceAtMe() and Delete(), I think the safer (no bloat, no issue) way to do this would be to use a single activator defined in the script property (and made into a persistent reference in-game), and use MoveTo(), Enable() and Disable() to bring that activator to where you need it.

Posted (edited)
14 hours ago, Seijin8 said:

 

I wouldn't use nested arrays.  It technically is possible, but I've never seen it work right.  The functions that can actually access it are very limited in scope.  The only place I've seen anything even remotely like that work is with formlists inside formlists, and even that is sketchy at best.

 

As far as PlaceAtMe() and Delete(), I think the safer (no bloat, no issue) way to do this would be to use a single activator defined in the script property (and made into a persistent reference in-game), and use MoveTo(), Enable() and Disable() to bring that activator to where you need it.

Welp, as a status update, I did manage to make the nested arrays work, and I did manage to do it using object reference things I can delete.

I was very hard and frustrating to make it work, but (also for myself I write this) to try to understand it what I did was:
 

Spoiler

-The accessory Holder script is type ObjectReference, holds an Array Storage property of type sslBaseAnimation(the one the holds animations). It's attached to an Activator with no models or text in it, so it will be just an invisible spawn on  player's location

-Holder of Arrays on the main script (LargeHolder) is of type Form, cause it can storage anything and I create it with custom length passing an expression if I use an SKSE function: Utility.CreateFormArray(Int)

-On creating the new spawned holder use PlaceAtMe() as Form, and then pass it as it's own type, so I can call upon the specific holder property. The call being:

-Holder.Storage

-Had to call upon the Holder Storage property 2 times, one to put something in it, the second to extract what was stored previously

-The big Form array, can store anything, so I can directly store the Holders in it, even without passing them as a different type:

-LargeHolder[Index] = Holder

-To cleanup, did this in 2 phases being:

-Retrieve the specific Holder from the Form array (LargeHolder), but this time, pass it as ObjectReference:

-ObjectReference Holder = LargeHolder[Index] as ObjectReference

-As a precaution (probably not needed, but my brain was already emitting smoke here so didn't wanna think more) I cleaned up the Storage properties first so:

-(Holder as HolderScript).Storage = Clean (Used an empty list here cause I dont understand exactly what sslBaseAnimation are, and I know they cant be set to None or it gives errors.

-Finally since Holder was this time, an ObjectReference, I can simply call Holder.Delete() and papyrus log gives me no errors, so I take it it must be working well.

 

Anyway, it worked this time, but I was about to consider something similar to what you wrote before this finally worked. If I could not delete the Holder spawns, I should have recycled the same ones over and over again. Kinda happy now cause it was tricky, but it worked.

 

__

 

More on the original topic, found out StartSex() is only the tip of the iceberg as I wanted to configure scenes that are IE just kissing, no undressing and no dildos, but for that, I had to mess with deeper stuff as calling a "Thread"... thankfully, the included the SexLabFramework.psc file has a copy of StartSex() and I was able to tamper a bit with the scene settings, although still not as much control as I wish, but it's a hell of a lot more than when I started.

Edited by Myst42
Posted
5 hours ago, Myst42 said:

although still not as much control as I wish, but it's a hell of a lot more than when I started

 

Oh yeah, I think most of us with grand (but very specific) plans end up remaking sections of the StartSex() code and associated thread building bits.  A lot easier to build a single function that does precisely what you want and then feed that function whenever you need it, with defaults already made to order.

 

Anyway, glad its working for you.

  • 1 year later...
Posted (edited)
On 8/26/2022 at 9:54 PM, Myst42 said:

I guess you meant for troubleshooting, but anyway... here's the one that worked after all. I didn't really want to set up a SexLab dependency on this project which is how this whole mess started, cause I wanted to make it "intuitive" and only work if it was installed. Bur here it is:

Scriptname TIF__04072465 Extends TopicInfo Hidden

;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
Actor[] SexActorList = New Actor[2]
SexLabFramework SexLab = Game.GetFormFromFile(0x000D62, "SexLab.esm") as SexLabFramework

SexActorList[0] = akSpeaker
SexActorList[1] = Game.GetPlayer()

String OkTags = "Vaginal"
String NopeTags = "Aggressive"

sslBaseAnimation[] Position = SexLab.GetAnimationsByTags(2 , OkTags, NopeTags, True)

SexLab.StartSex(SexActorList, Position)
;END CODE
EndFunction

I wanna keep on the "simpler" domains of sexlab modding, but I am gonna need a better understanding of tags to add a few base options. Either way it works now, so thanks a lot to everyone who helped here

I literally copy/pasted this into my own fragment and what I get is

 

Starting 1 compile threads for 1 files...
Compiling ""...
I:\SteamLibrary\steamapps\common\Skyrim Special Edition\Data\Scripts\Source\temp\aaxSexSceneHandler.psc(10,70): cannot convert to unknown type sexlabframework
I:\SteamLibrary\steamapps\common\Skyrim Special Edition\Data\Scripts\Source\temp\aaxSexSceneHandler.psc(10,70): cannot cast a form to a sexlabframework, types are incompatible
I:\SteamLibrary\steamapps\common\Skyrim Special Edition\Data\Scripts\Source\temp\aaxSexSceneHandler.psc(10,16): unknown type sexlabframework
I:\SteamLibrary\steamapps\common\Skyrim Special Edition\Data\Scripts\Source\temp\aaxSexSceneHandler.psc(18,37): sexlabframework is not a known user-defined type
I:\SteamLibrary\steamapps\common\Skyrim Special Edition\Data\Scripts\Source\temp\aaxSexSceneHandler.psc(18,19): unknown type sslbaseanimation[]
I:\SteamLibrary\steamapps\common\Skyrim Special Edition\Data\Scripts\Source\temp\aaxSexSceneHandler.psc(20,7): sexlabframework is not a known user-defined type
No output generated for aaxSexSceneHandler, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.

 

It's not just this, but every time I try to define a "selabframework" type variable, it fails.  I've tried every similar tutorial that I could find on the internet, and they all end with the same problem.  The CK won't recognize it as a variable or property at all.  I've been beating my head against this wall for months, and could use some help.

 

Edit:  Skyrim SE with MO2 and SKSE, Sexlab, and all requirements installed, etc. not a complete idiot, just frustrated.

Edited by Grumpy_OM
add info
Posted
13 hours ago, Grumpy_OM said:

I literally copy/pasted this into my own fragment

 

While this worked for Myst42, I would not ever recommend "GetFormFromFile" for this use.  Unless you have a specific reason to not want to create a dependency to sexlab, define Sexlab as a property.

 

13 hours ago, Grumpy_OM said:

Skyrim SE with MO2 and SKSE, Sexlab, and all requirements installed

 

But it seems CK can't find them, so whatever is happening, they aren't installed in a way that CK can access.

 

Is CK being run through MO2?

 

Are the scripting files in a correct folder setup?  Some earlier versions of the BSAs put the scripts into data\source\scripts (which is wrong). The folder structure should be data\scripts\source with the .pex always being in data\scripts and the .psc always being in data\scripts\source.

 

Personally, I just extract all of those into the vanilla directory to avoid issues with the file virtualization.  So I'd place all the SKSE scripts into there as well as all Sexlab scripts and anything (like jcontainers) that sexlab needs.

Posted
10 hours ago, Seijin8 said:

 

While this worked for Myst42, I would not ever recommend "GetFormFromFile" for this use.  Unless you have a specific reason to not want to create a dependency to sexlab, define Sexlab as a property.

 

 

But it seems CK can't find them, so whatever is happening, they aren't installed in a way that CK can access.

 

Is CK being run through MO2?

 

Are the scripting files in a correct folder setup?  Some earlier versions of the BSAs put the scripts into data\source\scripts (which is wrong). The folder structure should be data\scripts\source with the .pex always being in data\scripts and the .psc always being in data\scripts\source.

 

Personally, I just extract all of those into the vanilla directory to avoid issues with the file virtualization.  So I'd place all the SKSE scripts into there as well as all Sexlab scripts and anything (like jcontainers) that sexlab needs.

I used the "GetFormFromFile" specifically because the normal "SexLabFramework property SexLab auto" isn't working (I get an unknown type error every time), and yes the folders are in the correct order, (tbf, that is a common mistake ppl make) but I have no problems with other mods and scripts I've made, just calls to Sexlab (although Flower Girls gives me the same headache). 

 

I hate messing with the actual data folder any more than absolutely necessary, which is why I do run everything, including the CK through MO2.

 

I did try one other thing, which may prove your hypothesis that the CK is somehow not seeing all the correct files.  I ran the "SexLabFramework property SexLab auto" command through Visual Studio Code that I set up for another, bigger, mod that I am making and it compiled with no problem.  I didn't really want to go through all the trouble of doing it with this little bit, but I guess I don't have much of a choice.

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