Jump to content

SL 3BA Physics Auto Switcher


Recommended Posts

Posted

SL 3BA Physics Auto Switcher

View File

This is a very small mod, to automatically switch the physics engine for SexLab participants.

 

What this mod does

When a SexLab animation starts, this mod looks whether a participant uses SMP as physics engine. If yes, all is good.

If no and CBP(C) is used, the participants will automatically switch to SMP as long as the scene runs.

This will only work CBP -> SMP for SexLab scenes, not the other way round, as SMP normally is considered the "better" physics engine.

 

Requirements

A running mod setup including

 

Features

  • Small MCM to toggle the mod's functionality
  • Player is handled and toggleable separately
  • Recognizes actors who already use SMP and ignores them
  • Respects the settings of your 3BA MCM menu
  • .esl-ified and .bsa packed, to keep footprint as minimal as possible

 

Should be safe to install mid-game


  • Submitter
  • Submitted
    06/07/2022
  • Category
  • Requires
    CBBE 3BA, SexLab Framework
  • Regular Edition Compatible
    No

 

Posted

Thanks ... the first tests went well ... everything seems to work as I think it should ... ehh sometimes you come across a (often simple) mod and you immediately know that it will become a permanent mod on your list. 

 

? THX

Posted

dont know what a problem, but its not working for me.
i play for male pc so checked only npc's switch. in sexlab scenes physics still cbpc.
esp in bottom of load order

Posted
On 6/11/2022 at 6:52 PM, G1deon388 said:

dont know what a problem, but its not working for me.
i play for male pc so checked only npc's switch. in sexlab scenes physics still cbpc.
esp in bottom of load order

 

Double check in the console, it should tell whether it switched physics.

I will have a look at it though

Posted (edited)
On 6/14/2022 at 9:37 AM, Mister X said:

 

Double check in the console, it should tell whether it switched physics.

I will have a look at it though

yes, messages about changing to smp and back appear in the console at the beginning and at the end of the scene, but in fact the physics remains cbpc
i tried moving the esp to different positions in the load list. nothing changed

ScreenShot4.png

Edited by G1deon388
Posted

Mod Author:  I've been working on setting up Skyrim AE from scratch using different mods then I tried before and have had some blue screen of death crashes to deal with.

 

Lots of mods installed so it has been a challenge figuring out what the issue is.  From Nexus, I downloaded the mod "Find Dangerous ESL plugins" and ran it on my setup.  It flagged your mod as needing work.

 

I can't say yet that that is the cause of my crashes but I thought I should give you a heads-up on what I found.

 

Thanks for contributing!

Posted (edited)

Why it doesn't work is the CBA field for the slpasPhysicsAutoSwitcherScript isn't filled out. I suspect it should reference the Mus3BAddon quest from 3BBB.esp - which incidentally also isn't flagged as a master of this mod and as such it doesn't know where the AddNPCSMP function, needed to do the switching, is.

 

Try attached, (untested because doing something else)

 

 

 

 

 

 

Edited by spoonsinger
Indy fixed doobly wotsit not needed anyway.
Posted
4 hours ago, spoonsinger said:

Why it doesn't work is the CBA field for the slpasPhysicsAutoSwitcherScript isn't filled out. I suspect it should reference the Mus3BAddon quest from 3BBB.esp - which incidentally also isn't flagged as a master of this mod and as such it doesn't know where the AddNPCSMP function, needed to do the switching, is.

 

Try attached, (untested because doing something else)

 

 

 

SLPhysicsAutoSwitcher.esp 696 B · 1 download

Looks like you're right. With your fixed esp, everything worked as it should.
Many thanks for this

Posted

Yep, I also found the culprit: the updated Creation Kit from Steam.

 

I used the CK Downgrade Patcher to be able to install the CK Fixes, now the plugin was created correctly. I didn't think of the old CK bug, where it wasn't able to include .esp files as masters. I upload the fixed version in a moment.

Posted

If you accept suggestions, it would be great to add an option for players scenes only
because with several running scenes, the mod does not always change the physics back (at least for me)

  • 2 weeks later...
Posted

Great mod! Just one humble request: it would be great if the message output could be directed to the console instead directly to the screen for immersive purposes.

Posted (edited)
On 6/20/2022 at 12:30 PM, G1deon388 said:

If you accept suggestions, it would be great to add an option for players scenes only
because with several running scenes, the mod does not always change the physics back (at least for me)

 

Yes, I can do that ?

EDIT: done.

 

2 hours ago, Gudulba said:

Great mod! Just one humble request: it would be great if the message output could be directed to the console instead directly to the screen for immersive purposes.

 

That's not my mod anymore, that's 3BA itself. Maybe ask the author there for that, as I don't want to upload altered scripts without their permission.

Edited by Mister X
Posted
2 hours ago, Mister X said:

That's not my mod anymore, that's 3BA itself. Maybe ask the author there for that, as I don't want to upload altered scripts without their permission.

Ah ok thanks, I wasn't aware of that.

Posted
9 hours ago, Gonzeh said:

Any chance of doing this for BHUNP too?

 

Does BHUNP offer functions to switch physics? The ones I use here are provided by 3BA ^^

Posted
7 hours ago, Mister X said:

 

Does BHUNP offer functions to switch physics? The ones I use here are provided by 3BA ^^

 

It has mostly the same functions as 3BA. So you can swap between CBPC and SMP with a key in-game much like 3BA. I've just swapped from 3BA to BHUNP and then saw your mod release and was like Ohhhhhh that seems cool!

Posted
10 hours ago, misspandamarie said:

Hi i have this error when loading in, i def have 2ba and sexlab installed. image.png.e9028b6170949b6671741762b26e4ed8.png

 

I don't know, the mod wasn't able to find the needed quests. Are the plugins active? Is my mod loaded after both of them?

Posted
21 hours ago, Mister X said:

 

I don't know, the mod wasn't able to find the needed quests. Are the plugins active? Is my mod loaded after both of them?

yes loaded after, and yup both active, tho my  SL doesnt have a framework esm , it does have a sexlab.esm 

Posted
2 hours ago, misspandamarie said:

yes loaded after, and yup both active, tho my  SL doesnt have a framework esm , it does have a sexlab.esm 

 

That's only a typo in the message. The script itself has filled properties and if they aren't filled for some reason, it tries to find the needed quest scripts on runtime.

The message only appears, if both fails, which is very unlikely.

 

I honestly have no idea why it doesn't work for you. I tried to reproduce the problem, but the box really only shows up when I disable at least one of the required plugins.

Posted
8 hours ago, Mister X said:

 

That's only a typo in the message. The script itself has filled properties and if they aren't filled for some reason, it tries to find the needed quest scripts on runtime.

The message only appears, if both fails, which is very unlikely.

 

I honestly have no idea why it doesn't work for you. I tried to reproduce the problem, but the box really only shows up when I disable at least one of the required plugins.

ok, i figured it out. I had my 3ba physics set to cbpc only and hadnt thought about that here bc I used to have it as both:D Thanks for trying to help me figure it out. Works without errors now. 

  • 1 month later...
Posted

I had an intermittent problem that was not caused by this mod. But it was exacerbated by it.

 

Running the 3BA NPC toggle function can cause NPCs to reequip unequipped items. Its like when you give a follower better gloves. When they equip those they also equip their best sword, cuirass, boots, etc.

 

This mod fires the toggle at the start of SexLab scenes. Also at the start of those scenes SexLab is undressing the actor. These two mods race to do their work. If SexLab finishes first then the NPC is briefly undressed. When 3BA adds its invisible item to the NPC inventory the NPC equips it and all of their other best clothing. You have a clothed NPC for the SexLab scene.

 

A similar thing happens at the end. SexLab has extra logic it runs at the end of a scene to only equip the clothes an actor was wearing at the start. But when 3BA toggle fires the actor will equip their best clothing. This can result in them wearing different clothes after the scene then they had at the start. In particular this is noticeable with mods like Slaverun where females frequently have all clothing uneqquiped all the time. But at the end of a 3BA toggle will be fully dressed.

 

I changed two things that seemed to help with this. In your autotoggle mod I changed the starting hook from HookAnimationStart to HookAnimationPrepare. Prepare fires even earlier. This helps with the race condition.

 

That helped the issue become more rare. But did not fix it entirely. Eventually I modified 3BA script to stop adding its item to the inventory prior to equipping it. Just like with the console command you can just call EquipItem() without calling AddItem() first. If the item is not present in the actor inventory it be automatically added. Technically I have heard of some rare edge cases where this does not work properly. But in my testing so far no issues. And the far more obvious problem of fully clothed actors in SexLab went away. I think. Only play tested for 30 mins. Since the problem is intermittent perhaps it is just taking some time off.

I mention this for anyone else experiencing the same issue. Hopefully it helps.

  • 4 weeks later...
Posted
On 8/27/2022 at 8:51 AM, kaxat said:

That helped the issue become more rare. But did not fix it entirely. Eventually I modified 3BA script to stop adding its item to the inventory prior to equipping it. Just like with the console command you can just call EquipItem() without calling AddItem() first. If the item is not present in the actor inventory it be automatically added. Technically I have heard of some rare edge cases where this does not work properly. But in my testing so far no issues. And the far more obvious problem of fully clothed actors in SexLab went away. I think. Only play tested for 30 mins. Since the problem is intermittent perhaps it is just taking some time off.

 

Would you still recommend this as a remedy to the equipping issues you mentioned? Is it as simple as removing all the "akTarget.AddItem(NPCMainXX, 1, true)" lines and recompiling, or is there more to it on the 3BA side?

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