Jump to content

Help with fixing the Female Cover Self mod


Mud

Recommended Posts

Posted

Would anyone please be willing to help me take a whack at the scripts in the mod Female Cover Self Animations - Line of Sight by Rebual? (https://www.nexusmods.com/skyrim/mods/89259) My knowledge of scripting is still too limited to figure out what exactly I'm doing here, but I think I can read scripts well enough to figure out some problem areas. I would ask there, but it would appear the author has not been active in the thread in some time.

 

First off, the mod seems to control line of sight detection with some stuff in the SBA_LOSMonitorEffectScript, wherein it increases the variable SBA_LOSPlayerState by 1 when an actor is viewing the player, and decreases it by 1 when they lose line of sight. The cover function scripts like SBA_CoverSelfPlayerScript then check whether this variable is greater than zero in order to decide if cover animations should be played or stopped on update. However, script lag can occasionally cause this variable to not return to zero and be stuck on a positive value on losing all line of sight with NPCs, which breaks the line of sight functionality by making the player always cover up when naked. So it would appear this needs some kind of failsafe put in, to return the variable to 0 if it detects that the player is not in anyone's line of sight. However, the mod also has an option, enabled by default, to ignore followers in the LOS scan so I do not know if that complicates matters any.

 

Secondly, the mod seems overzealous in its implementation of how it controls the cover animations on line of sight. The code found in the cover self scripts will force the player back to standard idles when losing line of sight, even if the player is using an alternate set of idles. Naturally, this causes it to become incompatible with mods that feature alternate idles such as LL's own Devious Devices, breaking restraint idles if they are worn while nude. I was only able to fix this for myself by adding a dependency to DD and telling the animation update scripts to not fire if the player is wearing an item with DD restraint keywords, but the underlying root of the problem goes unresolved.

  • 1 year later...
Posted
On 7/28/2018 at 7:26 AM, Mud said:

Would anyone please be willing to help me take a whack at the scripts in the mod Female Cover Self Animations - Line of Sight by Rebual? (https://www.nexusmods.com/skyrim/mods/89259) My knowledge of scripting is still too limited to figure out what exactly I'm doing here, but I think I can read scripts well enough to figure out some problem areas. I would ask there, but it would appear the author has not been active in the thread in some time.

 

First off, the mod seems to control line of sight detection with some stuff in the SBA_LOSMonitorEffectScript, wherein it increases the variable SBA_LOSPlayerState by 1 when an actor is viewing the player, and decreases it by 1 when they lose line of sight. The cover function scripts like SBA_CoverSelfPlayerScript then check whether this variable is greater than zero in order to decide if cover animations should be played or stopped on update. However, script lag can occasionally cause this variable to not return to zero and be stuck on a positive value on losing all line of sight with NPCs, which breaks the line of sight functionality by making the player always cover up when naked. So it would appear this needs some kind of failsafe put in, to return the variable to 0 if it detects that the player is not in anyone's line of sight. However, the mod also has an option, enabled by default, to ignore followers in the LOS scan so I do not know if that complicates matters any.

 

Secondly, the mod seems overzealous in its implementation of how it controls the cover animations on line of sight. The code found in the cover self scripts will force the player back to standard idles when losing line of sight, even if the player is using an alternate set of idles. Naturally, this causes it to become incompatible with mods that feature alternate idles such as LL's own Devious Devices, breaking restraint idles if they are worn while nude. I was only able to fix this for myself by adding a dependency to DD and telling the animation update scripts to not fire if the player is wearing an item with DD restraint keywords, but the underlying root of the problem goes unresolved.

I'm sorry for necroing, but did you ever get to the bottom of this problem?  Odd that no one ever replied to you. There has to be a solution.

I gave up making PCEA2 work alongside with Coverself, but it also seem to break FnisSexyMove .. And also 'Bathing in Skyrim' conflicts with Coverself.

 

It must be possible to make them work together.......but how? :classic_unsure::classic_huh:

Posted
On 3/24/2020 at 3:42 PM, blaatand said:

I'm sorry for necroing, but did you ever get to the bottom of this problem?  Odd that no one ever replied to you. There has to be a solution.

I gave up making PCEA2 work alongside with Coverself, but it also seem to break FnisSexyMove .. And also 'Bathing in Skyrim' conflicts with Coverself.

 

It must be possible to make them work together.......but how? :classic_unsure::classic_huh:

Unfortunately, I never came across any elegant solution. Because I wanted to use the mod so much, I just started fixing the first problem by using the console to set SBA_LOSPlayerState to 0 every time I noticed I was covering when I shouldn't be, and I fixed the second problem with a clumsy, hamfisted script and ESP edit to make the effect not run if the player was wearing any of the DD items with arm restraint keywords.

  • 1 year later...
  • 3 weeks later...
Posted
On 12/2/2021 at 8:16 AM, Goodfellow55 said:

Late reply, but did anyone get a fix for this mod?

Nope, still nothing, I'm afraid. There have been DAR mods that added nude cover functions since then, and DAR's conditions could probably be used to make the animations not play when bound by DD for those mods, but the line of sight portion of this one still seems to be a difficult area. There doesn't even seem to be a good way to get the player's stealth detection state in order to use that in place of line of sight checks.

 

The best idea I've got to fix the line of sight function getting stuck right now is to script in a reset on an event that occurs relatively frequently, such as a cell transition, but I'm not sure how to actually write out the necessary scripts myself. Here's my attempt at fixing the issues with LOS getting stuck:

 

Spoiler

Scriptname SBA_LOSMonitorEffectScript extends ActiveMagicEffect  

Spell Property SBA_LOSMonitorAbility Auto
GlobalVariable Property SBA_LOSPlayerState Auto
SBA_configquest Property Config Auto
Actor Property PlayerRef Auto
Actor ActorRef
Bool LOS

 

Event OnUpdate()
  If LOS
    RegisterForSingleLOSLost(ActorRef, PlayerRef)
  Else
    RegisterForSingleLOSGain(ActorRef, PlayerRef)
  EndIf
EndEvent

 

Event OnEffectStart(Actor akTarget, Actor akCaster)
    ActorRef = akTarget
  RegisterForSingleUpdate(Config.LOSMonitorRate)
EndEvent

Event OnEffectFinish(Actor akTarget, Actor akCaster)
  If LOS
    SBA_LOSPlayerState.SetValue(SBA_LOSPlayerState.GetValue() - 1)
  EndIf
    ActorRef.RemoveSpell(SBA_LOSMonitorAbility)
EndEvent

 

Event OnGainLOS(Actor akViewer, ObjectReference akTarget)
  akTarget as Actor
  If (akTarget == PlayerRef)
    SBA_LOSPlayerState.SetValue(SBA_LOSPlayerState.GetValue() + 1)
    LOS = true
    RegisterForSingleUpdate(Config.LOSMonitorRate)
  EndIf
EndEvent

 

Event OnLostLOS(Actor akViewer, ObjectReference akTarget)
  akTarget as Actor
Added a check here to prevent the LOS variable from falling into negative values. This seems to work when using the console to force the variable to 0 while being seen.
  If (akTarget == PlayerRef && SBA_LOSPlayerState.GetValue() as Int > 0)
    SBA_LOSPlayerState.SetValue(SBA_LOSPlayerState.GetValue() - 1)
    LOS = false
    RegisterForSingleUpdate(Config.LOSMonitorRate)
  EndIf
EndEvent

Attempted to make the script reset LOS to zero on every location change. This doesn't work... usually? I did see the variable reset to 0 a couple of times while testing but I would usually be fast travelling across the entirety of Skyrim without seeing it change.
Event OnLocationChange(Location akOldLoc, Location akNewLoc)
    SBA_LOSPlayerState.SetValue(0)
    LOS = false
    RegisterForSingleUpdate(Config.LOSMonitorRate)
EndEvent

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...