nyctophilia Posted August 30, 2015 Posted August 30, 2015 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
BeamerMiasma Posted August 30, 2015 Posted August 30, 2015 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
Guest Posted August 30, 2015 Posted August 30, 2015 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.
fishburger67 Posted August 30, 2015 Author Posted August 30, 2015 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.
parruyo Posted August 30, 2015 Posted August 30, 2015 Although use 1.59c, also I upgrade to 19? Hold off till 20 Ok, thank you.
fishburger67 Posted August 30, 2015 Author Posted August 30, 2015 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
fishburger67 Posted August 31, 2015 Author Posted August 31, 2015 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.
Saeros Posted August 31, 2015 Posted August 31, 2015 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.
fishburger67 Posted August 31, 2015 Author Posted August 31, 2015 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.
ButchDiavolo Posted August 31, 2015 Posted August 31, 2015 Aww Shucks *blush* No apologies neccessary at all. I just stumbled upon it myself while troubleshooting another mod and it didn't seem like that big a deal at the time. I am just glad I could (help) alert you to it, so you could make SAR even better than it already is
Guest Posted August 31, 2015 Posted August 31, 2015 Fishburger - thank you for fixing aroused mod. Version 2.0 calculates arusing level properly now and it displays correct message. Great work.
Dave0000 Posted August 31, 2015 Posted August 31, 2015 i wonder maybe now blush when aroused will work again
fishburger67 Posted September 1, 2015 Author Posted September 1, 2015 i wonder maybe now blush when aroused will work again I don't have time to test it, but if it worked before, it should work now.
CaerHenWen Posted September 1, 2015 Posted September 1, 2015 Does anyone have a list of what mods use Aroused Redux?
fishburger67 Posted September 1, 2015 Author Posted September 1, 2015 Does anyone have a list of what mods use Aroused Redux? Sorry, no, but there are lots
VVilly Posted September 1, 2015 Posted September 1, 2015 fishburger67, tell please, do I need to remain slamainscr.pex after upgrading from v.19 to 20?
fishburger67 Posted September 1, 2015 Author Posted September 1, 2015 fishburger67, tell please, do I need to remain slamainscr.pex after upgrading from v.19 to 20? No, that pex file is included in version 20. Just delete it before installing version 20
Dave0000 Posted September 3, 2015 Posted September 3, 2015 Fishburger, Blush When Aroused still not works and nobody makes patch for it
mangalo Posted September 3, 2015 Posted September 3, 2015 hai there, I noticed there were new entries in the MCM (plus a 0 at the end of a sentence), fixed sexlabaroused_french.txt
fishburger67 Posted September 3, 2015 Author Posted September 3, 2015 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
Dave0000 Posted September 3, 2015 Posted September 3, 2015 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
fishburger67 Posted September 3, 2015 Author Posted September 3, 2015 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.
Content Consumer Posted September 3, 2015 Posted September 3, 2015 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:
fishburger67 Posted September 3, 2015 Author Posted September 3, 2015 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.
fishburger67 Posted September 3, 2015 Author Posted September 3, 2015 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.
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