nightwing100 Posted June 11, 2025 Posted June 11, 2025 (edited) I recently developed a patch for Sofia and Sexlab Defeat, if you use both mods at once before you probably noticed that Sofia tends to ignore Sexlab Defeat regardless of your settings. I found out the problem seems to be that Sofia often fail to register into Defeat's victim faction, which is why she always getting up and keep fighting and interrupt the assault. I tested a bit and it seems to be working, but I do not felt like using RegisterForSingleUpdate(1.0) was the best idea, as this make sure the game constantly checking if player and Sofia is in the victim faction. Supposedly it's not a big deal, but I wonder if there are better approach. Scriptname DefeatSofiaScript extends Quest Faction Property DefeatFaction Auto ReferenceAlias Property Sofia Auto Event OnInit() RegisterForSingleUpdate(1.0) EndEvent Event OnUpdate() Actor player = Game.GetPlayer() Actor SofiaRef = Sofia.GetActorReference() if player.IsInFaction(DefeatFaction) if !SofiaRef.IsInFaction(DefeatFaction) SofiaRef.AddToFaction(DefeatFaction) endif endif RegisterForSingleUpdate(1.0) EndEvent Sofia Sexlab Defeat Patch.zip [When she hears people still making patch for her] [When she found out what that patch is] Edited June 11, 2025 by nightwing100 1
NymphoElf Posted June 11, 2025 Posted June 11, 2025 (edited) Scriptname DefeatSofiaScript extends Quest Faction Property DefeatFaction Auto Actor Property Player Auto Actor Property Sofia Auto Event OnCombatStateChanged(Actor akTarget, int combatState) If akTarget == Player && combatState == 0 && Player.IsInFaction(DefeatFaction) If Sofia.IsInFaction(DefeatFaction) == False Sofia.AddToFaction(DefeatFaction) EndIf EndIf EndEvent This will wait until the player's combat state is changed. When in Defeat's bleedout, the player's combat state should be 0 and thus allow the rest of the code to trigger. Make the player a persistent Actor property so the script doesn't need to keep fetching the player. You should be able to fill the Player and Sofia actor properties with the appropriate actor selections in the Quest Aliases area. Use "Specific Reference" for each since they are unique, and their reference should therefore never change. Never use "Game.GetPlayer()" - It's a slow method of grabbing the player. I've always found a way to not use it. Also, use this website: ck.uesp.net/wiki Edited June 11, 2025 by NymphoElf 1
nightwing100 Posted June 11, 2025 Author Posted June 11, 2025 Thanks, sadly this seems only works when player is knockdown and not when player surrender for some reason. I spent a few hours adjusting the script, also tried utility wait 5 seconds just in case the script was fire too early. But it still doesn't works.
NymphoElf Posted June 11, 2025 Posted June 11, 2025 15 minutes ago, nightwing100 said: Thanks, sadly this seems only works when player is knockdown and not when player surrender for some reason. See if you can find the surrender function or event in Defeat's scripts and try to capture that function or event in your script. There's a way to do it. You just need to figure it out.
nightwing100 Posted June 11, 2025 Author Posted June 11, 2025 19 minutes ago, NymphoElf said: See if you can find the surrender function or event in Defeat's scripts and try to capture that function or event in your script. There's a way to do it. You just need to figure it out. Alright, I will get back to it when I have more time. For now at least the script works. Thanks again~ 1
shnigs Posted August 16, 2025 Posted August 16, 2025 You're so great. I tried several ways to make sofia can be defeat correctly,which caused more annoying bugs.This is really helpful. Hope you'll get much more success 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now