kaxat Posted July 3, 2021 Posted July 3, 2021 I am almost finished working on a custom mod. My final issue is when it plays group animations with multiple females and one male. Around 25% of the time the male takes one of the female positions in the animation. This looks awkward. I would like to stop it from happening. I have tried many variations on the code. My present code works about 75% of the time. The other 25% a female and male are in the wrong positions. This seems to happen consistently with certain animations. Such as some of the Anubs ones that have FFM in the title. I have tried reverse sorting the actor array. Then it works maybe 20% of the time. Some rare animations seem to expect the male to be in slot 2. Is there a way to always get the actors in the right position? Perhaps I can filter the animations using some method other than tags? I have tried SexLabQuestFramework.PickAnimationsByActors(positions) but this works even less often. It will select MMF animations as well and play those. If I can not filter the animations based on gender positions; perhaps I can alter positions after the scene/thread starts? How do mods normally handle this issue? I have not noticed any other mods having a problem like this. There must be a way to fix it.
Swe-DivX Posted July 3, 2021 Posted July 3, 2021 Download Sexlife for LE and check the script adcSexlifeSex4.psc 1. First check so no other mod have edited the animations tags in Sexlab, some mods adds FFM to MMF animations. 2. In your mod your first Tags is ex Actor 1 to 5 MFFFF, then your mod is sorting the actors, how can the med know the actors is female or male? You have to add ex if Actor4 >= 2 sextags4 = "C" elseif Actor4 == 1 sextags4 = "F" else sextags4 = "M" endif if Actor3 >= 2 sextags3 = "C" elseif Actor3 == 1 sextags3 = "F" else sextags3 = "M" endif if Actor1 >= 2 sextags1 = "C" elseif Actor1 == 1 sextags1 = "F" else sextags1 = "M" endif if Actor2 >= 2 sextags2 = "C" elseif Actor2 == 1 sextags2 = "F" else sextags2 = "M" endif
Seijin8 Posted July 3, 2021 Posted July 3, 2021 47 minutes ago, kaxat said: I am almost finished working on a custom mod. My final issue is when it plays group animations with multiple females and one male. Around 25% of the time the male takes one of the female positions in the animation. This looks awkward. I would like to stop it from happening. I have tried many variations on the code. My present code works about 75% of the time. The other 25% a female and male are in the wrong positions. This seems to happen consistently with certain animations. Such as some of the Anubs ones that have FFM in the title. I have tried reverse sorting the actor array. Then it works maybe 20% of the time. Some rare animations seem to expect the male to be in slot 2. Is there a way to always get the actors in the right position? Perhaps I can filter the animations using some method other than tags? I have tried SexLabQuestFramework.PickAnimationsByActors(positions) but this works even less often. It will select MMF animations as well and play those. If I can not filter the animations based on gender positions; perhaps I can alter positions after the scene/thread starts? How do mods normally handle this issue? I have not noticed any other mods having a problem like this. There must be a way to fix it. You have three separate issues you are encountering: Not all tags are accurate. The tags "MFF" and "FFM" are technically interchangeable, but in reality, not so much. Not really the animator's fault. Sexlab was build with assumptions of how it would be used, but no explicit guidelines, and so people did their own thing. It is less an issue with newer animations, but definitely a problem with older ones. Not all animators start with the female in Actor0 position, and not all of them lay out male/female positions in a way reflected in the tag (for instance, actor0 female, actor1 male, actor 2 female). See above for the why of it. Sexlab's internal sorting isn't foolproof and has no verification check of its own. You can add in your own verification step, or simply go around the sorting and do it yourself. Most of this is solvable by taking a direct hand in how the sexactors[] is created, and who lands in what spot.
kaxat Posted July 3, 2021 Author Posted July 3, 2021 9 hours ago, Swe-DivX said: Download Sexlife for LE and check the script adcSexlifeSex4.psc 1. First check so no other mod have edited the animations tags in Sexlab, some mods adds FFM to MMF animations. 2. In your mod your first Tags is ex Actor 1 to 5 MFFFF, then your mod is sorting the actors, how can the med know the actors is female or male? You have to add ex if Actor4 >= 2 sextags4 = "C" elseif Actor4 == 1 sextags4 = "F" else sextags4 = "M" endif if Actor3 >= 2 sextags3 = "C" elseif Actor3 == 1 sextags3 = "F" else sextags3 = "M" endif if Actor1 >= 2 sextags1 = "C" elseif Actor1 == 1 sextags1 = "F" else sextags1 = "M" endif if Actor2 >= 2 sextags2 = "C" elseif Actor2 == 1 sextags2 = "F" else sextags2 = "M" endif Thank you for your help. Soon after posting I came across the SexLab function MakeAnimationGenderTag(), which operates similar to the code you shared. Except SexLab docs say this this function is used internally to automatically tag animations. So if you use this tag to find an animation it is guaranteed to match. Even if the animation author forgot to add the tag or did it in a different order.
kaxat Posted July 3, 2021 Author Posted July 3, 2021 On 7/2/2021 at 11:45 PM, Seijin8 said: You have three separate issues you are encountering: Not all tags are accurate. The tags "MFF" and "FFM" are technically interchangeable, but in reality, not so much. Not really the animator's fault. Sexlab was build with assumptions of how it would be used, but no explicit guidelines, and so people did their own thing. It is less an issue with newer animations, but definitely a problem with older ones. Not all animators start with the female in Actor0 position, and not all of them lay out male/female positions in a way reflected in the tag (for instance, actor0 female, actor1 male, actor 2 female). See above for the why of it. Sexlab's internal sorting isn't foolproof and has no verification check of its own. You can add in your own verification step, or simply go around the sorting and do it yourself. Most of this is solvable by taking a direct hand in how the sexactors[] is created, and who lands in what spot. Thank you!!! I have been taking a direct hand in sorting sexActors[]. I have tried many different sort orders. However I have not been directing the selected animation. I let SexLab choose the animation based on the tag. Based on your seasoned words I am understanding that SexLab does not have an intelligent sort function. Something that first selects an animation and then resorts the actors for that specific animation. So I built one. I am testing it now. ; Get a random animation that aligns with the number of males females and creatures in the actor list sslBaseAnimation[] function GetGenderAnimation(Actor[] actors) ; Create a tag like MFFF string tag = SexLabQuestFramework.MakeAnimationGenderTag(actors) sslBaseAnimation[] animations ; Select a random animation from the tagged ones sslBaseAnimation[] fullList = SexLabQuestFramework.GetAnimationsByTags(actors.length, tag) if (fullList.length == 0) Debug.Trace("No animations found for tag: " + tag) return fullList endif int randomAnimationKey = Utility.RandomInt(0,(fullList.length - 1)) animations = new sslBaseAnimation[1] animations[0] = fullList[randomAnimationKey] return animations EndFunction ; Sort actor array for the animation. Actor[] function SortGenderPositions(Actor[] positions, sslBaseAnimation animation) int actorIndex = 0 while (positions.Length > actorIndex) Actor currentActor = positions[actorIndex] int currentActorSex = currentActor.GetLeveledActorBase().GetSex() int currentSlotGender = animation.GetGender(actorIndex) ; Actor is not aligned to the gender of the animation slot. if (currentActorSex != currentSlotGender) int positionIndex = 0 ; Iterate through animation positions. Try to find one that matches the current actor gender. while (positions.Length > positionIndex) int newSlotGender = animation.GetGender(positionIndex) ; Found a match if (newSlotGender == currentActorSex) int newSlotActorSex = positions[positionIndex].GetLeveledActorBase().GetSex() ; Check if actor assigned to this position is a gender match for the current actors slot ; This works for animations with 2 genders. 3+ genders will need to add some logic here. if (currentSlotGender == newSlotActorSex) ; Swap actors positions[actorIndex] = positions[positionIndex] positions[positionIndex] = currentActor ; No need to continue the loop positionIndex = positions.Length endif endif positionIndex += 1 endWhile endif actorIndex += 1 endWhile return positions EndFunction To call the above you would do something like this. sslBaseAnimation[] animations = GetGenderAnimation(sexActors) if animations.length == 0 return endif sexActors = SortGenderPositions(sexActors, animations[0]) thread=SexLabQuestFramework.StartSex(sexActors, animations)
alex77r4 Posted July 3, 2021 Posted July 3, 2021 4 hours ago, kaxat said: I have been taking a direct hand in sorting I not know why you waste your time whit that code because SexLab has their own functions to make it: Spoiler ;/* SortActors * * Sorts a list of actors to include either female or male actors first in the array. * * SexLab animations generally expect the female actor to be listed first in a scene. * * * * @param: Actor[] Positions - The list of actors to sort by gender * * @param: bool FemaleFirst [OPTIONAL] - If forced to FALSE, male actors will be sorted first instead of females. * * @return: Actor[] - The final sorted list of actors. */; Actor[] function SortActors(Actor[] Positions, bool FemaleFirst = true) return ThreadLib.SortActors(Positions, FemaleFirst) endFunction Additionally, SexLab have an internal un-documented function, used internally by the system, called SortActorsByAnimation inside sslThreadLibrary that can generate a different order to a specific animation depending of a lot of parameters. Finally, as others users said, some animations has bad tags and/or bad internal information where the real order of the actors inside the real animation not match with the gender specified for that actor position in the internal animation files of sexlab. For that motive, is practically imposible have a 100% perfect match and, sometimes, we see an animation where a man is in a woman position, normally because the animation is bad defined. The inverse is less noticeable because, normally, the woman equip a scholong or a strapon. Then, make the best that you can and forget the perfect 100% match.
Seijin8 Posted July 3, 2021 Posted July 3, 2021 2 hours ago, alex77r4 said: Finally, as others users said, some animations has bad tags and/or bad internal information where the real order of the actors inside the real animation not match with the gender specified for that actor position in the internal animation files of sexlab. For that motive, is practically imposible have a 100% perfect match and, sometimes, we see an animation where a man is in a woman position, normally because the animation is bad defined. The inverse is less noticeable because, normally, the woman equip a scholong or a strapon. Then, make the best that you can and forget the perfect 100% match. Solution for that is to use SLATE or similar to remove the incorrect tag and replace it with one that accurately reflects the animation's actor positions.
alex77r4 Posted July 3, 2021 Posted July 3, 2021 55 minutes ago, Seijin8 said: Solution for that is to use SLATE or similar to remove the incorrect tag and replace it with one that accurately reflects the animation's actor positions. SLATE is useful to correct the tags of the animations, for example when you want mark some group of animations as Aggressive or remove a tag like Lesbian. But SLATE can not solve the ordering problems because, internally, SexLab add the tag FFM to any animation tagged as FMF or MFF. Change that tags with SLATE make absolutely nothing. Really, SexLab not use the tags FFM or MFM to order the actors. Internally call SortActorsByAnimation that call Animation.GetGender that use the sex specified in the JSON files that define the animation. When the content of the JSON not match the sex of the actors inside the real animation SexLab and SLATE can make none. I talking about the JSON files used to define the animation inside SexLab and have this content: Spoiler { "animations": [ { "actors": [ { "add_cum": 1, "stages": [ { "id": "NCK30_cowgirl1_A1_S1" }, { "id": "NCK30_cowgirl1_A1_S2" }, { "id": "NCK30_cowgirl1_A1_S3" }, { "id": "NCK30_cowgirl1_A1_S4" }, { "id": "NCK30_cowgirl1_A1_S5" } ], "type": "Female" }, { "stages": [ { "id": "NCK30_cowgirl1_A2_S1", "strap_on": true }, { "id": "NCK30_cowgirl1_A2_S2", "strap_on": true }, { "id": "NCK30_cowgirl1_A2_S3", "strap_on": true }, { "id": "NCK30_cowgirl1_A2_S4", "strap_on": true }, { "id": "NCK30_cowgirl1_A2_S5", "strap_on": true } ], "type": "Male" } ], "id": "NCK30_cowgirl1", "name": "NCK30 Cowgirl 1", "sound": "Squishing", "stages": [ { "number": 5, "timer": 7 } ], "tags": "NCK30,NCK30,Cowgirl,Sex,Vaginal,Dirty,Loving,MF,Straight" }, { "actors": [ { "add_cum": 1, "stages": [ { "id": "NCK30_cowgirl2_A1_S1" }, { "id": "NCK30_cowgirl2_A1_S2" }, { "id": "NCK30_cowgirl2_A1_S3" }, { "id": "NCK30_cowgirl2_A1_S4" }, { "id": "NCK30_cowgirl2_A1_S5" } ], "type": "Female" }, { "stages": [ { "id": "NCK30_cowgirl2_A2_S1", "strap_on": true }, { "id": "NCK30_cowgirl2_A2_S2", "strap_on": true }, { "id": "NCK30_cowgirl2_A2_S3", "strap_on": true }, { "id": "NCK30_cowgirl2_A2_S4", "strap_on": true }, { "id": "NCK30_cowgirl2_A2_S5", "strap_on": true } ], "type": "Male" } ], "id": "NCK30_cowgirl2", "name": "NCK30 Cowgirl 2", "sound": "Squishing", "stages": [ { "number": 5, "timer": 7 } ], "tags": "NCK30,NCK30,Cowgirl,Sex,Vaginal,Dirty,Loving,MF,Straight" }, { "actors": [ { "add_cum": 1, "stages": [ { "id": "NCK30_cowgirl3_A1_S1" }, { "id": "NCK30_cowgirl3_A1_S2" }, { "id": "NCK30_cowgirl3_A1_S3" }, { "id": "NCK30_cowgirl3_A1_S4" }, { "id": "NCK30_cowgirl3_A1_S5" } ], "type": "Female" }, { "stages": [ { "id": "NCK30_cowgirl3_A2_S1", "strap_on": true }, { "id": "NCK30_cowgirl3_A2_S2", "strap_on": true }, { "id": "NCK30_cowgirl3_A2_S3", "strap_on": true }, { "id": "NCK30_cowgirl3_A2_S4", "strap_on": true }, { "id": "NCK30_cowgirl3_A2_S5", "strap_on": true } ], "type": "Male" } ], "id": "NCK30_cowgirl3", "name": "NCK30 Cowgirl 3", "sound": "Squishing", "stages": [ { "number": 5, "timer": 6 } ], "tags": "NCK30,NCK30,Cowgirl,Sex,Vaginal,Dirty,Loving,MF,Straight" }, { "actors": [ { "add_cum": 1, "stages": [ { "id": "NCK30_reversecowgirl1_A1_S1" }, { "id": "NCK30_reversecowgirl1_A1_S2" }, { "id": "NCK30_reversecowgirl1_A1_S3" }, { "id": "NCK30_reversecowgirl1_A1_S4" }, { "id": "NCK30_reversecowgirl1_A1_S5" } ], "type": "Female" }, { "stages": [ { "id": "NCK30_reversecowgirl1_A2_S1", "strap_on": true }, { "id": "NCK30_reversecowgirl1_A2_S2", "strap_on": true }, { "id": "NCK30_reversecowgirl1_A2_S3", "strap_on": true }, { "id": "NCK30_reversecowgirl1_A2_S4", "strap_on": true }, { "id": "NCK30_reversecowgirl1_A2_S5", "strap_on": true } ], "type": "Male" } ], "id": "NCK30_reversecowgirl1", "name": "NCK30 Reverse Cowgirl 1", "sound": "Squishing", "stages": [ { "number": 5, "timer": 6 } ], "tags": "NCK30,NCK30,Cowgirl,Sex,Vaginal,Dirty,Loving,MF,Straight" }, { "actors": [ { "add_cum": 1, "stages": [ { "id": "NCK30_missionary1_A1_S1" }, { "id": "NCK30_missionary1_A1_S2" }, { "id": "NCK30_missionary1_A1_S3" }, { "id": "NCK30_missionary1_A1_S4" }, { "id": "NCK30_missionary1_A1_S5" } ], "type": "Female" }, { "stages": [ { "id": "NCK30_missionary1_A2_S1", "strap_on": true }, { "id": "NCK30_missionary1_A2_S2", "strap_on": true }, { "id": "NCK30_missionary1_A2_S3", "strap_on": true }, { "id": "NCK30_missionary1_A2_S4", "strap_on": true }, { "id": "NCK30_missionary1_A2_S5", "strap_on": true } ], "type": "Male" } ], "id": "NCK30_missionary1", "name": "NCK30 Missionary 1", "sound": "Squishing", "stages": [ { "number": 5, "timer": 4 } ], "tags": "NCK30,NCK30,Missionary,Leg Up,Sex,Vaginal,Dirty,Loving,Laying,Lying,OnBack,MF,Straight" } ], "name": "NCK30Anims" }
kaxat Posted July 4, 2021 Author Posted July 4, 2021 5 hours ago, alex77r4 said: I not know why you waste your time whit that code because SexLab has their own functions to make it: Hide contents ;/* SortActors * * Sorts a list of actors to include either female or male actors first in the array. * * SexLab animations generally expect the female actor to be listed first in a scene. * * * * @param: Actor[] Positions - The list of actors to sort by gender * * @param: bool FemaleFirst [OPTIONAL] - If forced to FALSE, male actors will be sorted first instead of females. * * @return: Actor[] - The final sorted list of actors. */; Actor[] function SortActors(Actor[] Positions, bool FemaleFirst = true) return ThreadLib.SortActors(Positions, FemaleFirst) endFunction Additionally, SexLab have an internal un-documented function, used internally by the system, called SortActorsByAnimation inside sslThreadLibrary that can generate a different order to a specific animation depending of a lot of parameters. Finally, as others users said, some animations has bad tags and/or bad internal information where the real order of the actors inside the real animation not match with the gender specified for that actor position in the internal animation files of sexlab. For that motive, is practically imposible have a 100% perfect match and, sometimes, we see an animation where a man is in a woman position, normally because the animation is bad defined. The inverse is less noticeable because, normally, the woman equip a scholong or a strapon. Then, make the best that you can and forget the perfect 100% match. Before I was using that function. You will see it in code from the first post. The sorting code I wrote is completely different. It does not naively sort female first. It sorts based on the provided animations internal data. I believe it is the same data SexLab uses when deciding to equip a strapon. In theory if the strapons are equipping in the appropriate slots then this sorting function will also work. But my sort function has one caveat. You must select the animation prior to sorting.
kaxat Posted July 7, 2021 Author Posted July 7, 2021 If someone has the same difficulty they should use the above sorting code. I have tested it with 30+ animations and it correctly sorted for all of them. I have not tested it with creatures. In theory it should work then too. Although it would need more work to support animations with 3 or more genders. If you have male female and creature all in the same animation you could encounter a situation this code is not built to handle.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.