Jump to content

Sexlab Aroused Redux December 05 2016


Recommended Posts

Fish, while working on some new arousal related spells I found a little quirk with changing the exposure through UpdateActorExposure on the framework script, which turns out to have some quite big effects:

 

Using (with all settings on default) an actor with ExposureRate = 2.0, if I call UpdateActorExposure 3 times in a row with a value of 1 and 1 second between each call, I get 3 "actor got 2 exposure for debugMsg" messages in the log. The actual Exposure value of the actor however only changes by 3, not by 6. Likewise, using an actor with ExposureRate = 3.0, I get 3 "actor got 3 exposure for debugMsg" messages in the log but the actual Exposure value of the actor only changes by 6, not by 9.

 

The reason is that GetActorExposure on the framework, which is called in UpdateActorExposure to get the initial value, truncates the stored float value to an integer. At an interval of 1 second ( =20 seconds game time at the defaults) the "Math.pow(1.5, - timeSinceUpdate / slaConfig.TimeRateHalfLife)" component is of course extremely close to 1 (0.999953 if you want to know :) ) but because of the "res as int" it is going to be rounded down on every call to UpdateActorExposure.

 

Even for the internal scans this becomes apparent rather quickly, someone with an arousal of 23 should need around 8 game hours for their exposure to reduce by 1, but because of the rounding, it will simply be reduced by 1 on every scan (40 game minutes). After 8 hours = 12 scans it will be 12 points lower, something that take 3.5 days game timeif the actor does not get any exposure at all. I haven't checked further but I assume the same UpdateActorExposure function is also called when modifying exposure for seeing sex, so again in those instances, actors will always lose 1 point for every call, which happens multiple times per scene.

 

The easiest fix would probably be to just roll up the code of Get/Set into UpdateActorExposure, skipping the conversion to int at the end of Get part. This would require no additional functions or interface changes and allows for some other optimizations like not calling the StorageUtil a second time for initial exposure:

 

Int Function UpdateActorExposure(Actor akRef, Int val, String debugMsg = "")
        If (akRef == None)
                return -2
        EndIf
        If (akRef.IsChild())
                return -2
        EndIf
 
        Float valFix = (val as Float) * GetActorExposureRate(akRef)
        Float res = StorageUtil.GetFloatValue(akRef, "SLAroused.ActorExposure", -2.0)
 
        ; roll initial exposure if needed
        If (res < -1.0)
                res = Utility.RandomFloat(0.0, 50.0) + valFix
        Else
                If (slaConfig.TimeRateHalfLife > 0.1)
                        Float timeSinceUpdate = Utility.GetCurrentGameTime() - StorageUtil.GetFloatValue(akRef, "SLAroused.ActorExposureDate", 0.0)
                        res = res * Math.pow(1.5, - timeSinceUpdate / slaConfig.TimeRateHalfLife) + valFix
                EndIf
        EndIf
 
        If (res < 0.0)
                res = 0.0
        ElseIf (res > 100.0)
                res = 100.0
        EndIf
 
        ; store new exposure value
        akRef.SetFactionRank(slaExposure, res as Int)
        StorageUtil.SetFloatValue(akRef, "SLAroused.ActorExposure", res)
        StorageUtil.SetFloatValue(akRef, "SLAroused.ActorExposureDate", Utility.GetCurrentGameTime())
 
        ; use to update actual arousal
        GetActorArousal(akRef)
 
        Debug.Trace(self + ": " + akRef.GetLeveledActorBase().GetName() + " got " + (valFix as Int) + " exposure for " + debugMsg)
 
        return res as Int
EndFunction

 

Link to comment

Fishburger - After installing your .pex file, things works better now in gender (sex preferences) scanning, but having a new problem. You see, I increased arousing from default value 2.9 to 4.0 and reduced scanning time from 120 to 100 seconds. I also set him as exhibitionist and increased his exposure. Now, when my character is reaching set arousal level, instead of getting "I need to have a sex" message, he always receive "My needs are satisfied" (or something like that) message. Would you be kind to check that? Thank you.

 

Link to comment

Although use 1.59c, also I upgrade to 19?

 

Hold off till 20

 

Enabling "Purge dead actors every 10 game days" results in execution every save game load. Was this your intent?

 

function setCleaningTime()
float nextTime = GameDaysPassed.GetValue() + 10.0 
sla_NextMaintenance.SetValue(nextTime)
endFunction

 

No, let me check and see why that is happening.

Link to comment

 

Fish, while working on some new arousal related spells I found a little quirk with changing the exposure through UpdateActorExposure on the framework script, which turns out to have some quite big effects:

 

Using (with all settings on default) an actor with ExposureRate = 2.0, if I call UpdateActorExposure 3 times in a row with a value of 1 and 1 second between each call, I get 3 "actor got 2 exposure for debugMsg" messages in the log. The actual Exposure value of the actor however only changes by 3, not by 6. Likewise, using an actor with ExposureRate = 3.0, I get 3 "actor got 3 exposure for debugMsg" messages in the log but the actual Exposure value of the actor only changes by 6, not by 9.

 

The reason is that GetActorExposure on the framework, which is called in UpdateActorExposure to get the initial value, truncates the stored float value to an integer. At an interval of 1 second ( =20 seconds game time at the defaults) the "Math.pow(1.5, - timeSinceUpdate / slaConfig.TimeRateHalfLife)" component is of course extremely close to 1 (0.999953 if you want to know :) ) but because of the "res as int" it is going to be rounded down on every call to UpdateActorExposure.

 

Even for the internal scans this becomes apparent rather quickly, someone with an arousal of 23 should need around 8 game hours for their exposure to reduce by 1, but because of the rounding, it will simply be reduced by 1 on every scan (40 game minutes). After 8 hours = 12 scans it will be 12 points lower, something that take 3.5 days game timeif the actor does not get any exposure at all. I haven't checked further but I assume the same UpdateActorExposure function is also called when modifying exposure for seeing sex, so again in those instances, actors will always lose 1 point for every call, which happens multiple times per scene.

 

The easiest fix would probably be to just roll up the code of Get/Set into UpdateActorExposure, skipping the conversion to int at the end of Get part. This would require no additional functions or interface changes and allows for some other optimizations like not calling the StorageUtil a second time for initial exposure:

Int Function UpdateActorExposure(Actor akRef, Int val, String debugMsg = "")
        If (akRef == None)
                return -2
        EndIf
        If (akRef.IsChild())
                return -2
        EndIf
 
        Float valFix = (val as Float) * GetActorExposureRate(akRef)
        Float res = StorageUtil.GetFloatValue(akRef, "SLAroused.ActorExposure", -2.0)
 
        ; roll initial exposure if needed
        If (res < -1.0)
                res = Utility.RandomFloat(0.0, 50.0) + valFix
        Else
                If (slaConfig.TimeRateHalfLife > 0.1)
                        Float timeSinceUpdate = Utility.GetCurrentGameTime() - StorageUtil.GetFloatValue(akRef, "SLAroused.ActorExposureDate", 0.0)
                        res = res * Math.pow(1.5, - timeSinceUpdate / slaConfig.TimeRateHalfLife) + valFix
                EndIf
        EndIf
 
        If (res < 0.0)
                res = 0.0
        ElseIf (res > 100.0)
                res = 100.0
        EndIf
 
        ; store new exposure value
        akRef.SetFactionRank(slaExposure, res as Int)
        StorageUtil.SetFloatValue(akRef, "SLAroused.ActorExposure", res)
        StorageUtil.SetFloatValue(akRef, "SLAroused.ActorExposureDate", Utility.GetCurrentGameTime())
 
        ; use to update actual arousal
        GetActorArousal(akRef)
 
        Debug.Trace(self + ": " + akRef.GetLeveledActorBase().GetName() + " got " + (valFix as Int) + " exposure for " + debugMsg)
 
        return res as Int
EndFunction

 

Thanks, I'll fix this Monday

 

 

Link to comment

Version 20 is available

 

This version fixes a major (although infrequent) problem where after sex, the scanner remained locked on the last location where the sex act occurred.  It also contains a change suggested by BeamerMiasma to reduce rounding errors in the original code.  No change yet to purge dead actors.  I am still evaluating that.  If it turns out to be a problem, it just means that you will have your storageutil purged every time you load a save which is not a bad thing anyway as it takes seconds.

 

Special thanks and my humblest apologies to Vachnic to originally found this and reported it a couple of weeks ago.  I could not see how it could happen and so I did not pursue finding the fix as I should have.

 

Also thanks to BeamerMiasma who found the same bug and prompted me to dig a little deeper.

 

 

Link to comment

woah, super fast update!

tankyou!  ;)

 

version 20 is compatible with recent SLframework versions? 1.59c and 1.60fix1?

I have two playthrough profiles in Mod Organizer.. one with SL 1.59c and one with 1.60.. I can update both without problems?

 

thanks again.

 

S.

Link to comment

woah, super fast update!

tankyou!  ;)

 

version 20 is compatible with recent SLframework versions? 1.59c and 1.60fix1?

I have two playthrough profiles in Mod Organizer.. one with SL 1.59c and one with 1.60.. I can update both without problems?

 

thanks again.

 

S.

 

Yes, not changes to framework api.  Acutally, no changes to any api, just what they do when called very slightly.

Link to comment

Fishburger, Blush When Aroused still not works and nobody makes patch for it :(

 

Dave

 

Not much I can do about blush.  Arousal works as before.  If Blush does not, it would be best to post on their forums.

hai there, I noticed there were new entries in the MCM (plus a 0 at the end of a sentence), fixed :)

 

Thanks so much

Link to comment

 

Fishburger, Blush When Aroused still not works and nobody makes patch for it :(

 

Dave

 

Not much I can do about blush.  Arousal works as before.  If Blush does not, it would be best to post on their forums.

hai there, I noticed there were new entries in the MCM (plus a 0 at the end of a sentence), fixed :)

 

Thanks so much

 

 

i posted but no still no fix :(  but thx for answer

 

Link to comment

 

 

Fishburger, Blush When Aroused still not works and nobody makes patch for it :(

 

Dave

 

Not much I can do about blush.  Arousal works as before.  If Blush does not, it would be best to post on their forums.

hai there, I noticed there were new entries in the MCM (plus a 0 at the end of a sentence), fixed :)

 

Thanks so much

 

 

i posted but no still no fix :(  but thx for answer

 

 

 

One of these days, I am gonna approach the author and try and get permission to include blush in with aroused.

 

Link to comment

Just curious... I'm not planning on actually using this method for anything yet, but I was wondering if you could use negative values instead of positive ones so you could decrease arousal?


 


Note: Version 15 comes with a method for mod authors to increase arousal without including Redux as a dependency so long as you only want to increase arousal. Here's how:


 

Link to comment

Version 21 is available

 

This is a minor bug fix.  You don't need to install this if you don't have the time.  The bug was that the newly added variable to control how often we cleaned StorageUtil data was not being initialized.  If you turned on maintenance cleaning, you would also get an inconsequential error in your papyrus log.  Thanks to OldGuy879for finding this.

 

This version also contains a fixed French translation.  Thanks to sdvrfor the work.

Link to comment

 

Just curious... I'm not planning on actually using this method for anything yet, but I was wondering if you could use negative values instead of positive ones so you could decrease arousal?

 

Note: Version 15 comes with a method for mod authors to increase arousal without including Redux as a dependency so long as you only want to increase arousal. Here's how:

 

 

Yep, should work fine with the caveat that the float values passed are coerced to an Int which sometimes has weird results in the Skyrim game engine.

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