Jump to content

Sexlab Scripting and Modding Tutorials w/ How too Video and example script downloads


Recommended Posts

26 minutes ago, noreg said:

 

But anims[] is an array, so it should not be possible to set multiple stings to one..

what irritates me is "Handler.fuck(actors ,0, anim , next = "DoneThreesome")"

 

i think

actors is equivalent to

sexactors in

SexLab.StartSex(sexActors, anims)

but what is the zero for? The startstage?

 

i would expect something like

SexlabStart(sexactors,anim)

 

You may want to use SexLab threads. There you have full control of the actors, the anims, and all other possible conditions.

StartSex is just a convenience shortcut for a pretty basic SexLazb thread activation.

 

About the error you are having, show the full code. And be sure SexLab sources are accessible.

Link to comment
33 minutes ago, CPU said:

 

You may want to use SexLab threads. There you have full control of the actors, the anims, and all other possible conditions.

StartSex is just a convenience shortcut for a pretty basic SexLazb thread activation.

 

About the error you are having, show the full code. And be sure SexLab sources are accessible.

 

Do you know a good manual to start with that?

For a total n00b.

The sexlab sources are accessible

 

Link to comment
7 minutes ago, noreg said:

 

Do you know a good manual to start with that?

For a total n00b.

The sexlab sources are accessible

 

SexLab sources are in the mod itself. They always have been.

And the sources are quite well commented.

 

But the best is asking for help and looking how other mods are doing stuff.

Link to comment
1 hour ago, noreg said:

 

Do you know a good manual to start with that?

For a total n00b.

The sexlab sources are accessible

 

Mods like RDS, Amorous Adventures, Radiant Prostitution, Skyrim's Shrouded Secret (Only uses one thread in an area for kissing) But many mods use a Thread, start with radiant prostitution, everything you need is in the Handler Script.

Link to comment

i tried to have a look in this handler thing before, but this seems to complicated for me.

What bugs me is, that even the simple task (startsex) seems to ignore al external values i give, only the internal race and gender checks seems to work.

 

Does anybody have an idea if i did something wrong?

Link to comment
On 7/24/2021 at 2:54 PM, noreg said:

Hi folks, i once again asking for your help.

 

I'm working on a mod that involves sex scenes and i want to use animations for female giants.

I use these scriptlines for catching the animations:

 

anims = SexLab.GetAnimationsByTag(2, "giantess,FC", tagSuppress="Necro", RequireAll=true)
SexLab.StartSex(sexActors, anims)

 

there are a few animations which have a "necro" tag in them and i don't want theses animations to play.

So i thought the above lines are suitable.

i went through testing and noticed that these animations are still playing

 

This is what the log shows

 

  Reveal hidden contents

144618386_Screenshot2021-07-2419-18-14.png.664bc9347f4cbc303eb320415ee6a588.png

 

1519577678_Screenshot2021-07-2419-18-31.png.84509308daa3a673ce3bc5fcf73df23f.png

 

And this is the tag of this animation in SL Animloader:

 

  Reveal hidden contents

346745085_Screenshot2021-07-2414-44-17.png.c45a14880aa130891f488fdbff20c8cd.png

 

I don't now why this animation plays it has no "giantess" in it and should be avoided because of "necro".

 

Any ideas?

 

I would appreciate your help.

 

GetAnimationsByTag, if that's what you're using, is deprecated. That function has Tag1 and Tag2 params, and a TagSuppress param. If you're using it, it is looking for "giantess,FC" as a single tag. Using GetAnimationsByTags could fix the problem.

 

If not, I also don't see "giantess" as a tag on that anim which is playing, only "giant". It could be that the combination of tags ("giantess,FC" and suppressing "necro") returns an empty array, which means StartSex defaults to choosing one based on default criteria. That is probably why it seems like StartSex is ignoring your tags. Try omitting the required tags and only use the suppress necro option.

 

BTW there is also GetCreatureanimationsByRaceTags, you don't need to rely on a "giant" or "giantess" tag being on the animation, you can pass the race directly.

 

On 7/25/2021 at 6:35 AM, noreg said:

Sorry for my dumb question.. but should this work for collecting multiple anims

 

---------------------------------------------------------------------------------------------------

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 1
Scriptname _009Merilyn_Sex_Giantess Extends TopicInfo Hidden

;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
actor[] sexActors = new actor[2]
sexActors[0] = akSpeaker
sexActors[1] = Game.GetPlayer()
sslBaseAnimation[] anims
ActorBase PlayerBase = Game.GetPlayer().GetActorBase()
ActorBase NPCBase = akspeaker.GetActorBase()

 anims[0] = SexLab.GetAnimationByName("Animation0")

 anims[1] = SexLab.GetAnimationByName("Animation1")

 anims[2] = SexLab.GetAnimationByName("Animation2")

 

SexLab.StartSex(sexActors, anims)

 

;END CODE
EndFunction
;END FRAGMENT

;END FRAGMENT CODE - Do not edit anything between this and the begin comment

 

or this for starting a specific animation:

----------------------------------------

 anims[0] = SexLab.GetAnimationByName("Animation0")

SexLab.StartSex(sexActors, anims)

-----------------------------------------

 

One problem with the above is, you can't assign elements to an empty array, you need anims = new sslBaseAnimation[3]

 

Other problem is from the documentation of GetAnimationByName: "* * The animation will NOT include creatures. Use GetCreatureAnimationByName() if you want an animation that is including Creatures."

 

 

 

On 7/25/2021 at 8:26 AM, noreg said:

When i try to compile: sslBaseAnimation[] anim = new sslBaseAnimation[1]

i get an Error: unknown type sslBaseAnimation

 

sslBaseAnimation[] anim works

 

That's strange, and sounds a bit like the sslBaseAnimation.psc script is not in your Scripts/Source folder. But in that case I don't think declaring the array without assigning it would work either, could you try this again and double check the spelling?

 

Also, try declaring and assigning the array on separate lines.
sslBaseAnimation[] anims
 

and then

anims = new sslBaseAnimation[1]

 

11 minutes ago, noreg said:

i tried to have a look in this handler thing before, but this seems to complicated for me.

What bugs me is, that even the simple task (startsex) seems to ignore al external values i give, only the internal race and gender checks seems to work.

 

Does anybody have an idea if i did something wrong?

 

I think it's probably because you are passing empty arrays for one of the above reasons, so it's defaulting to its own behavior.

Link to comment
5 hours ago, DayTri said:

 

GetAnimationsByTag, if that's what you're using, is deprecated. That function has Tag1 and Tag2 params, and a TagSuppress param. If you're using it, it is looking for "giantess,FC" as a single tag. Using GetAnimationsByTags could fix the problem.

 

If not, I also don't see "giantess" as a tag on that anim which is playing, only "giant". It could be that the combination of tags ("giantess,FC" and suppressing "necro") returns an empty array, which means StartSex defaults to choosing one based on default criteria. That is probably why it seems like StartSex is ignoring your tags. Try omitting the required tags and only use the suppress necro option.

 

BTW there is also GetCreatureanimationsByRaceTags, you don't need to rely on a "giant" or "giantess" tag being on the animation, you can pass the race directly.

 

 

Thanks for your hints.

It seems that the right race is selected automatically so no need to search for a racetag.

 

What confuses me is, that

 

anims = SexLab.GetAnimationsByTag(2, "FC", TagSuppress="Necro", RequireAll=true)
SexLab.StartSex(sexActors, anims)

 

continus to play animations which have the necro tag

Link to comment
5 hours ago, DayTri said:

 

One problem with the above is, you can't assign elements to an empty array, you need anims = new sslBaseAnimation[3]

 

Other problem is from the documentation of GetAnimationByName: "* * The animation will NOT include creatures. Use GetCreatureAnimationByName() if you want an animation that is including Creatures."

 

 

 

On 7/25/2021 at 12:56 PM, noreg said:

When i try to compile: sslBaseAnimation[] anim = new sslBaseAnimation[1]

i get an Error: unknown type sslBaseAnimation

 

sslBaseAnimation[] anim works

 

That's strange, and sounds a bit like the sslBaseAnimation.psc script is not in your Scripts/Source folder. But in that case I don't think declaring the array without assigning it would work either, could you try this again and double check the spelling?

 

Also, try declaring and assigning the array on separate lines.
sslBaseAnimation[] anims
 

and then

anims = new sslBaseAnimation[1]

 

Thank you.. this works:

 

Spoiler

sslBaseAnimation[] anim
anim = new sslBaseAnimation[1]
ActorBase PlayerBase = Game.GetPlayer().GetActorBase()
ActorBase NPCBase = akspeaker.GetActorBase()
 

anim[0] = SexLab.GetCreatureAnimationByName("FunnyBizness Giantess Rough Doggy")
 

SexLab.StartSex(sexActors, anim)

 

Link to comment
1 hour ago, noreg said:

 

Thanks for your hints.

It seems that the right race is selected automatically so no need to search for a racetag.

 

What confuses me is, that

 

anims = SexLab.GetAnimationsByTag(2, "FC", TagSuppress="Necro", RequireAll=true)
SexLab.StartSex(sexActors, anims)

 

continus to play animations which have the necro tag

 

Just to troubleshoot, you could try inserting

Debug.Notification("Number of animations: " + anims.length)
 

I think if GetAnimationsByTag is returning empty, then this will give you an idea. It could be that "FC" is not on any animations you want to play.

 

Another problem is if it is giving too many animations. You get all animations with some tag, maybe "FC". There could be a lot of them. This function only returns up to 128. If you have 128 animations that aren't for giants, then it could be you have 0 animations which can be used for a giant in your array. Then you pass it to startsex, which checks the animations you gave it to see which are compatible. If none are compatible, it will fall on some default behavior. For that reason it's probably a better idea to use the creature specific function to get animations. That one searches directly by the race, not relying on the animator to tag anything correctly. You will probably get better behavior.

 

1 hour ago, noreg said:

 

Thank you.. this works:

 

  Hide contents

sslBaseAnimation[] anim
anim = new sslBaseAnimation[1]
ActorBase PlayerBase = Game.GetPlayer().GetActorBase()
ActorBase NPCBase = akspeaker.GetActorBase()
 

anim[0] = SexLab.GetCreatureAnimationByName("FunnyBizness Giantess Rough Doggy")
 

SexLab.StartSex(sexActors, anim)

 

 

Great, glad it's working.

Link to comment

@noreg

 

I just checked the code and it looks to me like "GetAnimationsByTags" and "GetAnimationsByTag" never return creature animations. I am pretty surprised by this since it's not clearly documented, I think this is probably not well known.

 

"GetAnimationsByTags" checks the sslAnimationSlots object for animations, which is the same one GetAnimationByName checks. The creature specific ones all check sslCreatureAnimationSlots. I think the animations are all stored separately, so you need to use the creature specific ones for creature animations

Link to comment
16 hours ago, DayTri said:

@noreg

 

I just checked the code and it looks to me like "GetAnimationsByTags" and "GetAnimationsByTag" never return creature animations. I am pretty surprised by this since it's not clearly documented, I think this is probably not well known.

 

"GetAnimationsByTags" checks the sslAnimationSlots object for animations, which is the same one GetAnimationByName checks. The creature specific ones all check sslCreatureAnimationSlots. I think the animations are all stored separately, so you need to use the creature specific ones for creature animations

 

Unfortunately there is no "GetCreatureAnimationsByTag", but because of the few numbers of fitting animations i ended up with declaring them manually.

 

I have a dialogoption for random sex and ended up with this code:

 

Spoiler

if (PlayerBase.GetSex() == 0); Player is male
anim[0] = SexLab.GetCreatureAnimationByName("FunnyBizness Giantess RevCow")
anim[1] = SexLab.GetCreatureAnimationByName("FunnyBizness Giantess Rough Doggy")
anim[2] = SexLab.GetCreatureAnimationByName("FunnyBizness Giantess BlowJob")
anim[3] = SexLab.GetCreatureAnimationByName("(Giant) Harrassment") ;Titfuck
EndIf

if (PlayerBase.GetSex() == 1); Player is female
anim[0] = SexLab.GetCreatureAnimationByName("(Giant) Harrassment") ;Titfuck    
anim[1] = SexLab.GetCreatureAnimationByName("(Giant) Holding") ;Handjob
anim[2] = SexLab.GetCreatureAnimationByName("(Giant) Penetration")
EndIf

SexLab.StartSex(sexActors, anim)

 

 

This seems to work pretty well so i tried step to.
I have a Race for Giantesses, which is based on the vanilla race but has extra steps, the race is talkactive and can open doors.

now i am trying to make this animations recognize my new race.

does anybody has an idea how this can be done?

 

I edited the race-tag in the json file for the FunnyBizness anims but it still dosn't recognice the race as giant.

Edited by noreg
Link to comment
18 minutes ago, noreg said:

 

Unfortunately there is no "GetCreatureAnimationsByTag", but because of the few numbers of fitting animations i ended up with declaring them manually.

 

I have a dialogoption for random sex and ended up with this code:

 

  Reveal hidden contents

 

This seems to work pretty well so i tried step to.
I have a Race for Giantesses, which is based on the vanilla race but has extra steps, the race is talkactive and can open doors.

now i am trying to make this animations recognize my new race.

does anybody has an idea how this can be done?

 

I edited the race-tag in the json file for the FunnyBizness anims but it still dosn't recognice the race as giant.

 

You have to add the "Race" to SexLab. It is called RaceKey. You will find the options in sslCreatureAnimationSlots.psc

 

sslCreatureAnimationSlots.AddRaceID("Giants", "NameIDOfYourRace")

 

Link to comment
58 minutes ago, noreg said:

 

Unfortunately there is no "GetCreatureAnimationsByTag", but because of the few numbers of fitting animations i ended up with declaring them manually.

 

I have a dialogoption for random sex and ended up with this code:

 

  Hide contents

if (PlayerBase.GetSex() == 0); Player is male
anim[0] = SexLab.GetCreatureAnimationByName("FunnyBizness Giantess RevCow")
anim[1] = SexLab.GetCreatureAnimationByName("FunnyBizness Giantess Rough Doggy")
anim[2] = SexLab.GetCreatureAnimationByName("FunnyBizness Giantess BlowJob")
anim[3] = SexLab.GetCreatureAnimationByName("(Giant) Harrassment") ;Titfuck
EndIf

if (PlayerBase.GetSex() == 1); Player is female
anim[0] = SexLab.GetCreatureAnimationByName("(Giant) Harrassment") ;Titfuck    
anim[1] = SexLab.GetCreatureAnimationByName("(Giant) Holding") ;Handjob
anim[2] = SexLab.GetCreatureAnimationByName("(Giant) Penetration")
EndIf

SexLab.StartSex(sexActors, anim)

 

 

This seems to work pretty well so i tried step to.
I have a Race for Giantesses, which is based on the vanilla race but has extra steps, the race is talkactive and can open doors.

now i am trying to make this animations recognize my new race.

does anybody has an idea how this can be done?

 

I edited the race-tag in the json file for the FunnyBizness anims but it still dosn't recognice the race as giant.

 

 

You can use this one to avoid hand picking by name:

 

GetCreatureAnimationsByRaceTags(int ActorCount, Race RaceRef, string Tags, string TagSuppress = "", bool RequireAll = true)

 

So instead of the above, something like

 

Actor PlayerRef
Actor Giantess
sexActors[0] = PlayerRef
sexActors[1] = Giantess

anim = GetCreatureAnimationsByRaceTags(2, Giantess.GetRace(), "Some,Tags,Here", "Suppressing,Tag,Here")
Sexlab.StartSex(sexActors,anim)

 

 

And like CPU said you need to register your custom race, once you do sexlab will return the giant animations for it.

Link to comment
2 hours ago, CPU said:

 

You have to add the "Race" to SexLab. It is called RaceKey. You will find the options in sslCreatureAnimationSlots.psc

 

sslCreatureAnimationSlots.AddRaceID("Giants", "NameIDOfYourRace")

 

 

sorry to bother you again.

I added the racekey as you wrote.

The new race is now recognized as "giants"

 

the actors undress but instead of moving like in the animation they are just standing there.

 

i reinitialised the creature framework, and re registered the animations in sexlab and i rerun fins too..

Did i miss something?

Link to comment
29 minutes ago, CPU said:

Is the race a Giant race or it is just a normal actor race scaled a lot?

 

It is a custom mesh but uses the giant skeleton.

the animations worked flawless when i set it as vanilla giantrace

I copied the giantrace and set another worn armor and voice and edited a few stats.

 

The NPC walks like a giant and the other animations (walk, combat, idle) work too

 

Edited by noreg
Link to comment
48 minutes ago, noreg said:

It is a custom mesh but uses the giant skeleton.

the animations worked flawless when i set it as vanilla giantrace

I copied the giantrace and set another worn armor and voice and edited a few stats.

 

The NPC walks like a giant and the other animations (walk, combat, idle) work too

 

 

I think you have to reset SexLab then to have it to recognize this new race type.

I did it too many years ago, I do not remember 100% how it was working.

 

Link to comment
40 minutes ago, CPU said:

 

I think you have to reset SexLab then to have it to recognize this new race type.

I did it too many years ago, I do not remember 100% how it was working.

 

 

I started a new game just to be sure, and now i get the message:

"They are a creature type that is currently not supported"

i added the races name  and the id as it didn't work.

 

i'm totally confused now

Link to comment
23 minutes ago, CPU said:

I think the added race was to be done in a specific moment.

Check the script I mentioned to check when it should be done.

 

Thanks for your answer, but i don't know what you mean by that.

 

I overwrote the original

sslCreatureAnimationSlots.psc

with this entry

    ClearRaceKey("Giants")
    AddRaceID("Giants", "DariaRace2")    
    AddRaceID("Giants", "GiantRace")
    AddRaceID("Giants", "DLC2GhostFrostGiantRace")
    AddRaceID("Giants", "_00GiantFrostRace")

 

and recompiled the pex file

 

 

And then i added

sslCreatureAnimationSlots.AddRaceID("Giants", "DariaRace2") so my startsex-script

Link to comment
4 hours ago, CPU said:

 

I think you have to reset SexLab then to have it to recognize this new race type.

I did it too many years ago, I do not remember 100% how it was working.

 

 

It's the opposite I think, sslCreatureAnimationSlots calls ClearRaceKey when it sets itself up so resetting sexlab will clear the registration of your race.

 

3 hours ago, noreg said:

 

Thanks for your answer, but i don't know what you mean by that.

 

I overwrote the original

sslCreatureAnimationSlots.psc

with this entry

    ClearRaceKey("Giants")
    AddRaceID("Giants", "DariaRace2")    
    AddRaceID("Giants", "GiantRace")
    AddRaceID("Giants", "DLC2GhostFrostGiantRace")
    AddRaceID("Giants", "_00GiantFrostRace")

 

and recompiled the pex file

 

 

And then i added

sslCreatureAnimationSlots.AddRaceID("Giants", "DariaRace2") so my startsex-script

 

Do you have MoreNastyCreatures installed? It clears and re-registers all pre-existing races registered by sexlab, so you need to register your race after MNC registers its races, doing it inside sslCreatureAnimationSlots won't work.

 

I don't know why adding it like that in your script won't work though.

 

There must be some reason both sslCreatureAnimationSlots and the MNC script which extends it don't just call AddRaceID, they clear the race first. I guess calling AddRaceID multiple times without clearing the key can cause some problem, but it doesn't explain why it wouldn't work the first time.

 

 

Link to comment
3 hours ago, DayTri said:

 

It's the opposite I think, sslCreatureAnimationSlots calls ClearRaceKey when it sets itself up so resetting sexlab will clear the registration of your race.

 

 

Do you have MoreNastyCreatures installed? It clears and re-registers all pre-existing races registered by sexlab, so you need to register your race after MNC registers its races, doing it inside sslCreatureAnimationSlots won't work.

 

I don't know why adding it like that in your script won't work though.

 

There must be some reason both sslCreatureAnimationSlots and the MNC script which extends it don't just call AddRaceID, they clear the race first. I guess calling AddRaceID multiple times without clearing the key can cause some problem, but it doesn't explain why it wouldn't work the first time.

 

 

 

It was MNC!

I changed the racekey in MNC and the race is now recognized

but even after that  the animation was not starting, despite seeing startstage in the log, so i deactivated MNC and now it works.

Thank you guys for your help, you are awesome

 

Edited by noreg
Link to comment
23 hours ago, DayTri said:

 

 

You can use this one to avoid hand picking by name:

 

GetCreatureAnimationsByRaceTags(int ActorCount, Race RaceRef, string Tags, string TagSuppress = "", bool RequireAll = true)

 

So instead of the above, something like

 

Actor PlayerRef
Actor Giantess
sexActors[0] = PlayerRef
sexActors[1] = Giantess

anim = GetCreatureAnimationsByRaceTags(2, Giantess.GetRace(), "Some,Tags,Here", "Suppressing,Tag,Here")
Sexlab.StartSex(sexActors,anim)

 

 

And like CPU said you need to register your custom race, once you do sexlab will return the giant animations for it.

 

unfortunately there is no "GetCreatureAnimationsByRaceTags"

do you have a special script installed?

 

i'am dumb forgot the sexlab. at the front

 

No i have to figure out the parameters.

 

Edited by noreg
Link to comment
11 hours ago, noreg said:

 

unfortunately there is no "GetCreatureAnimationsByRaceTags"

do you have a special script installed?

 

 

Sorry my example was bad, this function is defined in SexlabFramework.psc so you need to have a sexlab property and call it like: sexlab.GetCreatureAnimationsByRaceTags(...)

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